/*============================================================================= Copyright (c) 2011-2017 Bolero MURAKAMI 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) =============================================================================*/ #ifndef SPROUT_TPP_ALGORITHM_ONE_OF_HPP #define SPROUT_TPP_ALGORITHM_ONE_OF_HPP #include #include #include #include #include namespace sprout { namespace tpp { namespace detail { template struct one_of_impl_1 : public sprout::bool_constant::type::value> {}; template struct one_of_impl_1 : public sprout::bool_constant< sprout::tpp::detail::one_of_impl_1::value && sprout::tpp::detail::one_of_impl_1::value > {}; template struct one_of_impl : public std::tuple_element::type {}; template struct one_of_impl : public sprout::bool_constant< sprout::tpp::detail::one_of_impl::value ? sprout::tpp::detail::one_of_impl_1::value : sprout::tpp::detail::one_of_impl::value > {}; } // namespace detail // // one_of // template struct one_of : public sprout::tpp::detail::one_of_impl, 0, sizeof...(Types)> {}; template<> struct one_of<> : public sprout::false_type {}; // // one_of_c // template struct one_of_c : public sprout::tpp::one_of...> {}; // namespace detail { // template // struct one_of_impl; // template<> // struct one_of_impl<> // : public sprout::false_type // {}; // template<> // struct one_of_impl // : public sprout::true_type // {}; // template<> // struct one_of_impl // : public sprout::false_type // {}; // template // struct one_of_impl // : public sprout::tpp::none_of_c // {}; // template // struct one_of_impl // : public sprout::bool_constant::value> // {}; // } // namespace detail // // // // one_of_c // // // template // struct one_of_c // : public sprout::tpp::detail::one_of_impl // {}; // // // // one_of // // // template // struct one_of // : public sprout::tpp::one_of_c // {}; } // namespace tpp } // namespace sprout #endif // #ifndef SPROUT_TPP_ALGORITHM_ONE_OF_HPP