事情是這樣的:
#include <iostream>
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/algorithm/transformation/filter_if.hpp>
#include <boost/fusion/include/at_c.hpp>
#include <boost/fusion/include/equal_to.hpp>
#include <boost/fusion/include/make_vector.hpp>
#include <boost/mpl/assert.hpp>
using namespace boost::fusion;
int main(void)
{
int a = 10;
double b = 11.;
vector<int, int&, double, double&> vec(1, a, 13., b);
if(filter_if<boost::mpl::not_<boost::is_reference<boost::mpl::_>>>(vec) == make_vector(1, 13.))
std::cout << "MATCH" << std::endl;
}
來源
2012-11-18 20:16:33
Nim
其實,這裏有個例子下**僅打印指針**:http://www.boost.org/doc/libs/1_61_0/libs/fusion/ DOC/HTML /融合/ quick_start.html –