|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53151 - in trunk: boost/graph boost/graph/detail libs/graph/test
From: asutton_at_[hidden]
Date: 2009-05-21 10:33:19
Author: asutton
Date: 2009-05-21 10:33:18 EDT (Thu, 21 May 2009)
New Revision: 53151
URL: http://svn.boost.org/trac/boost/changeset/53151
Log:
Deprecated use of graph_detail::is_same. Removed usage from visitors
header, and tagged the defining file with the #warning.
Text files modified:
trunk/boost/graph/detail/is_same.hpp | 8 ++++++++
trunk/boost/graph/visitors.hpp | 23 +++++++++--------------
trunk/libs/graph/test/bron_kerbosch_all_cliques.cpp | 2 +-
trunk/libs/graph/test/tiernan_all_cycles.cpp | 2 +-
4 files changed, 19 insertions(+), 16 deletions(-)
Modified: trunk/boost/graph/detail/is_same.hpp
==============================================================================
--- trunk/boost/graph/detail/is_same.hpp (original)
+++ trunk/boost/graph/detail/is_same.hpp 2009-05-21 10:33:18 EDT (Thu, 21 May 2009)
@@ -9,6 +9,14 @@
#ifndef BOOST_GRAPH_DETAIL_IS_SAME_HPP
#define BOOST_GRAPH_DETAIL_IS_SAME_HPP
+// Deprecate the use of this header.
+// TODO: Remove this file from trunk/release in 1.41/1.42.
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
+# pragma message ("Warning: This header is deprecated. Please use: boost/type_traits/is_same.hpp")
+#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
+# warning "This header is deprecated. Please use: boost/type_traits/is_same.hpp"
+#endif
+
#include <boost/mpl/if.hpp>
namespace boost {
Modified: trunk/boost/graph/visitors.hpp
==============================================================================
--- trunk/boost/graph/visitors.hpp (original)
+++ trunk/boost/graph/visitors.hpp 2009-05-21 10:33:18 EDT (Thu, 21 May 2009)
@@ -15,10 +15,11 @@
#include <iosfwd>
#include <boost/config.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/mpl/bool.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/limits.hpp>
-#include <boost/graph/detail/is_same.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
// Stay out of the way of the concept checking class
@@ -82,9 +83,6 @@
struct on_edge_not_minimized {
enum { num = detail::on_edge_not_minimized_num }; };
- struct true_tag { enum { num = true }; };
- struct false_tag { enum { num = false }; };
-
//========================================================================
// base_visitor and null_visitor
@@ -107,21 +105,20 @@
namespace detail {
template <class Visitor, class T, class Graph>
- inline void
- invoke_dispatch(Visitor& v, T x, Graph& g, true_tag) {
+ inline void invoke_dispatch(Visitor& v, T x, Graph& g, mpl::true_) {
v(x, g);
}
+
template <class Visitor, class T, class Graph>
- inline void
- invoke_dispatch(Visitor&, T, Graph&, false_tag) { }
+ inline void invoke_dispatch(Visitor&, T, Graph&, mpl::false_)
+ { }
} // namespace detail
template <class Visitor, class Rest, class T, class Graph, class Tag>
inline void
invoke_visitors(std::pair<Visitor, Rest>& vlist, T x, Graph& g, Tag tag) {
typedef typename Visitor::event_filter Category;
- typedef typename graph_detail::is_same<Category, Tag>::is_same_tag
- IsSameTag;
+ typedef typename is_same<Category, Tag>::type IsSameTag;
detail::invoke_dispatch(vlist.first, x, g, IsSameTag());
invoke_visitors(vlist.second, x, g, tag);
}
@@ -130,8 +127,7 @@
inline void
invoke_visitors(base_visitor<Visitor>& vis, T x, Graph& g, Tag) {
typedef typename Visitor::event_filter Category;
- typedef typename graph_detail::is_same<Category, Tag>::is_same_tag
- IsSameTag;
+ typedef typename is_same<Category, Tag>::type IsSameTag;
Visitor& v = static_cast<Visitor&>(vis);
detail::invoke_dispatch(v, x, g, IsSameTag());
}
@@ -140,8 +136,7 @@
inline void
invoke_visitors(Visitor& v, T x, Graph& g, Tag) {
typedef typename Visitor::event_filter Category;
- typedef typename graph_detail::is_same<Category, Tag>::is_same_tag
- IsSameTag;
+ typedef typename is_same<Category, Tag>::type IsSameTag;
detail::invoke_dispatch(v, x, g, IsSameTag());
}
#endif
Modified: trunk/libs/graph/test/bron_kerbosch_all_cliques.cpp
==============================================================================
--- trunk/libs/graph/test/bron_kerbosch_all_cliques.cpp (original)
+++ trunk/libs/graph/test/bron_kerbosch_all_cliques.cpp 2009-05-21 10:33:18 EDT (Thu, 21 May 2009)
@@ -54,7 +54,7 @@
// Generate random graphs with 15 vertices and 15% probability
// of edge connection.
static const size_t N = 20;
- static const float P = 0.1;
+ static const double P = 0.1;
boost::minstd_rand rng;
Graph g(er(rng, N, P), er(), N);
Modified: trunk/libs/graph/test/tiernan_all_cycles.cpp
==============================================================================
--- trunk/libs/graph/test/tiernan_all_cycles.cpp (original)
+++ trunk/libs/graph/test/tiernan_all_cycles.cpp 2009-05-21 10:33:18 EDT (Thu, 21 May 2009)
@@ -52,7 +52,7 @@
// Generate random graphs with 15 vertices and 15% probability
// of edge connection.
static const size_t N = 20;
- static const float P = 0.1;
+ static const double P = 0.1;
boost::minstd_rand rng;
Graph g(er(rng, N, P), er(), N);
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