/* Copyright 2016-2024 Joaquin M Lopez Munoz. * 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) * * See http://www.boost.org/libs/poly_collection for library home page. */ #ifndef BOOST_POLY_COLLECTION_DETAIL_TYPE_RESTITUTION_HPP #define BOOST_POLY_COLLECTION_DETAIL_TYPE_RESTITUTION_HPP #if defined(_MSC_VER) #pragma once #endif #include #include #include #include #include #include #include #include #include #include #include #if defined(BOOST_MSVC) #pragma warning(push) #pragma warning(disable:4714) /* marked as __forceinline not inlined */ #endif namespace boost{ namespace poly_collection{ struct all_types; namespace detail{ /* If a list of restituted types contain all_types, replaces it with the * list of all acceptable types of the associated closed collection. */ template struct restitution_list_impl { static_assert( !mp11::mp_contains::value, "all_types can't be used with open collections"); using type=L; }; template struct restitution_list_impl< Model,L, typename std::enable_if::value>::type > { using type=typename std::conditional< mp11::mp_contains::value, typename Model::acceptable_type_list, L >::type; }; template using restitution_list= typename restitution_list_impl>::type; /* Calculates if the given types cover the entire set of acceptable types for * the associated closed collection. */ namespace is_total_restitution_impl { template struct helper:std::false_type{}; #if BOOST_WORKAROUND(BOOST_MSVC,<=1900) template struct is_contained; template