////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2005-2013. 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/container for documentation. // ////////////////////////////////////////////////////////////////////////////// // // This code comes from N1953 document by Howard E. Hinnant // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP #define BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP #ifndef BOOST_CONFIG_HPP # include #endif #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include #include #include #include namespace boost{ namespace container { namespace dtl { template struct version_type : public dtl::integral_constant { typedef T type; }; namespace impl{ template struct extract_version { typedef typename T::version type; }; template struct has_version { private: struct two {char _[2];}; template static two test(...); template static char test(const typename U::version*); public: static const bool value = sizeof(test(0)) == 1; void dummy(){} }; template ::value> struct version { static const unsigned value = 1; }; template struct version { static const unsigned value = extract_version::type::value; }; } //namespace impl template struct version : public dtl::integral_constant::value> {}; template struct is_version { static const bool value = is_same< typename version::type, integral_constant >::value; }; } //namespace dtl { typedef dtl::integral_constant version_0; typedef dtl::integral_constant version_1; typedef dtl::integral_constant version_2; } //namespace container { } //namespace boost{ #include #endif //#define BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP