any_test_temporary_to_ref_failed.cpp 680 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Unit test for boost::any.
  2. //
  3. // See http://www.boost.org for most recent version, including documentation.
  4. //
  5. // Copyright Antony Polukhin, 2013-2019.
  6. //
  7. // Distributed under the Boost
  8. // Software License, Version 1.0. (See accompanying file
  9. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt).
  10. #include <cstdlib>
  11. #include <string>
  12. #include <utility>
  13. #include <boost/any.hpp>
  14. #include "test.hpp"
  15. #include <boost/move/move.hpp>
  16. #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
  17. int main()
  18. {
  19. BOOST_STATIC_ASSERT(false);
  20. return EXIT_SUCCESS;
  21. }
  22. #else
  23. int main()
  24. {
  25. int i = boost::any_cast<int&>(10);
  26. (void)i;
  27. return EXIT_SUCCESS;
  28. }
  29. #endif