deque_copy.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*=============================================================================
  2. Copyright (c) 1999-2003 Jaakko Jarvi
  3. Copyright (c) 2001-2011 Joel de Guzman
  4. Copyright (c) 2006 Dan Marsden
  5. Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. ==============================================================================*/
  8. #include <boost/fusion/container/deque/deque.hpp>
  9. #include <boost/fusion/container/generation/make_deque.hpp>
  10. #include <boost/fusion/container/generation/deque_tie.hpp>
  11. #define FUSION_SEQUENCE deque
  12. #include "copy.hpp"
  13. using namespace test_detail;
  14. // c++11 deque has bug, cannot properly copy-assign from a const value
  15. template <typename T>
  16. struct skip_const_lvalue_assignment
  17. {
  18. template <typename Source, typename Expected>
  19. bool operator()(Source const& source, Expected const& expected) const
  20. {
  21. return
  22. run< can_implicit_construct<T> >(source, expected) &&
  23. run< can_construct<T> >(source, expected) &&
  24. run< can_rvalue_assign<T> >(source, expected) &&
  25. run< can_lvalue_assign<T> >(source, expected);
  26. }
  27. };
  28. int
  29. main()
  30. {
  31. #if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
  32. test<skip_const_lvalue_assignment>();
  33. #else
  34. test<can_copy>();
  35. #endif
  36. return boost::report_errors();
  37. }