brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · e5efc82 Raw
39 lines · plain
1//  (C) Copyright John Maddock 2018.2//  Use, modification and distribution are subject to the3//  Boost Software License, Version 1.0. (See accompanying file4//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)5 6#ifndef BOOST_MATH_TOOLS_IS_CONST_ITERABLE_HPP7#define BOOST_MATH_TOOLS_IS_CONST_ITERABLE_HPP8 9#include <boost/math/tools/cxx03_warn.hpp>10 11#define BOOST_MATH_HAS_IS_CONST_ITERABLE12 13#include <boost/math/tools/is_detected.hpp>14#include <utility>15 16namespace boost {17   namespace math {18      namespace tools {19         namespace detail {20 21            template<class T>22            using begin_t = decltype(std::declval<const T&>().begin());23            template<class T>24            using end_t = decltype(std::declval<const T&>().end());25            template<class T>26            using const_iterator_t = typename T::const_iterator;27 28            template <class T>29            struct is_const_iterable30               : public std::integral_constant<bool,31               is_detected<begin_t, T>::value32               && is_detected<end_t, T>::value33               && is_detected<const_iterator_t, T>::value34               > {};35 36} } } }37 38#endif // BOOST_MATH_TOOLS_IS_CONST_ITERABLE_HPP39