Boost logo

Boost Users :

From: Olaf Peter (ope-devel_at_[hidden])
Date: 2008-02-21 15:01:09


Hi Steven,

the problem is related to the static_visitor, e.g. (from docs):

  boost::variant< int, std::string > u;
...

class my_visitor : public boost::static_visitor<int> {
public:
     int operator()(int i) const
     {return i;}

     int operator()(const std::string & str) const
     {return str.length(); }
};

same for static_visitor<> etc. BUT static_visitor<bool>:

class are_strict_equals
     : public boost::static_visitor<bool>
{
public:
     template <typename T, typename U>
     bool operator()( const T &, const U & ) const
     { return false; }

     template <typename T>
     bool operator()( const T & lhs, const T & rhs ) const
     { return lhs == rhs; }
};

is binary! I've got compilation errors due to.

Thanks,
Olaf


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