add_transaction_safe.cpp 665 B

123456789101112131415161718192021222324252627282930
  1. /*<-
  2. Copyright (c) 2016 Barrett Adair
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  5. ->*/
  6. #include <boost/callable_traits/detail/config.hpp>
  7. #ifndef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
  8. int main(){}
  9. #else
  10. //[ add_transaction_safe
  11. #include <type_traits>
  12. #include <boost/callable_traits/add_transaction_safe.hpp>
  13. using boost::callable_traits::add_transaction_safe_t;
  14. using not_safe = int();
  15. using safe = int() transaction_safe;
  16. using safe_added = add_transaction_safe_t<not_safe>;
  17. static_assert(std::is_same<safe, safe_added>{}, "");
  18. int main() {}
  19. //]
  20. #endif