problem in returning mpl::list
Hi
I am trying to write a meta-function class, receiving a list as argument and returning the reduced list by poping one element from the front.
Here is my code
struct Poplist
{
template<class seq>
struct apply
{
typedef pop_front<seq>::type res;
static const int value = size<seq>::value;
};
};
int main()
{
typedef list_c
Stjepan Rajko wrote:
2008/7/27 noman javed
: struct Poplist { template<class seq> struct apply { typedef pop_front<seq>::type res; static const int value = size<seq>::value; }; };
for starts, you need to use typename here:
typedef typename pop_front<seq>::type res;
Also, apply does not have a 'type' member typedef, so I think it is not
a metafunction.
What about (untested)
namespace mpl = ::boost::mpl;
struct Poplist : mpl::lambda
participants (3)
-
John C. Femiani
-
noman javed
-
Stjepan Rajko