fail_rref_assign.cpp 620 B

1234567891011121314151617181920212223242526
  1. // Boost.TypeErasure library
  2. //
  3. // Copyright 2011 Steven Watanabe
  4. //
  5. // Distributed under the Boost Software License Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // $Id$
  10. #include <boost/type_erasure/any.hpp>
  11. #include <boost/type_erasure/builtin.hpp>
  12. #include <boost/mpl/vector.hpp>
  13. using namespace boost::type_erasure;
  14. int main()
  15. {
  16. #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
  17. int i;
  18. any<typeid_<>, _self&&> x(std::move(i));
  19. x = x;
  20. #else
  21. # error "No support for rvalue-reference is enabled. ==> Test fails (as expected) by default!"
  22. #endif
  23. }