2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
2014-01-08 07:48:12 +00:00
|
|
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
2013-08-08 09:54:33 +00:00
|
|
|
https://github.com/bolero-MURAKAMI/Sprout
|
|
|
|
|
|
|
|
Distributed under 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)
|
|
|
|
=============================================================================*/
|
2012-10-04 14:25:28 +00:00
|
|
|
#ifndef SPROUT_TPP_ALGORITHM_ANY_OF_HPP
|
|
|
|
#define SPROUT_TPP_ALGORITHM_ANY_OF_HPP
|
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
2013-11-20 13:04:11 +00:00
|
|
|
#include <sprout/type_traits/integral_constant.hpp>
|
2012-10-04 14:25:28 +00:00
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
namespace tpp {
|
|
|
|
namespace detail {
|
2012-11-02 13:00:10 +00:00
|
|
|
template<bool... Values>
|
2012-10-04 14:25:28 +00:00
|
|
|
struct any_of_impl;
|
|
|
|
template<>
|
2012-11-02 13:00:10 +00:00
|
|
|
struct any_of_impl<>
|
2013-11-20 13:04:11 +00:00
|
|
|
: public sprout::false_type
|
2012-11-02 13:00:10 +00:00
|
|
|
{};
|
|
|
|
template<>
|
2012-10-04 14:25:28 +00:00
|
|
|
struct any_of_impl<true>
|
2013-11-20 13:04:11 +00:00
|
|
|
: public sprout::true_type
|
2012-10-04 14:25:28 +00:00
|
|
|
{};
|
|
|
|
template<>
|
|
|
|
struct any_of_impl<false>
|
2013-11-20 13:04:11 +00:00
|
|
|
: public sprout::false_type
|
2012-10-04 14:25:28 +00:00
|
|
|
{};
|
|
|
|
template<bool... Tail>
|
|
|
|
struct any_of_impl<true, Tail...>
|
2013-11-20 13:04:11 +00:00
|
|
|
: public sprout::true_type
|
2012-10-04 14:25:28 +00:00
|
|
|
{};
|
|
|
|
template<bool... Tail>
|
|
|
|
struct any_of_impl<false, Tail...>
|
2013-11-20 13:04:11 +00:00
|
|
|
: public sprout::integral_constant<bool, sprout::tpp::detail::any_of_impl<Tail...>::value>
|
2012-10-04 14:25:28 +00:00
|
|
|
{};
|
|
|
|
} // namespace detail
|
|
|
|
//
|
2012-11-02 13:00:10 +00:00
|
|
|
// any_of_c
|
2012-10-04 14:25:28 +00:00
|
|
|
//
|
|
|
|
template<bool... Values>
|
2012-11-02 13:00:10 +00:00
|
|
|
struct any_of_c
|
2012-10-04 14:25:28 +00:00
|
|
|
: public sprout::tpp::detail::any_of_impl<Values...>
|
|
|
|
{};
|
2012-11-02 13:00:10 +00:00
|
|
|
//
|
|
|
|
// any_of
|
|
|
|
//
|
|
|
|
template<typename... Types>
|
|
|
|
struct any_of
|
|
|
|
: public sprout::tpp::any_of_c<Types::value...>
|
|
|
|
{};
|
2012-10-04 14:25:28 +00:00
|
|
|
} // namespace tpp
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_TPP_ALGORITHM_ANY_OF_HPP
|