array_optimization.hpp 1.4 KB

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