Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78329 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2012-05-04 23:07:46


Author: jewillco
Date: 2012-05-04 23:07:40 EDT (Fri, 04 May 2012)
New Revision: 78329
URL: http://svn.boost.org/trac/boost/changeset/78329

Log:
Removed use of Boost.Typeof to enhance portability; using Boost.ResultOf instead
Text files modified:
   trunk/boost/graph/named_function_params.hpp | 10 ++++++++--
   trunk/boost/graph/stoer_wagner_min_cut.hpp | 6 ++++--
   2 files changed, 12 insertions(+), 4 deletions(-)

Modified: trunk/boost/graph/named_function_params.hpp
==============================================================================
--- trunk/boost/graph/named_function_params.hpp (original)
+++ trunk/boost/graph/named_function_params.hpp 2012-05-04 23:07:40 EDT (Fri, 04 May 2012)
@@ -17,9 +17,8 @@
 #include <boost/preprocessor.hpp>
 #include <boost/parameter/name.hpp>
 #include <boost/parameter/binding.hpp>
-#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits.hpp>
 #include <boost/mpl/not.hpp>
-#include <boost/type_traits/add_reference.hpp>
 #include <boost/graph/properties.hpp>
 #include <boost/graph/detail/d_ary_heap.hpp>
 #include <boost/property_map/property_map.hpp>
@@ -686,6 +685,13 @@
 
       make_priority_queue_from_arg_pack_gen(KeyT defaultKey_) : defaultKey(defaultKey_) { }
 
+ template <class F>
+ struct result {
+ typedef typename remove_const<typename remove_reference<typename function_traits<F>::arg1_type>::type>::type graph_type;
+ typedef typename remove_const<typename remove_reference<typename function_traits<F>::arg2_type>::type>::type arg_pack_type;
+ typedef typename priority_queue_maker<graph_type, arg_pack_type, KeyT, ValueT, PriorityQueueTag, KeyMapTag, IndexInHeapMapTag, Compare>::priority_queue_type type;
+ };
+
       template <class Graph, class ArgPack>
       typename priority_queue_maker<Graph, ArgPack, KeyT, ValueT, PriorityQueueTag, KeyMapTag, IndexInHeapMapTag, Compare>::priority_queue_type
       operator()(const Graph& g, const ArgPack& ap) const {

Modified: trunk/boost/graph/stoer_wagner_min_cut.hpp
==============================================================================
--- trunk/boost/graph/stoer_wagner_min_cut.hpp (original)
+++ trunk/boost/graph/stoer_wagner_min_cut.hpp 2012-05-04 23:07:40 EDT (Fri, 04 May 2012)
@@ -20,7 +20,7 @@
 #include <boost/graph/detail/d_ary_heap.hpp>
 #include <boost/property_map/property_map.hpp>
 #include <boost/tuple/tuple.hpp>
-#include <boost/typeof/typeof.hpp>
+#include <boost/utility/result_of.hpp>
 
 namespace boost {
   
@@ -218,7 +218,9 @@
     typedef boost::bgl_named_params<P, T, R> params_type;
     BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(params_type, params)
     
- BOOST_AUTO(pq, (boost::detail::make_priority_queue_from_arg_pack_gen<boost::graph::keywords::tag::max_priority_queue, weight_type, vertex_descriptor, std::greater<weight_type> >(choose_param(get_param(params, boost::distance_zero_t()), weight_type(0)))(g, arg_pack)));
+ typedef boost::detail::make_priority_queue_from_arg_pack_gen<boost::graph::keywords::tag::max_priority_queue, weight_type, vertex_descriptor, std::greater<weight_type> > gen_type;
+ gen_type gen(choose_param(get_param(params, boost::distance_zero_t()), weight_type(0)));
+ typename boost::result_of<gen_type(const UndirectedGraph&, const arg_pack_type&)>::type pq = gen(g, arg_pack);
     
     return boost::detail::stoer_wagner_min_cut(g,
         weights,


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk