Boost logo

Boost Users :

From: laurent de Vito (l_de_vito_at_[hidden])
Date: 2005-01-26 11:16:07

>laurent de Vito wrote:
> > I cannot compile the boost/graph library 1.32.0 on a SUN machine using
> > C++ 5.5.
> > I get the following error message :
> >
> > boost_1_32_0/boost/graph/depth_first_search.hpp", line 377: Error:
> > arguments cannot be added in later declarations of the template function
> > in the same scope.
> >
> > which does make sense since the compiler cannot decide which routine
> > depth_first_visit to use
> > if the second routine (line 371) has an extra template but the the extra
> > template has a default value.
>I don't think the compiler is right. The second version should be used if
>- the extra function parameter is explicitly provided, or
>- the function is called with explicitly specified *four* template
> parameters
>In other cases, compiler won't be able to deduce template parameters for
>second function, and will call the first one. I'd suggest to report a bug
>to Sun.

It is a function template and a function template gets its template argument
only via function argument not as part of its name. You can not call the
function with four template arguments without explicitly specifiing the
default argument.
IMHO it is not a compiler bug.

> > Unfortunately the compilation was afterwards not successful;
> > this time I got
> >
> > "boost_1_32_0/boost/graph/named_function_params.hpp", line 500: Error:
> > Cannot return const
> > boost::bgl_named_params<boost::detail::components_recorder<int*>,
> > boost::graph_visitor_t, boost::no_property> from a function that should
> > return boost::detail::error_property_not_found.
>No idea here. The Sun compiler is not considered very standard-compliant,
>and guessing what is wrong here is hard.
>Do you pass root vertex to dfs search? If not, then the function must
>error_property_not_found, and it it tries to return something else, the bug
>is in the 'Dispatcher' logic.

My prog does nothing more than what you can find in
I simply compute the number of components.


>- Volodya
>Boost-users mailing list

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at