]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/icl/include/boost/icl/type_traits/is_container.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / icl / include / boost / icl / type_traits / is_container.hpp
1 /*-----------------------------------------------------------------------------+
2 Copyright (c) 2010-2010: Joachim Faulhaber
3 +------------------------------------------------------------------------------+
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENCE.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7 +-----------------------------------------------------------------------------*/
8 #ifndef BOOST_ICL_TYPE_TRAITS_IS_CONTAINER_HPP_JOFA_100828
9 #define BOOST_ICL_TYPE_TRAITS_IS_CONTAINER_HPP_JOFA_100828
10
11 #include <boost/mpl/has_xxx.hpp>
12 #include <boost/mpl/bool.hpp>
13 #include <boost/mpl/and.hpp>
14 #include <boost/mpl/not.hpp>
15 #include <boost/type_traits/is_same.hpp>
16 #include <boost/icl/type_traits/element_type_of.hpp>
17 #include <boost/icl/type_traits/segment_type_of.hpp>
18 #include <boost/icl/type_traits/size_type_of.hpp>
19 #include <boost/icl/type_traits/is_map.hpp>
20
21 namespace boost{ namespace icl
22 {
23 namespace detail
24 {
25 BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator)
26 BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
27 }
28
29 template <class Type>
30 struct is_container
31 : mpl::bool_<
32 detail::has_value_type<Type>::value &&
33 detail::has_iterator<Type>::value &&
34 detail::has_size_type<Type>::value &&
35 detail::has_reference<Type>::value>
36 {};
37
38 template <class Type>
39 struct is_std_set
40 {
41 typedef is_std_set type;
42 BOOST_STATIC_CONSTANT(bool,
43 value = (mpl::and_< is_container<Type>
44 , detail::has_key_type<Type>
45 , boost::is_same< typename key_type_of<Type>::type
46 , typename value_type_of<Type>::type >
47 , mpl::not_<detail::has_segment_type<Type> >
48 >::value )
49 );
50 };
51
52 }} // namespace boost icl
53
54 #endif
55
56