types_pass.cpp 829 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (C) 2012 Vicente J. Botet Escriba
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // <boost/thread/mutex.hpp>
  6. // <mutex>
  7. // template <class Mutex>
  8. // class strict_lock
  9. // {
  10. // public:
  11. // typedef Mutex mutex_type;
  12. // ...
  13. // };
  14. #include <boost/thread/strict_lock.hpp>
  15. #include <boost/thread/mutex.hpp>
  16. #include <boost/static_assert.hpp>
  17. #include <boost/type_traits/is_same.hpp>
  18. #include <boost/detail/lightweight_test.hpp>
  19. int main()
  20. {
  21. BOOST_STATIC_ASSERT_MSG((boost::is_same<boost::strict_lock<boost::mutex>::mutex_type,
  22. boost::mutex>::value), "");
  23. BOOST_STATIC_ASSERT_MSG((boost::is_strict_lock<boost::strict_lock<boost::mutex> >::value), "");
  24. return boost::report_errors();
  25. }