Boost logo

Boost :

Subject: Re: [boost] [parameter] type requirement compiler error
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2011-10-24 15:50:37


Dave Abrahams wrote:
>
> on Mon Oct 24 2011, lcaminiti <lorcaminiti-AT-gmail.com> wrote:
>
>> Hello all,
>>
>> The following parameter type requirement:
>>
>> (required (graph, *) )
>> (optional (root_vertex,
>> (typename
>> boost::graph_traits<graph_type>::vertex_descriptor),
>> *boost::vertices(graph).first) )
>>
>> Generates a GCC error:
>>
>> dfs.05.cpp:40: error: ‘graph_type’ was not declared in this scope
>
> Yeah.... I'm guessing this is what graphs::graph::_ is all about, but
> according to revision control, Daniel made this happen, and there's
> basically no documentation for it. Daniel?
>

Looking at the code expanded by the macros:

namespace graphs {

namespace tag {
    struct graph {
        static char const* keyword_name() { return "graph"; }
        typedef boost::parameter::value_type< boost::mpl::_2, graph,
boost::parameter::void_ > _;
        typedef boost::parameter::value_type< boost::mpl::_2, graph,
boost::parameter::void_ > _1;
    };
}
namespace { ::boost::parameter::keyword<tag::graph> const& _graph =
::boost::parameter::keyword<tag::graph>::instance; }

}

So it should be graphs::tag::graph::_ instead of graph_type but I still get
the errors:

$ g++ -Wall -I../../../../../boost-trunk.cygwin dfs.06.cpp
../../../../../boost-trunk.cygwin/boost/parameter/value_type.hpp: In
instantiation of ‘boost::parameter::value_type<mpl_::arg&lt;2>,
graphs::tag::graph, boost::parameter::void_>’:
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:30:
instantiated from
‘boost::graph_traits<boost::parameter::value_type&lt;mpl_::arg&lt;2>,
graphs::tag::graph, boost::parameter::void_> >’
dfs.06.cpp:85: instantiated from here
../../../../../boost-trunk.cygwin/boost/parameter/value_type.hpp:60: error:
no type named ‘binding’ in ‘struct mpl_::arg<2>’
../../../../../boost-trunk.cygwin/boost/parameter/value_type.hpp:62: error:
no type named ‘binding’ in ‘struct mpl_::arg<2>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp: In
instantiation of
‘boost::graph_traits<boost::parameter::value_type&lt;mpl_::arg&lt;2>,
graphs::tag::graph, boost::parameter::void_> >’:
dfs.06.cpp:85: instantiated from here
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:30: error: no
type named ‘vertex_descriptor’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:31: error: no
type named ‘edge_descriptor’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:32: error: no
type named ‘adjacency_iterator’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:33: error: no
type named ‘out_edge_iterator’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:34: error: no
type named ‘in_edge_iterator’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:35: error: no
type named ‘vertex_iterator’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:36: error: no
type named ‘edge_iterator’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:38: error: no
type named ‘directed_category’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:39: error: no
type named ‘edge_parallel_category’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:40: error: no
type named ‘traversal_category’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:42: error: no
type named ‘vertices_size_type’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:43: error: no
type named ‘edges_size_type’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
../../../../../boost-trunk.cygwin/boost/graph/graph_traits.hpp:44: error: no
type named ‘degree_size_type’ in ‘struct
boost::parameter::value_type<mpl_::arg&lt;2>, graphs::tag::graph,
boost::parameter::void_>’
dfs.06.cpp:85: error: invalid combination of multiple type-specifiers
dfs.06.cpp:85: error: expected `::' before ‘,’ token
dfs.06.cpp:85: error: expected identifier before ‘,’ token
dfs.06.cpp:85: error: template argument 3 is invalid
dfs.06.cpp:85: error: expected `::' before ‘{’ token
dfs.06.cpp:85: error: expected class-name before ‘{’ token
dfs.06.cpp: In function ‘ResultType
graphs::boost_param_default_85depth_first_search(ResultType (*)(), const
Args&, long int, graph_type&, visitor_type&,
boost::parameter::aux::use_default_tag)’:
dfs.06.cpp:85: error: invalid combination of multiple type-specifiers
dfs.06.cpp:85: error: ‘boost::parameter::aux::cast::remove_const’ is not a
type
dfs.06.cpp:85: error: invalid combination of multiple type-specifiers
dfs.06.cpp:85: error: ‘boost::parameter::aux::cast::execute’ is not a type
dfs.06.cpp: In function ‘ResultType
graphs::boost_param_default_85depth_first_search(ResultType (*)(), const
Args&, int, graph_type&, visitor_type&)’:
dfs.06.cpp:85: error: invalid combination of multiple type-specifiers
dfs.06.cpp:85: error: ‘boost::parameter::aux::cast::remove_const’ is not a
type
dfs.06.cpp:85: error: invalid combination of multiple type-specifiers
dfs.06.cpp:85: error: ‘boost::parameter::aux::cast::execute’ is not a type
../../../../../boost-trunk.cygwin/boost/parameter/preprocessor.hpp: At
global scope:
../../../../../boost-trunk.cygwin/boost/parameter/preprocessor.hpp: In
instantiation of
‘boost::parameter::aux::argument_pack<graphs::boost_param_params_85depth_first_search&lt;int>,
const boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
boost::no_property, boost::no_property, boost::no_property, boost::listS>,
const dfs_time_visitor<main::size_type*>, boost::parameter::void_,
boost::parameter::void_, boost::parameter::void_>’:
dfs.06.cpp:132: instantiated from here
../../../../../boost-trunk.cygwin/boost/parameter/preprocessor.hpp:157:
error: no type named ‘parameter_spec0’ in ‘struct
graphs::boost_param_params_85depth_first_search<int>’
../../../../../boost-trunk.cygwin/boost/parameter/preprocessor.hpp:158:
error: no type named ‘parameter_spec0’ in ‘struct
graphs::boost_param_params_85depth_first_search<int>’
../../../../../boost-trunk.cygwin/boost/parameter/preprocessor.hpp: In
instantiation of
‘boost::parameter::aux::argument_pack<graphs::boost_param_params_85depth_first_search&lt;int>,
const boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
boost::no_property, boost::no_property, boost::no_property, boost::listS>,
boost::parameter::void_, boost::parameter::void_, boost::parameter::void_,
boost::parameter::void_>’:
dfs.06.cpp:132: instantiated from here
../../../../../boost-trunk.cygwin/boost/parameter/preprocessor.hpp:157:
error: no type named ‘parameter_spec0’ in ‘struct
graphs::boost_param_params_85depth_first_search<int>’
../../../../../boost-trunk.cygwin/boost/parameter/preprocessor.hpp:158:
error: no type named ‘parameter_spec0’ in ‘struct
graphs::boost_param_params_85depth_first_search<int>’
dfs.06.cpp: In function ‘int main()’:
dfs.06.cpp:132: error: no matching function for call to
‘depth_first_search(main()::G&, dfs_time_visitor<size_type*>&)’

I'm lost... (BTW, the examples in documentation mix old and updated syntaxes
so they don't quite compile... it'd be nice to update them).

Thanks a lot!
--Lorenzo

--
View this message in context: http://boost.2283326.n4.nabble.com/boost-parameter-type-requirement-compiler-error-tp3933830p3934344.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk