ref_rv_fail2.cpp 388 B

1234567891011121314151617
  1. //
  2. // Test that an rvalue can't be passed to ref()
  3. //
  4. // Copyright 2014 Agustin Berge
  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. int main()
  12. {
  13. boost::reference_wrapper<int> r = boost::ref( 2 ); // this should produce an ERROR
  14. (void)r;
  15. }