I need a tail-like funciton that can be used like this:
boost::fusion::vector<char, int, float> a('a', 12, 5.5f);
boost::fusion::vector<int, float> b(12, 5.5f);
boost::fusion::copy( Tail(a), b );
I need a tail-like funciton that can be used like this:
boost::fusion::vector<char, int, float> a('a', 12, 5.5f);
boost::fusion::vector<int, float> b(12, 5.5f);
boost::fusion::copy( Tail(a), b );
Copyright © 2021 Jogjafile Inc.
In the documentation for Boost Fusion, there's a section under Algorithms called Transformation. The Functions listed here notably include one called
pop_front. This seems to do exactly what we want:For your example:
The name
pop_frontis a little strange, considering that it doesn't actually modify the input sequence, but returns a modified result. However,pop_frontcomes from the C++ standard library, where it is used for removing the first element of a collection such as withstd::list::pop_front. Boost Fusion chose this name to be "more consistent" with the standard library.