bug7624.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /*=============================================================================
  2. Copyright (c) 2005-2007 Dan Marsden
  3. Copyright (c) 2005-2007 Joel de Guzman
  4. Copyright (c) 2014 John Fletcher
  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/phoenix.hpp>
  9. #include <boost/range/as_literal.hpp>
  10. #include <boost/core/lightweight_test.hpp>
  11. using namespace boost::phoenix::placeholders;
  12. using namespace boost::phoenix;
  13. int main()
  14. {
  15. char X('x');
  16. find(boost::as_literal("fox"), 'x')(); // works
  17. #if !(defined (BOOST_NO_CXX11_DECLTYPE) || \
  18. defined (BOOST_INTEL_CXX_VERSION) || \
  19. (BOOST_GCC_VERSION < 40500) )
  20. const char *Y = find(boost::as_literal("fox"), arg1)('x'); // works for C++11
  21. #else
  22. const char *Y = find(boost::as_literal("fox"), construct<char>(arg1))('x'); // works
  23. #endif
  24. BOOST_TEST(X == *Y);
  25. return boost::report_errors();
  26. }