1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00

fix adl/not_found

This commit is contained in:
bolero-MURAKAMI 2012-10-04 23:25:28 +09:00
parent b0ce004b36
commit d76d714816
5 changed files with 132 additions and 89 deletions

View file

@ -17,6 +17,18 @@ namespace sprout {
struct is_not_found_via_adl
: public std::is_same<T, sprout::not_found_via_adl>
{};
template<typename T>
struct is_not_found_via_adl<T const>
: public sprout::is_not_found_via_adl<T>
{};
template<typename T>
struct is_not_found_via_adl<T volatile>
: public sprout::is_not_found_via_adl<T>
{};
template<typename T>
struct is_not_found_via_adl<T const volatile>
: public sprout::is_not_found_via_adl<T>
{};
//
// is_found_via_adl

View file

@ -1,95 +1,9 @@
#ifndef SPROUT_TPP_ALGORITHM_HPP
#define SPROUT_TPP_ALGORITHM_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
namespace tpp {
namespace detail {
template<bool Head, bool... Tail>
struct all_of_impl;
template<>
struct all_of_impl<true>
: public std::true_type
{};
template<>
struct all_of_impl<false>
: public std::false_type
{};
template<bool... Tail>
struct all_of_impl<true, Tail...>
: public std::integral_constant<bool, sprout::tpp::detail::all_of_impl<Tail...>::value>
{};
template<bool... Tail>
struct all_of_impl<false, Tail...>
: public std::false_type
{};
} // namespace detail
//
// all_of
//
template<bool... Values>
struct all_of
: public sprout::tpp::detail::all_of_impl<Values...>
{};
namespace detail {
template<bool Head, bool... Tail>
struct any_of_impl;
template<>
struct any_of_impl<true>
: public std::true_type
{};
template<>
struct any_of_impl<false>
: public std::false_type
{};
template<bool... Tail>
struct any_of_impl<true, Tail...>
: public std::true_type
{};
template<bool... Tail>
struct any_of_impl<false, Tail...>
: public std::integral_constant<bool, sprout::tpp::detail::any_of_impl<Tail...>::value>
{};
} // namespace detail
//
// any_of
//
template<bool... Values>
struct any_of
: public sprout::tpp::detail::any_of_impl<Values...>
{};
namespace detail {
template<bool Head, bool... Tail>
struct none_of_impl;
template<>
struct none_of_impl<true>
: public std::false_type
{};
template<>
struct none_of_impl<false>
: public std::true_type
{};
template<bool... Tail>
struct none_of_impl<true, Tail...>
: public std::false_type
{};
template<bool... Tail>
struct none_of_impl<false, Tail...>
: public std::integral_constant<bool, sprout::tpp::detail::none_of_impl<Tail...>::value>
{};
} // namespace detail
//
// none_of
//
template<bool... Values>
struct none_of
: public sprout::tpp::detail::none_of_impl<Values...>
{};
} // namespace tpp
} // namespace sprout
#include <sprout/tpp/algorithm/all_of.hpp>
#include <sprout/tpp/algorithm/any_of.hpp>
#include <sprout/tpp/algorithm/none_of.hpp>
#endif // #ifndef SPROUT_TPP_ALGORITHM_HPP

View file

@ -0,0 +1,39 @@
#ifndef SPROUT_TPP_ALGORITHM_ALL_OF_HPP
#define SPROUT_TPP_ALGORITHM_ALL_OF_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
namespace tpp {
namespace detail {
template<bool Head, bool... Tail>
struct all_of_impl;
template<>
struct all_of_impl<true>
: public std::true_type
{};
template<>
struct all_of_impl<false>
: public std::false_type
{};
template<bool... Tail>
struct all_of_impl<true, Tail...>
: public std::integral_constant<bool, sprout::tpp::detail::all_of_impl<Tail...>::value>
{};
template<bool... Tail>
struct all_of_impl<false, Tail...>
: public std::false_type
{};
} // namespace detail
//
// all_of
//
template<bool... Values>
struct all_of
: public sprout::tpp::detail::all_of_impl<Values...>
{};
} // namespace tpp
} // namespace sprout
#endif // #ifndef SPROUT_TPP_ALGORITHM_ALL_OF_HPP

View file

@ -0,0 +1,39 @@
#ifndef SPROUT_TPP_ALGORITHM_ANY_OF_HPP
#define SPROUT_TPP_ALGORITHM_ANY_OF_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
namespace tpp {
namespace detail {
template<bool Head, bool... Tail>
struct any_of_impl;
template<>
struct any_of_impl<true>
: public std::true_type
{};
template<>
struct any_of_impl<false>
: public std::false_type
{};
template<bool... Tail>
struct any_of_impl<true, Tail...>
: public std::true_type
{};
template<bool... Tail>
struct any_of_impl<false, Tail...>
: public std::integral_constant<bool, sprout::tpp::detail::any_of_impl<Tail...>::value>
{};
} // namespace detail
//
// any_of
//
template<bool... Values>
struct any_of
: public sprout::tpp::detail::any_of_impl<Values...>
{};
} // namespace tpp
} // namespace sprout
#endif // #ifndef SPROUT_TPP_ALGORITHM_ANY_OF_HPP

View file

@ -0,0 +1,39 @@
#ifndef SPROUT_TPP_ALGORITHM_NONE_OF_HPP
#define SPROUT_TPP_ALGORITHM_NONE_OF_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
namespace tpp {
namespace detail {
template<bool Head, bool... Tail>
struct none_of_impl;
template<>
struct none_of_impl<true>
: public std::false_type
{};
template<>
struct none_of_impl<false>
: public std::true_type
{};
template<bool... Tail>
struct none_of_impl<true, Tail...>
: public std::false_type
{};
template<bool... Tail>
struct none_of_impl<false, Tail...>
: public std::integral_constant<bool, sprout::tpp::detail::none_of_impl<Tail...>::value>
{};
} // namespace detail
//
// none_of
//
template<bool... Values>
struct none_of
: public sprout::tpp::detail::none_of_impl<Values...>
{};
} // namespace tpp
} // namespace sprout
#endif // #ifndef SPROUT_TPP_ALGORITHM_NONE_OF_HPP