copy_ctor_fail.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // Copyright (C) 2011 Vicente J. Botet Escriba
  10. //
  11. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  12. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  13. // <boost/thread/future.hpp>
  14. // class packaged_task<R>
  15. // packaged_task(packaged_task&) = delete;
  16. #define BOOST_THREAD_VERSION 4
  17. #if BOOST_THREAD_VERSION == 4
  18. #define BOOST_THREAD_DETAIL_SIGNATURE double()
  19. #else
  20. #define BOOST_THREAD_DETAIL_SIGNATURE double
  21. #endif
  22. #include <boost/thread/future.hpp>
  23. #include <boost/detail/lightweight_test.hpp>
  24. class A
  25. {
  26. long data_;
  27. public:
  28. explicit A(long i) : data_(i) {}
  29. long operator()() const {return data_;}
  30. long operator()(long i, long j) const {return data_ + i + j;}
  31. };
  32. int main()
  33. {
  34. {
  35. boost::packaged_task<BOOST_THREAD_DETAIL_SIGNATURE> p0(A(5));
  36. boost::packaged_task<BOOST_THREAD_DETAIL_SIGNATURE> p(p0);
  37. }
  38. return boost::report_errors();
  39. }
  40. #include "../../../remove_error_code_unused_warning.hpp"