any_test_cv_to_rv_failed.cpp 718 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. boost::any const cvalue(10);
  26. int i = boost::any_cast<int&&>(cvalue);
  27. (void)i;
  28. return EXIT_SUCCESS;
  29. }
  30. #endif