Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 08:59:55

0001 /* Copyright 2016-2024 Joaquin M Lopez Munoz.
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * See http://www.boost.org/libs/poly_collection for library home page.
0007  */
0008 
0009 #ifndef BOOST_POLY_COLLECTION_DETAIL_IS_ACCEPTABLE_HPP
0010 #define BOOST_POLY_COLLECTION_DETAIL_IS_ACCEPTABLE_HPP
0011 
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015 
0016 #include <boost/mp11/algorithm.hpp>
0017 #include <boost/poly_collection/detail/is_closed_collection.hpp>
0018 #include <boost/poly_collection/detail/is_moveable.hpp>
0019 #include <type_traits>
0020 
0021 namespace boost{
0022 
0023 namespace poly_collection{
0024 
0025 namespace detail{
0026 
0027 /* is_acceptable can be further specialized by (open collection) Model when
0028  * the std type_traits classes fail to give the right info (as it can happen
0029  * with class templates whose nominally existing operators do not compile for
0030  * certain instantiations).
0031  */
0032 
0033 template<typename T,typename Model,typename=void>
0034 struct is_acceptable:std::integral_constant<
0035   bool,
0036   Model::template is_implementation<T>::value&&is_moveable<T>::value
0037 >{};
0038 
0039 /* Closed collections are defined by having a compile-time fixed list of
0040  * acceptable types. 
0041  */
0042 
0043 template<typename T,typename Model>
0044 struct is_acceptable<
0045   T,Model,
0046   typename std::enable_if<is_closed_collection<Model>::value>::type
0047 >:mp11::mp_contains<typename Model::acceptable_type_list,T>{};
0048 
0049 } /* namespace poly_collection::detail */
0050 
0051 } /* namespace poly_collection */
0052 
0053 } /* namespace boost */
0054 
0055 #endif