Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82544 - in sandbox-branches/geometry/index/boost/geometry/extensions/index: . algorithms detail detail/algorithms translator
From: adam.wulkiewicz_at_[hidden]
Date: 2013-01-18 19:23:49


Author: awulkiew
Date: 2013-01-18 19:23:48 EST (Fri, 18 Jan 2013)
New Revision: 82544
URL: http://svn.boost.org/trac/boost/changeset/82544

Log:
MSVC compilation error fixed.
is_valid moved to detail namespace.
Added:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/algorithms/
   sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/algorithms/is_valid.hpp (contents, props changed)
Removed:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/algorithms/is_valid.hpp
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/distance_predicates.hpp | 4 ++--
   sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/tuples.hpp | 19 +++----------------
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree.hpp | 4 ++--
   sandbox-branches/geometry/index/boost/geometry/extensions/index/translator/def.hpp | 6 +++---
   4 files changed, 10 insertions(+), 23 deletions(-)

Deleted: sandbox-branches/geometry/index/boost/geometry/extensions/index/algorithms/is_valid.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/algorithms/is_valid.hpp 2013-01-18 19:23:48 EST (Fri, 18 Jan 2013)
+++ (empty file)
@@ -1,83 +0,0 @@
-// Boost.Geometry Index
-//
-// n-dimensional box's / point validity check
-//
-// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
-//
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_ALGORITHMS_IS_VALID_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_ALGORITHMS_IS_VALID_HPP
-
-namespace boost { namespace geometry { namespace index {
-
-namespace detail {
-
-template <typename Box, size_t Dimension>
-struct is_valid_box
-{
- BOOST_MPL_ASSERT_MSG(
- (0 < Dimension && Dimension <= detail::traits::dimension<Box>::value),
- INVALID_DIMENSION_PARAMETER,
- (is_valid_box));
-
- static inline bool apply(Box const& b)
- {
- return is_valid_box<Box, Dimension - 1>::apply(b) &&
- ( detail::get<min_corner, Dimension - 1>(b) <= detail::get<max_corner, Dimension - 1>(b) );
- }
-};
-
-template <typename Box>
-struct is_valid_box<Box, 1>
-{
- static inline bool apply(Box const& b)
- {
- return detail::get<min_corner, 0>(b) <= detail::get<max_corner, 0>(b);
- }
-};
-
-} // namespace detail
-
-namespace dispatch {
-
-template <typename Indexable, typename Tag>
-struct is_valid
-{
- BOOST_MPL_ASSERT_MSG(
- (false),
- NOT_IMPLEMENTED_FOR_THIS_INDEXABLE,
- (is_valid));
-};
-
-template <typename Indexable>
-struct is_valid<Indexable, point_tag>
-{
- static inline bool apply(Indexable const&)
- {
- return true;
- }
-};
-
-template <typename Indexable>
-struct is_valid<Indexable, box_tag>
-{
- static inline bool apply(Indexable const& b)
- {
- return detail::is_valid_box<Indexable, detail::traits::dimension<Indexable>::value>::apply(b);
- }
-};
-
-} // namespace dispatch
-
-template <typename Indexable>
-inline bool is_valid(Indexable const& b)
-{
- return dispatch::is_valid<Indexable, typename detail::traits::tag<Indexable>::type>::apply(b);
-}
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_ALGORITHMS_IS_VALID_HPP

Added: sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/algorithms/is_valid.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/algorithms/is_valid.hpp 2013-01-18 19:23:48 EST (Fri, 18 Jan 2013)
@@ -0,0 +1,79 @@
+// Boost.Geometry Index
+//
+// n-dimensional box's / point validity check
+//
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+//
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_ALGORITHMS_IS_VALID_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_ALGORITHMS_IS_VALID_HPP
+
+namespace boost { namespace geometry { namespace index { namespace detail {
+
+namespace dispatch {
+
+template <typename Box, size_t Dimension>
+struct is_valid_box
+{
+ BOOST_MPL_ASSERT_MSG(
+ (0 < Dimension && Dimension <= detail::traits::dimension<Box>::value),
+ INVALID_DIMENSION_PARAMETER,
+ (is_valid_box));
+
+ static inline bool apply(Box const& b)
+ {
+ return is_valid_box<Box, Dimension - 1>::apply(b) &&
+ ( detail::get<min_corner, Dimension - 1>(b) <= detail::get<max_corner, Dimension - 1>(b) );
+ }
+};
+
+template <typename Box>
+struct is_valid_box<Box, 1>
+{
+ static inline bool apply(Box const& b)
+ {
+ return detail::get<min_corner, 0>(b) <= detail::get<max_corner, 0>(b);
+ }
+};
+
+template <typename Indexable, typename Tag>
+struct is_valid
+{
+ BOOST_MPL_ASSERT_MSG(
+ (false),
+ NOT_IMPLEMENTED_FOR_THIS_INDEXABLE,
+ (is_valid));
+};
+
+template <typename Indexable>
+struct is_valid<Indexable, point_tag>
+{
+ static inline bool apply(Indexable const&)
+ {
+ return true;
+ }
+};
+
+template <typename Indexable>
+struct is_valid<Indexable, box_tag>
+{
+ static inline bool apply(Indexable const& b)
+ {
+ return dispatch::is_valid_box<Indexable, detail::traits::dimension<Indexable>::value>::apply(b);
+ }
+};
+
+} // namespace dispatch
+
+template <typename Indexable>
+inline bool is_valid(Indexable const& b)
+{
+ return dispatch::is_valid<Indexable, typename detail::traits::tag<Indexable>::type>::apply(b);
+}
+
+}}}} // namespace boost::geometry::index::detail
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_ALGORITHMS_IS_VALID_HPP

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/distance_predicates.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/distance_predicates.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/distance_predicates.hpp 2013-01-18 19:23:48 EST (Fri, 18 Jan 2013)
@@ -293,7 +293,7 @@
     static inline type & get(cdist<T, Tag> & cd)
     {
         BOOST_MPL_ASSERT_MSG(
- (tuples::equal< cdist<T, Tag2>, cdist<T, Tag> >::value),
+ (boost::is_same< cdist<T, Tag2>, cdist<T, Tag> >::value),
             TAGS_DO_NOT_MATCH,
             (cdist_value));
 
@@ -304,7 +304,7 @@
     static inline type const& get(cdist<T, Tag> const& cd)
     {
         BOOST_MPL_ASSERT_MSG(
- (tuples::equal< cdist<T, Tag2>, cdist<T, Tag> >::value),
+ (boost::is_same< cdist<T, Tag2>, cdist<T, Tag> >::value),
             TAGS_DO_NOT_MATCH,
             (cdist_value));
 

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/tuples.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/tuples.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/detail/tuples.hpp 2013-01-18 19:23:48 EST (Fri, 18 Jan 2013)
@@ -10,6 +10,7 @@
 #define BOOST_GEOMETRY_EXTENSIONS_INDEX_TUPLES_HPP
 
 #include <boost/tuple/tuple.hpp>
+#include <boost/type_traits/is_same.hpp>
 
 // TODO move this to index/tuples and separate algorithms
 
@@ -76,20 +77,6 @@
>::value;
 };
 
-// types_equal
-
-template <typename T1, typename T2>
-struct equal
-{
- static const bool value = false;
-};
-
-template <typename T>
-struct equal<T, T>
-{
- static const bool value = true;
-};
-
 // has
 
 namespace detail {
@@ -98,7 +85,7 @@
 struct has
 {
     static const bool value
- = equal<
+ = boost::is_same<
             typename boost::tuples::element<N - 1, Tuple>::type,
             El
>::value
@@ -109,7 +96,7 @@
 struct has<Tuple, El, 1>
 {
     static const bool value
- = equal<
+ = boost::is_same<
             typename boost::tuples::element<0, Tuple>::type,
             El
>::value;

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree.hpp 2013-01-18 19:23:48 EST (Fri, 18 Jan 2013)
@@ -31,7 +31,7 @@
 
 #include <boost/geometry/extensions/index/detail/rtree/node/node.hpp>
 
-#include <boost/geometry/extensions/index/algorithms/is_valid.hpp>
+#include <boost/geometry/extensions/index/detail/algorithms/is_valid.hpp>
 
 #include <boost/geometry/extensions/index/detail/rtree/visitors/insert.hpp>
 #include <boost/geometry/extensions/index/detail/rtree/visitors/remove.hpp>
@@ -1055,7 +1055,7 @@
     inline void raw_insert(value_type const& value)
     {
         BOOST_GEOMETRY_INDEX_ASSERT(m_root, "The root must exist");
- BOOST_GEOMETRY_INDEX_ASSERT(index::is_valid(m_translator(value)), "Indexable is invalid");
+ BOOST_GEOMETRY_INDEX_ASSERT(detail::is_valid(m_translator(value)), "Indexable is invalid");
 
         geometry::expand(m_box, m_translator(value));
 

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/translator/def.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/translator/def.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/translator/def.hpp 2013-01-18 19:23:48 EST (Fri, 18 Jan 2013)
@@ -28,7 +28,7 @@
 {
     BOOST_MPL_ASSERT_MSG(
         (!detail::indexable_not_found_error<
- typename index::detail::traits::indexable_type<Value>::type
+ typename geometry::index::detail::traits::indexable_type<Value>::type
>::value),
         NOT_VALID_INDEXABLE_TYPE,
         (Value)
@@ -60,7 +60,7 @@
 {
     BOOST_MPL_ASSERT_MSG(
         (!detail::indexable_not_found_error<
- typename index::detail::traits::indexable_type<Indexable>::type
+ typename geometry::index::detail::traits::indexable_type<Indexable>::type
>::value),
         NOT_VALID_INDEXABLE_TYPE,
         (Indexable)
@@ -128,7 +128,7 @@
 
     BOOST_MPL_ASSERT_MSG(
         (!detail::indexable_not_found_error<
- typename index::detail::traits::indexable_type<Indexable>::type
+ typename geometry::index::detail::traits::indexable_type<Indexable>::type
>::value),
         NOT_VALID_INDEXABLE_TYPE,
         (Indexable)


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