From da865826433e851fc0871952b5b089fff5378c1f Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sat, 29 Sep 2012 23:39:00 +0900 Subject: [PATCH] add is_found_via_adl metafunction --- sprout/adl/not_found.hpp | 21 +++++++++++++++++++-- sprout/container/begin.hpp | 2 +- sprout/container/end.hpp | 2 +- sprout/generator/generated_value.hpp | 4 ++-- sprout/generator/next_generator.hpp | 4 ++-- sprout/iterator/distance.hpp | 2 +- sprout/iterator/next.hpp | 2 +- sprout/iterator/prev.hpp | 2 +- sprout/tuple/tuple/get.hpp | 4 ++-- 9 files changed, 30 insertions(+), 13 deletions(-) diff --git a/sprout/adl/not_found.hpp b/sprout/adl/not_found.hpp index 5770dbee..46fd0ce8 100644 --- a/sprout/adl/not_found.hpp +++ b/sprout/adl/not_found.hpp @@ -1,13 +1,30 @@ #ifndef SPROUT_ADL_NOT_FOUND_HPP #define SPROUT_ADL_NOT_FOUND_HPP +#include #include namespace sprout { // - // adl_not_found + // not_found_via_adl // - struct adl_not_found {}; + struct not_found_via_adl {}; + + // + // is_not_found_via_adl + // + template + struct is_not_found_via_adl + : public std::is_same + {}; + + // + // is_found_via_adl + // + template + struct is_found_via_adl + : public std::integral_constant::value> + {}; } // namespace sprout #endif // #ifndef SPROUT_ADL_NOT_FOUND_HPP diff --git a/sprout/container/begin.hpp b/sprout/container/begin.hpp index 863ca33c..c5397e7d 100644 --- a/sprout/container/begin.hpp +++ b/sprout/container/begin.hpp @@ -7,7 +7,7 @@ #include namespace sprout_adl { - sprout::adl_not_found range_begin(...); + sprout::not_found_via_adl range_begin(...); } // namespace sprout_adl namespace sprout { diff --git a/sprout/container/end.hpp b/sprout/container/end.hpp index 735b2f1f..dc150daa 100644 --- a/sprout/container/end.hpp +++ b/sprout/container/end.hpp @@ -7,7 +7,7 @@ #include namespace sprout_adl { - sprout::adl_not_found range_end(...); + sprout::not_found_via_adl range_end(...); } // namespace sprout_adl namespace sprout { diff --git a/sprout/generator/generated_value.hpp b/sprout/generator/generated_value.hpp index 70649588..deff3b2b 100644 --- a/sprout/generator/generated_value.hpp +++ b/sprout/generator/generated_value.hpp @@ -9,7 +9,7 @@ #include namespace sprout_adl { - sprout::adl_not_found generated_value(...); + sprout::not_found_via_adl generated_value(...); } // namespace sprout_adl namespace sprout_generator_detail { @@ -37,7 +37,7 @@ namespace sprout_generator_detail { template< typename U = T, typename sprout::enabler_if< - !std::is_same())), sprout::adl_not_found>::value + sprout::is_found_via_adl()))>::value >::type = sprout::enabler > static std::true_type test(int); diff --git a/sprout/generator/next_generator.hpp b/sprout/generator/next_generator.hpp index 3425aa2b..7a804183 100644 --- a/sprout/generator/next_generator.hpp +++ b/sprout/generator/next_generator.hpp @@ -9,7 +9,7 @@ #include namespace sprout_adl { - sprout::adl_not_found next_generator(...); + sprout::not_found_via_adl next_generator(...); } // namespace sprout_adl namespace sprout_generator_detail { @@ -37,7 +37,7 @@ namespace sprout_generator_detail { template< typename U = T, typename sprout::enabler_if< - !std::is_same())), sprout::adl_not_found>::value + sprout::is_found_via_adl()))>::value >::type = sprout::enabler > static std::true_type test(int); diff --git a/sprout/iterator/distance.hpp b/sprout/iterator/distance.hpp index 145790aa..f11e438f 100644 --- a/sprout/iterator/distance.hpp +++ b/sprout/iterator/distance.hpp @@ -7,7 +7,7 @@ #include namespace sprout_adl { - sprout::adl_not_found iterator_distance(...); + sprout::not_found_via_adl iterator_distance(...); } // namespace sprout_adl namespace sprout { diff --git a/sprout/iterator/next.hpp b/sprout/iterator/next.hpp index 39c4a6f5..bede5413 100644 --- a/sprout/iterator/next.hpp +++ b/sprout/iterator/next.hpp @@ -7,7 +7,7 @@ #include namespace sprout_adl { - sprout::adl_not_found iterator_next(...); + sprout::not_found_via_adl iterator_next(...); } // namespace sprout_adl namespace sprout { diff --git a/sprout/iterator/prev.hpp b/sprout/iterator/prev.hpp index a3c5221d..c4237d31 100644 --- a/sprout/iterator/prev.hpp +++ b/sprout/iterator/prev.hpp @@ -7,7 +7,7 @@ #include namespace sprout_adl { - sprout::adl_not_found iterator_prev(...); + sprout::not_found_via_adl iterator_prev(...); } // namespace sprout_adl namespace sprout { diff --git a/sprout/tuple/tuple/get.hpp b/sprout/tuple/tuple/get.hpp index ec7a1688..4951f0c4 100644 --- a/sprout/tuple/tuple/get.hpp +++ b/sprout/tuple/tuple/get.hpp @@ -93,7 +93,7 @@ namespace sprout { namespace sprout_adl { template - sprout::adl_not_found tuple_get(...); + sprout::not_found_via_adl tuple_get(...); } // namespace sprout_adl namespace sprout_tuple_detail { @@ -105,7 +105,7 @@ namespace sprout_tuple_detail { template< typename U = T, typename sprout::enabler_if< - !std::is_same(std::declval())), sprout::adl_not_found>::value + sprout::is_found_via_adl(std::declval()))>::value >::type = sprout::enabler > static std::true_type test(int);