File indexing completed on 2025-09-17 08:45:57
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_POLY_COLLECTION_DETAIL_IS_CLOSED_COLLECTION_HPP
0010 #define BOOST_POLY_COLLECTION_DETAIL_IS_CLOSED_COLLECTION_HPP
0011
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015
0016 #include <boost/mp11/algorithm.hpp>
0017 #include <boost/mp11/set.hpp>
0018 #include <boost/poly_collection/detail/is_moveable.hpp>
0019 #include <boost/type_traits/make_void.hpp>
0020 #include <type_traits>
0021
0022 namespace boost{
0023
0024 namespace poly_collection{
0025
0026 namespace detail{
0027
0028 template<typename Model,typename=void>
0029 struct is_closed_collection:std::false_type{};
0030
0031 template<typename Model>
0032 struct is_closed_collection<
0033 Model,void_t<typename Model::acceptable_type_list>
0034 >:std::true_type
0035 {
0036 using type_list=typename Model::acceptable_type_list;
0037
0038 static_assert(
0039 mp11::mp_is_set<type_list>::value,
0040 "all types in a closed collection must be distinct");
0041
0042 static_assert(
0043 mp11::mp_all_of<type_list,is_moveable>::value,
0044 "all types of a closed collection must be nothrow move constructible "
0045 "or else move constructible and move assignable");
0046 };
0047
0048 }
0049
0050 }
0051
0052 }
0053
0054 #endif