Does Boost.Variant require certain warnings to be disabled? The following program generates a warning for me with VC9:
COMPILER INPUT:
#include
#include <iostream>
struct vis : public boost::static_visitor<> {
void operator()( int & ) const { std::cout << "int" << std::endl; }
void operator()( std::string & ) const { std::cout << "string" << std::endl; }
};
int main( int, char * ) {
boost::variant< int, std::string > v;
boost::apply_visitor( vis(), v );
return 0;
}
COMPILER OUTPUT:
1>Compiling...
1>variant_basic.cpp
1>J:\work\ext\boost_ext\boost/variant/variant.hpp(894) : warning C4512: 'boost::detail::variant::invoke_visitor<Visitor>' : assignment operator could not be generated
1> with
1> [
1> Visitor=const vis
1> ]
1> J:\work\ext\boost_ext\boost/variant/variant.hpp(1771) : see reference to class template instantiation 'boost::detail::variant::invoke_visitor<Visitor>' being compiled
1> with
1> [
1> Visitor=const vis
1> ]
1> J:\work\ext\boost_ext\boost/variant/detail/apply_visitor_unary.hpp(72) : see reference to function template instantiation 'void boost::variant::apply_visitor<const Visitor>(Visitor &)' being compiled
1> with
1> [
1> T0_=int,
1> T1=std::string,
1> Visitor=vis
1> ]
1> ..\indep\variant_basic.cpp(11) : see reference to function template instantiation 'void boost::apply_visitor>(const Visitor &,Visitable &)' being compiled
1> with
1> [
1> T0_=int,
1> T1=std::string,
1> Visitor=vis,
1> Visitable=boost::variant
1> ]