////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2005-2009. 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_CONTAINERS_DETAIL_VERSION_TYPE_HPP #define BOOST_CONTAINERS_DETAIL_VERSION_TYPE_HPP #include #include namespace boost{ namespace container { namespace containers_detail { //using namespace boost; template struct version_type : public containers_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 containers_detail::integral_constant::value> { }; } //namespace containers_detail { } //namespace container { } //namespace boost{ #endif //#define BOOST_CONTAINERS_DETAIL_VERSION_TYPE_HPP