////////////////////////////////////////////////////////////////////////////// // // (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 #include #include #include #include namespace boost{ namespace container { namespace container_detail { //using namespace boost; template struct version_type : public container_detail::integral_constant { typedef T type; version_type(const version_type&); }; namespace impl{ template , typename T::version>::value> struct extract_version { static const unsigned value = 1; }; template struct extract_version { static const unsigned value = T::version::value; }; 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::value; }; } //namespace impl template struct version : public container_detail::integral_constant::value> {}; template struct is_version { static const bool value = is_same< typename version::type, integral_constant >::value; }; } //namespace container_detail { } //namespace container { } //namespace boost{ #include #endif //#define BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP