• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Copyright (c) 2018 Kohei Takahashi
3 
4     Distributed under the Boost Software License, Version 1.0. (See accompanying
5     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #include <boost/fusion/include/vector.hpp>
8 #include <boost/fusion/include/transform.hpp>
9 #include <boost/mpl/quote.hpp>
10 #include <boost/mpl/placeholders.hpp>
11 #include <boost/core/ignore_unused.hpp>
12 
13 using namespace boost::fusion;
14 
15 template <typename>
16 struct predicate {};
17 
18 struct unique {};
19 
20 template <typename>
21 struct meta_func
22 {
23     typedef unique result_type;
24 
25     template <typename T>
26     unique operator()(const T&) const;
27 };
28 
main()29 int main()
30 {
31     vector<int> v;
32 
33     typedef predicate<boost::mpl::_1> lambda_t;
34     typedef boost::mpl::quote1<predicate> quote_t;
35 
36     vector<unique> l = transform(v, meta_func<lambda_t>());
37 
38     vector<unique> q = transform(v, meta_func<quote_t>());
39 
40     boost::ignore_unused(l, q);
41 }
42