1 #ifndef BOOST_SERIALIZATION_ARRAY_OPTIMIZATON_HPP 2 #define BOOST_SERIALIZATION_ARRAY_OPTIMIZATON_HPP 3 4 // (C) Copyright 2005 Matthias Troyer and Dave Abrahams 5 // Use, modification and distribution is subject to the Boost Software 6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt) 8 9 #include <boost/config.hpp> // msvc 6.0 needs this for warning suppression 10 11 #if defined(BOOST_NO_STDC_NAMESPACE) 12 namespace std{ 13 using ::size_t; 14 } // namespace std 15 #endif 16 17 #include <boost/mpl/always.hpp> 18 #include <boost/mpl/apply.hpp> 19 #include <boost/type_traits/remove_const.hpp> 20 21 namespace boost { namespace serialization { 22 23 template <class Archive> 24 struct use_array_optimization : boost::mpl::always<boost::mpl::false_> {}; 25 26 } } // end namespace boost::serialization 27 28 #define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive) \ 29 namespace boost { namespace serialization { \ 30 template <> struct use_array_optimization<Archive> { \ 31 template <class ValueType> \ 32 struct apply : boost::mpl::apply1<Archive::use_array_optimization \ 33 , typename boost::remove_const<ValueType>::type \ 34 >::type {}; \ 35 }; }} 36 37 #endif //BOOST_SERIALIZATION_ARRAY_OPTIMIZATON_HPP 38