Boost logo

Boost Users :

From: hfye-wila_at_[hidden]
Date: 2008-07-22 18:20:50


Does Boost.Variant require certain warnings to be disabled? The following program generates a warning for me with VC9:

COMPILER INPUT:
#include <boost/variant.hpp>
#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<T0_,T1>::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<vis,boost::variant<T0_,T1>>(const Visitor &,Visitable &)' being compiled
1> with
1> [
1> T0_=int,
1> T1=std::string,
1> Visitor=vis,
1> Visitable=boost::variant<int,std::string>
1> ]


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