|
Boost : |
Subject: [boost] Problem using dijkstra_shortest_paths with Boost 1.51
From: John Wiegley (johnw_at_[hidden])
Date: 2012-09-07 15:49:26
Hello,
I tried building my Ledger project today with Boost 1.51 and clang
--std=c++11, and received the following error:
--8<---------------cut here---------------start------------->8---
/usr/local/include/boost-1_51/boost/mpl/eval_if.hpp:38:26: error: no type named 'type' in
'boost::no_property'
typedef typename f_::type type;
~~~~~~~~~~~~~^~~~
[...]
/Users/johnw/Projects/ledger/src/history.cc:455:3: note: in instantiation of function template
specialization
'boost::dijkstra_shortest_paths<boost::filtered_graph<boost::adjacency_list<boost::vecS,
boost::vecS, boost::undirectedS, boost::property<boost::vertex_name_t, const
ledger::commodity_t *, boost::property<boost::vertex_index_t, unsigned long,
boost::no_property> >, boost::property<boost::edge_weight_t, long,
boost::property<boost::edge_price_ratio_t, std::__1::map<boost::posix_time::ptime,
ledger::amount_t, std::__1::less<boost::posix_time::ptime>,
std::__1::allocator<std::__1::pair<const boost::posix_time::ptime, ledger::amount_t> > >,
boost::property<boost::edge_price_point_t, ledger::price_point_t, boost::no_property> > >,
boost::property<boost::graph_name_t, std::__1::basic_string<char>, boost::no_property>,
boost::listS>,
ledger::recent_edge_weight<boost::adj_list_edge_property_map<boost::undirected_tag, long, long
&, unsigned long, boost::property<boost::edge_weight_t, long,
boost::property<boost::edge_price_ratio_t, std::__1::map<boost::posix_time::ptime,
ledger::amount_t, std::__1::less<boost::posix_time::ptime>,
std::__1::allocator<std::__1::pair<const boost::posix_time::ptime, ledger::amount_t> > >,
boost::property<boost::edge_price_point_t, ledger::price_point_t, boost::no_property> > >,
boost::edge_weight_t>, boost::adj_list_edge_property_map<boost::undirected_tag,
ledger::price_point_t, ledger::price_point_t &, unsigned long,
boost::property<boost::edge_weight_t, long, boost::property<boost::edge_price_ratio_t,
std::__1::map<boost::posix_time::ptime, ledger::amount_t,
std::__1::less<boost::posix_time::ptime>, std::__1::allocator<std::__1::pair<const
boost::posix_time::ptime, ledger::amount_t> > >, boost::property<boost::edge_price_point_t,
ledger::price_point_t, boost::no_property> > >, boost::edge_price_point_t>,
boost::adj_list_edge_property_map<boost::undirected_tag,
std::__1::map<boost::posix_time::ptime, ledger::amount_t,
std::__1::less<boost::posix_time::ptime>, std::__1::allocator<std::__1::pair<const
boost::posix_time::ptime, ledger::amount_t> > >, std::__1::map<boost::posix_time::ptime,
ledger::amount_t, std::__1::less<boost::posix_time::ptime>,
std::__1::allocator<std::__1::pair<const boost::posix_time::ptime, ledger::amount_t> > > &,
unsigned long, boost::property<boost::edge_weight_t, long,
boost::property<boost::edge_price_ratio_t, std::__1::map<boost::posix_time::ptime,
ledger::amount_t, std::__1::less<boost::posix_time::ptime>,
std::__1::allocator<std::__1::pair<const boost::posix_time::ptime, ledger::amount_t> > >,
boost::property<boost::edge_price_point_t, ledger::price_point_t, boost::no_property> > >,
boost::edge_price_ratio_t> >, boost::keep_all>, f_max<long>, boost::distance_combine_t,
boost::bgl_named_params<boost::iterator_property_map<long *,
boost::vec_adj_list_vertex_id_map<boost::property<boost::vertex_name_t, const
ledger::commodity_t *, boost::property<boost::vertex_index_t, unsigned long,
boost::no_property> >, unsigned long>, long, long &>, boost::vertex_distance_t,
boost::bgl_named_params<boost::iterator_property_map<unsigned long *,
boost::vec_adj_list_vertex_id_map<boost::property<boost::vertex_name_t, const
ledger::commodity_t *, boost::property<boost::vertex_index_t, unsigned long,
boost::no_property> >, unsigned long>, unsigned long, unsigned long &>,
boost::vertex_predecessor_t, boost::no_property> > >' requested here
dijkstra_shortest_paths(fg, /* start= */ vs,
^
--8<---------------cut here---------------end--------------->8---
My graph type is:
typedef adjacency_list
<vecS, // Store all edges in a vector
vecS, // Store all vertices in a vector
undirectedS, // Relations are both ways
// All vertices are commodities
property<vertex_name_t, const commodity_t *,
property<vertex_index_t, std::size_t> >,
// All edges are weights computed as the absolute difference between
// the reference time of a search and a known price point. A
// filtered_graph is used to select the recent price point to the
// reference time before performing the search.
property<edge_weight_t, long,
property<edge_price_ratio_t, price_map_t,
property<edge_price_point_t, price_point_t> > >,
// Graph itself has a std::string name
property<graph_name_t, std::string>
> Graph;
The full source is located here:
https://github.com/jwiegley/ledger/blob/next/src/history.cc
What has changed in Boost.Graph since 1.50? The same code builds fine with
all the same compiler options using that version.
Thanks,
-- John Wiegley BoostPro Computing Software Development Training http://www.boostpro.com Clang/LLVM/EDG Compilers C++ Boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk