/*! @file Defines `boost::hana::detail::index_if`. @copyright Louis Dionne 2013-2017 @copyright Jason Rice 2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_DETAIL_INDEX_IF_HPP #define BOOST_HANA_DETAIL_INDEX_IF_HPP #include #include #include #include #include #include BOOST_HANA_NAMESPACE_BEGIN namespace detail { template struct index_if_helper; template struct index_if_helper { template using f = typename index_if_helper(detail::decay()(std::declval()))>::type::value) >::template f; }; template struct index_if_helper { template using f = hana::optional<>; }; template struct index_if_helper { template using f = hana::optional>; }; template struct index_if { using type = typename index_if_helper<0, sizeof...(Xs), false> ::template f; }; } BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_DETAIL_INDEX_IF_HPP