Boost logo

Boost Users :

Subject: [Boost-users] [variant] apply_visitor and bind
From: Olivier Tournaire (olitour_at_[hidden])
Date: 2010-06-21 14:13:40


Hi all,

How could you I use bind with apply_visitor?

#include <boost/variant.hpp>
#include <boost/bind.hpp>

struct foo_visitor : public boost::static_visitor<>
{
    template <typename Type>
    result_type operator()(const Type& data, double d) const { return /**/;
}
};

int main (int argc, char** argv)
{
    boost::variant<int, double> foo;
    boost::apply_visitor( boost::bind( &foo_visitor, 2.), foo); // here?
    return 0;
}

Hope you could help

Regards,

Olivier



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