ref_implicit_fail2.cpp 382 B

1234567891011121314151617181920
  1. //
  2. // Rvalues should not implicitly convert to a reference_wrapper
  3. //
  4. // Copyright 2014 Peter Dimov
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt
  9. //
  10. #include <boost/ref.hpp>
  11. void f( boost::reference_wrapper< int const > )
  12. {
  13. }
  14. int main()
  15. {
  16. f( 1 ); // should fail
  17. }