/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // manifest.cpp: // (C) Copyright 2010 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to 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 for updates, documentation, and revision history. #if (defined _MSC_VER) && (_MSC_VER == 1200) # pragma warning (disable : 4786) // too long name, harmless warning #endif // this module is placed in a library to permit runtime validation // of manifests used with DLLS. It's just an example. The serialization // library doesn't use any other runtime libraries so this in // fact wouldn't be necessary. #define BOOST_SERIALIZATION_SOURCE #include #include namespace boost { namespace serialization { // this get's constructed in a DLL static manifest m_validator; manifest::manifest(){ // which provokes the checking of versions at runtime // the serialization library doesn't use any other runtime // libraries so this can be a no op if( !( // the iterator library doesn't need to implement this // since it's a header only library. //1 <= boost::iterator::manifest::get_interface_version() //&& true // replace with your other runtime conidions ! // ... )) throw std::out_of_range("Invalid library version"); } // implement runtime retrieval of int manifest::get_interface_version(){ return interface_version::value; } int manifest::get_implementation_version(){ return implemenation_version::value; } } // serialization } // boost