|
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<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<mpl_::arg<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<mpl_::arg<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<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<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<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<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<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<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<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<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<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<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<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<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<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<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<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