copy_ctor_fail.cpp 806 B

1234567891011121314151617181920212223242526272829303132
  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/locks.hpp>
  6. // template <class Mutex> class reverse_lock;
  7. // reverse_lock(reverse_lock const&) = delete;
  8. #include <boost/thread/lock_types.hpp>
  9. #include <boost/thread/reverse_lock.hpp>
  10. #include <boost/thread/mutex.hpp>
  11. #include <boost/thread/lock_types.hpp>
  12. boost::mutex m0;
  13. boost::mutex m1;
  14. int main()
  15. {
  16. boost::mutex m0;
  17. boost::unique_lock<boost::mutex> lk0(m0);
  18. {
  19. boost::reverse_lock<boost::unique_lock<boost::mutex> > lg0(lk0);
  20. boost::reverse_lock<boost::unique_lock<boost::mutex> > lg1(lg0);
  21. }
  22. }
  23. #include "../../../../remove_error_code_unused_warning.hpp"