Boost logo

Boost Users :

From: Sebastian Weber (sebastian.weber_at_[hidden])
Date: 2006-04-10 13:17:40


Hi!

> > /home/sebi/projects/diplom/src/boost_1_33_1/boost/graph/adjacency_list_io.hpp:151: error: 'boost::GraphParser<Graph_t, VertexProperty, EdgeProperty, VertexPropertySubset, EdgePropertySubset>::operator()(std::istream&) [with Graph_t = boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, VertexProperty = boost::no_property, EdgeProperty = boost::no_property, VertexPropertySubset = boost::no_property, EdgePropertySubset = boost::no_property]::State' uses local type 'boost::GraphParser<Graph_t, VertexProperty, EdgeProperty, VertexPropertySubset, EdgePropertySubset>::operator()(std::istream&) [with Graph_t = boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, VertexProperty = boost::no_property, EdgeProperty = boos
> > t::no_property, VertexPropertySubset = boost::no_property, EdgePropertySubset = boost::no_
> > property]::State'
>
> This says that the GraphParser class -- which you apparently defined
> in namespace boost; naughty, naughty! -- has an operator() with a

Well, the GraphParser-class is placed in adjacency_list_io within the
namespace boost, that wasn't me.

> locally-defined type State, and you're trying to pass an instance of
> that type off to a function template.
>
> It's a rule of C++ that you can't instantiate templates on
> function-local types.

Oh, as I have learned template-stuff by doing it and not reading a book
(which I probably should have), I'm actually not that familiar with
this. In short: I don't understand neither the problem nor do I know how
to fix it.

>
> Learning to read your compiler's error messages can be difficult, but
> it is well worth the effort. STLFilt can help to make them more
> approachable (http://www.bdsoft.com)

Well, I looked there, but STLFilt doesn't support g++ 4.0 (to be exact:
g++-4.0 (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)). And
gcc-3.3 (and 3.4) DOES compile my code without any complaints.

Any other ideas?

Sebastian

>
> HTH,


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