optional_test_ref_assign_portable_minimum.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (C) 2014 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/lightweight_test.hpp"
  15. #include "testable_classes.hpp"
  16. #include "optional_ref_assign_test_defs.hpp"
  17. using boost::optional;
  18. using boost::none;
  19. template <typename T>
  20. void test_optional_ref_assignment()
  21. {
  22. test_copy_assignment_for<T>();
  23. test_rebinding_assignment_semantics<T>();
  24. test_copy_assignment_for_const<T>();
  25. test_copy_assignment_for_noconst_const<T>();
  26. test_rebinding_assignment_semantics_const<T>();
  27. test_rebinding_assignment_semantics_noconst_const<T>();
  28. }
  29. int main()
  30. {
  31. test_optional_ref_assignment<ScopeGuard>();
  32. test_optional_ref_assignment<Abstract>();
  33. test_optional_ref_assignment< optional<int> >();
  34. return boost::report_errors();
  35. }