types_pass.cpp 950 B

1234567891011121314151617181920212223242526272829303132333435
  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 Lock>
  8. // class nested_strict_lock
  9. // {
  10. // public:
  11. // typedef typename Lock::mutex_type mutex_type;
  12. // ...
  13. // };
  14. #include <boost/thread/lock_types.hpp>
  15. #include <boost/thread/strict_lock.hpp>
  16. #include <boost/thread/mutex.hpp>
  17. #include <boost/static_assert.hpp>
  18. #include <boost/type_traits/is_same.hpp>
  19. #include <boost/detail/lightweight_test.hpp>
  20. int main()
  21. {
  22. BOOST_STATIC_ASSERT_MSG((boost::is_same<boost::nested_strict_lock<boost::unique_lock<boost::mutex> >::mutex_type,
  23. boost::mutex>::value), "");
  24. BOOST_STATIC_ASSERT_MSG((boost::is_strict_lock<boost::nested_strict_lock<boost::unique_lock<boost::mutex> > >::value), "");
  25. return boost::report_errors();
  26. }