// Copyright (C) 2019 T. Zachary Laine // // 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 BOOST_STL_INTERFACES_FWD_HPP #define BOOST_STL_INTERFACES_FWD_HPP #include #if BOOST_STL_INTERFACES_USE_CONCEPTS #include #endif #if defined(__cpp_lib_three_way_comparison) #include #endif #ifndef BOOST_STL_INTERFACES_DOXYGEN #if defined(_MSC_VER) || defined(__GNUC__) && __GNUC__ < 8 #define BOOST_STL_INTERFACES_NO_HIDDEN_FRIEND_CONSTEXPR #define BOOST_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR #else #define BOOST_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR constexpr #endif #if defined(__GNUC__) && __GNUC__ < 9 #define BOOST_STL_INTERFACES_CONCEPT concept bool #else #define BOOST_STL_INTERFACES_CONCEPT concept #endif #endif namespace boost { namespace stl_interfaces { /** An enumeration used to indicate whether the underlying data have a contiguous or discontiguous layout when instantiating `view_interface` and `sequence_container_interface`. */ enum class element_layout : bool { discontiguous = false, contiguous = true }; BOOST_STL_INTERFACES_NAMESPACE_V1 { namespace v1_dtl { template using void_t = void; template using iter_difference_t = typename std::iterator_traits::difference_type; template struct iterator; template struct iterator< Range, void_t().begin())>> { using type = decltype(std::declval().begin()); }; template using iterator_t = typename iterator::type; template struct sentinel; template struct sentinel< Range, void_t().end())>> { using type = decltype(std::declval().end()); }; template using sentinel_t = typename sentinel::type; template using range_difference_t = iter_difference_t>; template using common_range = std::is_same, sentinel_t>; template struct decrementable_sentinel : std::false_type { }; template struct decrementable_sentinel< Range, void_t &>())>> : std::true_type { }; } } }} #endif