File indexing completed on 2025-01-18 09:30:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_CONTAINER_DETAIL_IS_CONTIGUOUS_CONTAINER_HPP
0011 #define BOOST_CONTAINER_DETAIL_IS_CONTIGUOUS_CONTAINER_HPP
0012
0013 #ifndef BOOST_CONFIG_HPP
0014 # include <boost/config.hpp>
0015 #endif
0016
0017 #if defined(BOOST_HAS_PRAGMA_ONCE)
0018 # pragma once
0019 #endif
0020
0021 #if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
0022 #pragma GCC diagnostic push
0023 #pragma GCC diagnostic ignored "-Wunused-result"
0024 #endif
0025
0026
0027 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME data
0028 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace is_contiguous_container_detail {
0029 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
0030 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 0
0031 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 0
0032 #include <boost/intrusive/detail/has_member_function_callable_with.hpp>
0033
0034
0035 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME back_free_capacity
0036 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace back_free_capacity_detail {
0037 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
0038 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 0
0039 #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 0
0040 #include <boost/intrusive/detail/has_member_function_callable_with.hpp>
0041
0042
0043 #if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
0044 #pragma GCC diagnostic pop
0045 #endif
0046
0047 namespace boost {
0048 namespace container {
0049 namespace dtl {
0050
0051 template <class Container>
0052 struct is_contiguous_container
0053 {
0054 static const bool value =
0055 boost::container::is_contiguous_container_detail::
0056 has_member_function_callable_with_data<Container>::value &&
0057 boost::container::is_contiguous_container_detail::
0058 has_member_function_callable_with_data<const Container>::value;
0059 };
0060
0061
0062 template < class Container
0063 , bool = boost::container::back_free_capacity_detail::
0064 has_member_function_callable_with_back_free_capacity<const Container>::value>
0065 struct back_free_capacity
0066 {
0067 static typename Container::size_type get(const Container &c)
0068 { return c.back_free_capacity(); }
0069 };
0070
0071 template < class Container>
0072 struct back_free_capacity<Container, false>
0073 {
0074 static typename Container::size_type get(const Container &c)
0075 { return c.capacity() - c.size(); }
0076 };
0077
0078 }
0079 }
0080 }
0081
0082 #endif