Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Variant: Passing visitor as a function argument
From: Igor R (boost.lists_at_[hidden])
Date: 2009-09-03 12:34:20


>    void  visit(boost::static_visitor<> const& visitor)
>    {
>        BOOST_FOREACH(Attr attr, i_attrList)
>        {
>            boost::apply_visitor(visitor, attr);
>        }
>    }

You can define a template method:

template<class Visitor> void visit(Visitor visitor)
{
   BOOST_FOREACH(Attr attr, i_attrList)
   {
       boost::apply_visitor(visitor, attr);
   }
}


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