$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] boost:any/boost::variant for integral/floating type
From: Igor R (boost.lists_at_[hidden])
Date: 2010-06-01 09:31:49
> Â struct get_min_visitor
> Â Â : public boost::static_visitor<>
> Â Â {
> Â Â template <typename T>
> Â Â Â T operator()(T & i) const
> Â Â Â Â {
> Â Â Â Â return std::numeric_limits<T>::min();
> Â Â Â Â }
> Â Â };
You have to pass the result type as an argument to static_visitor
template. Maybe you meant something like this:
//...
AttributeValue(int i) : Value(i)
{}
AttributeValue(double d) : Value(d)
{}
// etc...
struct get_min_visitor : public boost::static_visitor<AttributeValue>
{
template <typename T>
AttributeValue operator()(const T &) const
{
return std::numeric_limits<T>::min();
}
};