Files
fusion/test/algorithm/ticket-5490.cpp

39 lines
1005 B
C++
Raw Normal View History

2018-07-07 01:23:11 +09:00
/*=============================================================================
Copyright (c) 2018 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/transform.hpp>
#include <boost/mpl/quote.hpp>
#include <boost/mpl/placeholders.hpp>
using namespace boost::fusion;
template <typename>
struct predicate {};
struct unique {};
template <typename>
struct meta_func
{
typedef unique result_type;
template <typename T>
unique operator()(const T&) const;
};
int main()
{
vector<int> v;
typedef predicate<boost::mpl::_1> lambda_t;
typedef boost::mpl::quote1<predicate> quote_t;
vector<unique> l = transform(v, meta_func<lambda_t>());
vector<unique> q = transform(v, meta_func<quote_t>());
}