|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75816 - in trunk: boost/geometry/algorithms libs/geometry/doc/src/docutils/tools/support_status
From: bruno.lalande_at_[hidden]
Date: 2011-12-05 18:00:43
Author: bruno.lalande
Date: 2011-12-05 18:00:42 EST (Mon, 05 Dec 2011)
New Revision: 75816
URL: http://svn.boost.org/trac/boost/changeset/75816
Log:
Applied not_implemented to 'convert' algorithm. Added it to support_status.
Text files modified:
trunk/boost/geometry/algorithms/convert.hpp | 11 +---
trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp | 92 ++++++++++++++++++++++++++++++----------
2 files changed, 72 insertions(+), 31 deletions(-)
Modified: trunk/boost/geometry/algorithms/convert.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/convert.hpp (original)
+++ trunk/boost/geometry/algorithms/convert.hpp 2011-12-05 18:00:42 EST (Mon, 05 Dec 2011)
@@ -22,6 +22,7 @@
#include <boost/type_traits/is_array.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
+#include <boost/geometry/algorithms/not_implemented.hpp>
#include <boost/geometry/algorithms/append.hpp>
#include <boost/geometry/algorithms/clear.hpp>
#include <boost/geometry/algorithms/for_each.hpp>
@@ -218,14 +219,8 @@
std::size_t DimensionCount,
typename Geometry1, typename Geometry2
>
-struct convert
-{
- BOOST_MPL_ASSERT_MSG
- (
- false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPES
- , (types<Geometry1, Geometry2>)
- );
-};
+struct convert: not_implemented<Geometry1, Geometry2>
+{};
template
Modified: trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp (original)
+++ trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp 2011-12-05 18:00:42 EST (Mon, 05 Dec 2011)
@@ -11,23 +11,6 @@
#include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
-template <typename Tag1, typename Tag2, typename G1, typename G2>
-struct check
- : boost::geometry::dispatch::distance<
- Tag1,
- Tag2,
- G1,
- G2,
- boost::geometry::strategy_tag_distance_point_point,
- typename boost::geometry::strategy::distance::services::default_strategy<
- boost::geometry::point_tag,
- G1,
- G2
- >::type
- >
-{};
-
-
typedef boost::geometry::cs::cartesian cartesian;
typedef boost::geometry::model::point<double, 2, cartesian> point_type;
@@ -47,9 +30,37 @@
> types;
+template <typename Tag1, typename Tag2, typename G1, typename G2>
+struct check_distance
+ : boost::geometry::dispatch::distance<
+ Tag1,
+ Tag2,
+ G1,
+ G2,
+ boost::geometry::strategy_tag_distance_point_point,
+ typename boost::geometry::strategy::distance::services::default_strategy<
+ boost::geometry::point_tag,
+ G1,
+ G2
+ >::type
+ >
+{};
+
+template <typename G1, typename G2>
+struct check_convert
+ : boost::geometry::dispatch::convert<
+ boost::is_same<G1, G2>::value && !boost::is_array<G1>::value,
+ typename boost::geometry::tag_cast<typename boost::geometry::tag<G1>::type, boost::geometry::multi_tag>::type,
+ typename boost::geometry::tag_cast<typename boost::geometry::tag<G2>::type, boost::geometry::multi_tag>::type,
+ boost::geometry::dimension<G1>::type::value,
+ G1,
+ G2
+ >
+{};
+
template <class T1>
-struct tester
+struct distance_tester
{
template <typename T2>
void operator()(T2)
@@ -57,8 +68,37 @@
typedef typename boost::geometry::tag<T1>::type tag1;
typedef typename boost::geometry::tag<T2>::type tag2;
- if (boost::is_base_of<boost::geometry::not_implemented<T1, T2>, check<tag1, tag2, T1, T2> >::type::value
- && boost::is_base_of<boost::geometry::not_implemented<T2, T1>, check<tag2, tag1, T2, T1> >::type::value)
+ if (boost::is_base_of<boost::geometry::not_implemented<T1, T2>, check_distance<tag1, tag2, T1, T2> >::type::value
+ && boost::is_base_of<boost::geometry::not_implemented<T2, T1>, check_distance<tag2, tag1, T2, T1> >::type::value)
+ {
+ std::cout << "-\t";
+ }
+ else
+ {
+ std::cout << "OK\t";
+ }
+ }
+};
+
+template <>
+struct distance_tester<void>
+{
+ template <typename T>
+ void operator()(T)
+ {
+ boost::mpl::for_each<types>(distance_tester<T>());
+ std::cout << std::endl;
+ }
+};
+
+
+template <class T1>
+struct convert_tester
+{
+ template <typename T2>
+ void operator()(T2)
+ {
+ if (boost::is_base_of<boost::geometry::not_implemented<T1, T2>, check_convert<T1, T2> >::type::value)
{
std::cout << "-\t";
}
@@ -70,12 +110,12 @@
};
template <>
-struct tester<void>
+struct convert_tester<void>
{
template <typename T>
void operator()(T)
{
- boost::mpl::for_each<types>(tester<T>());
+ boost::mpl::for_each<types>(convert_tester<T>());
std::cout << std::endl;
}
};
@@ -83,7 +123,13 @@
int main()
{
- boost::mpl::for_each<types>(tester<void>());
+ std::cout << "DISTANCE" << std::endl;
+ boost::mpl::for_each<types>(distance_tester<void>());
+ std::cout << std::endl;
+
+ std::cout << "CONVERT" << std::endl;
+ boost::mpl::for_each<types>(convert_tester<void>());
+ std::cout << std::endl;
return 0;
}
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