ticket-5490.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*=============================================================================
  2. Copyright (c) 2018 Kohei Takahashi
  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. ==============================================================================*/
  6. #include <boost/fusion/include/vector.hpp>
  7. #include <boost/fusion/include/transform.hpp>
  8. #include <boost/mpl/quote.hpp>
  9. #include <boost/mpl/placeholders.hpp>
  10. #include <boost/core/ignore_unused.hpp>
  11. using namespace boost::fusion;
  12. template <typename>
  13. struct predicate {};
  14. struct unique {};
  15. template <typename>
  16. struct meta_func
  17. {
  18. typedef unique result_type;
  19. template <typename T>
  20. unique operator()(const T&) const;
  21. };
  22. int main()
  23. {
  24. vector<int> v;
  25. typedef predicate<boost::mpl::_1> lambda_t;
  26. typedef boost::mpl::quote1<predicate> quote_t;
  27. vector<unique> l = transform(v, meta_func<lambda_t>());
  28. vector<unique> q = transform(v, meta_func<quote_t>());
  29. boost::ignore_unused(l, q);
  30. }