Boost logo

Boost Users :

From: noman javed (noman_bwp_at_[hidden])
Date: 2008-07-27 07:37:04


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<int,0,1,2,3,4,5> numbers;
      cout<<Poplist::apply<numbers>::value<<endl;
}

And I got the following error

example.cpp:20: error: type ¡boost::mpl::pop_front<seq>¢ is not derived from type ¡Poplist::apply<seq>¢
example.cpp:20: error: expected ¡;¢ before ¡res¢

Can someone please rectify my code

Thanks in advance



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net