optional_test_ref_convert_assign_non_int.cpp 956 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (C) 2015 Andrzej Krzemienski.
  2. //
  3. // Use, modification, and distribution is subject to the Boost Software
  4. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/lib/optional for documentation.
  8. //
  9. // You are welcome to contact the author at: akrzemi1@gmail.com
  10. #include "boost/optional/optional.hpp"
  11. #ifdef __BORLANDC__
  12. #pragma hdrstop
  13. #endif
  14. #include "boost/core/addressof.hpp"
  15. #include "boost/core/enable_if.hpp"
  16. #include "boost/core/lightweight_test.hpp"
  17. #include "testable_classes.hpp"
  18. #include "optional_ref_assign_test_defs.hpp"
  19. template <typename T>
  20. void test_all_const_cases()
  21. {
  22. test_converting_assignment<T, T>();
  23. test_converting_assignment<const T, const T>();
  24. test_converting_assignment<T, const T>();
  25. }
  26. int main()
  27. {
  28. test_all_const_cases<ScopeGuard>();
  29. test_all_const_cases<Abstract>();
  30. return boost::report_errors();
  31. }