is_container.hpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2017-2017. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/container for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_CONTAINER_DETAIL_IS_CONTAINER_HPP
  11. #define BOOST_CONTAINER_DETAIL_IS_CONTAINER_HPP
  12. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #if defined(BOOST_HAS_PRAGMA_ONCE)
  16. # pragma once
  17. #endif
  18. //empty
  19. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME empty
  20. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace is_container_detail {
  21. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
  22. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 0
  23. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 0
  24. #include <boost/intrusive/detail/has_member_function_callable_with.hpp>
  25. //size
  26. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME size
  27. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace is_container_detail {
  28. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
  29. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 0
  30. #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 0
  31. #include <boost/intrusive/detail/has_member_function_callable_with.hpp>
  32. namespace boost {
  33. namespace container {
  34. namespace dtl {
  35. template <class Container>
  36. struct is_container
  37. {
  38. static const bool value =
  39. boost::container::is_container_detail::
  40. has_member_function_callable_with_size <const Container>::value &&
  41. boost::container::is_container_detail::
  42. has_member_function_callable_with_empty<const Container>::value;
  43. };
  44. template <>
  45. struct is_container<void>
  46. {
  47. static const bool value = false;
  48. };
  49. } //namespace dtl {
  50. } //namespace container {
  51. } //namespace boost {
  52. #endif //#ifndef BOOST_CONTAINER_DETAIL_IS_CONTAINER_HPP