Index: numeric/ublas/matrix.hpp =================================================================== --- numeric/ublas/matrix.hpp (revision 86799) +++ numeric/ublas/matrix.hpp (working copy) @@ -16,9 +16,11 @@ #include #include #include -#include -#include -#include +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION + #include + #include + #include +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION // Iterators based on ideas of Jeremy Siek @@ -1066,6 +1068,7 @@ return reverse_iterator2 (begin2 ()); } +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION // Serialization template void serialize(Archive & ar, const unsigned int /* file_version */){ @@ -1086,6 +1089,7 @@ } ar & serialization::make_nvp("data",data_); } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION private: size_type size1_; @@ -2143,6 +2147,7 @@ return reverse_iterator2 (begin2 ()); } +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION // Serialization template void serialize(Archive & ar, const unsigned int /* file_version */){ @@ -2163,6 +2168,7 @@ } ar & serialization::make_nvp("data",data_); } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION private: size_type size1_; @@ -2528,6 +2534,7 @@ return const_reverse_iterator2 (begin2 ()); } +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION // Serialization template void serialize(Archive & ar, const unsigned int /* file_version */){ @@ -2547,6 +2554,7 @@ size2_ = s2; } } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION private: size_type size1_; @@ -2939,6 +2947,7 @@ return const_reverse_iterator2 (begin2 ()); } +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION // Serialization template void serialize(Archive & ar, const unsigned int /* file_version */){ @@ -2959,6 +2968,7 @@ size_common_ = ((std::min)(size1_, size2_)); } } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION private: size_type size1_; @@ -3406,6 +3416,7 @@ return const_reverse_iterator2 (begin2 ()); } +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION // Serialization template void serialize(Archive & ar, const unsigned int /* file_version */){ @@ -3427,6 +3438,7 @@ ar & serialization::make_nvp("value", value_); } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION private: size_type size1_; @@ -4357,6 +4369,7 @@ return reverse_iterator2 (begin2 ()); } +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION // Serialization template void serialize(Archive & ar, const unsigned int /* file_version */){ @@ -4378,6 +4391,7 @@ // could probably use make_array( &(data[0][0]), N*M ) ar & serialization::make_array(data_, N); } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION private: size_type size1_; Index: numeric/ublas/storage.hpp =================================================================== --- numeric/ublas/storage.hpp (revision 86799) +++ numeric/ublas/storage.hpp (working copy) @@ -18,9 +18,11 @@ #include #endif -#include -#include -#include +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION + #include + #include + #include +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION #include #include @@ -269,6 +271,7 @@ } private: +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION friend class boost::serialization::access; // Serialization @@ -282,9 +285,10 @@ } ar & serialization::make_array(data_, s); } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION private: - // Handle explict destroy on a (possibly indexed) iterator + // Handle explicit destroy on a (possibly indexed) iterator BOOST_UBLAS_INLINE static void iterator_destroy (iterator &i) { (&(*i)) -> ~value_type (); @@ -447,6 +451,7 @@ } private: +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION // Serialization friend class boost::serialization::access; @@ -461,6 +466,7 @@ } ar & serialization::make_array(data_, s); } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION private: size_type size_; Index: numeric/ublas/storage_sparse.hpp =================================================================== --- numeric/ublas/storage_sparse.hpp (revision 86799) +++ numeric/ublas/storage_sparse.hpp (working copy) @@ -14,11 +14,13 @@ #define _BOOST_UBLAS_STORAGE_SPARSE_ #include -#include -#include -#include -#include -#include +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION + #include + #include + #include + #include + #include +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION #include Index: numeric/ublas/vector.hpp =================================================================== --- numeric/ublas/vector.hpp (revision 86799) +++ numeric/ublas/vector.hpp (working copy) @@ -19,8 +19,10 @@ #include #include #include -#include -#include +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION + #include + #include +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION // Iterators based on ideas of Jeremy Siek @@ -776,6 +778,7 @@ return reverse_iterator (begin ()); } +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION // ------------- // Serialization // ------------- @@ -784,12 +787,13 @@ /// \param ar Archive object. Can be a flat file, an XML file or any other stream /// \param file_version Optional file version (not yet used) template - void serialize(Archive & ar, const unsigned int /* file_version */){ - ar & serialization::make_nvp("data",data_); - } + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & serialization::make_nvp("data",data_); + } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION - private: - array_type data_; + private: + array_type data_; }; @@ -1051,21 +1055,23 @@ } BOOST_UBLAS_INLINE const_reverse_iterator rend () const { - return const_reverse_iterator (begin ()); - } + return const_reverse_iterator (begin ()); + } - // Serialization - template - void serialize(Archive & ar, const unsigned int /* file_version */){ +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION + // Serialization + template + void serialize(Archive & ar, const unsigned int /* file_version */){ serialization::collection_size_type s (size_); ar & serialization::make_nvp("size",s); if (Archive::is_loading::value) { - size_ = s; - } - } + size_ = s; + } + } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION - private: - size_type size_; + private: + size_type size_; typedef const value_type const_value_type; static const_value_type zero_; }; @@ -1295,22 +1301,24 @@ } BOOST_UBLAS_INLINE const_reverse_iterator rend () const { - return const_reverse_iterator (begin ()); - } + return const_reverse_iterator (begin ()); + } - // Serialization - template - void serialize(Archive & ar, const unsigned int /* file_version */){ +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION + // Serialization + template + void serialize(Archive & ar, const unsigned int /* file_version */){ serialization::collection_size_type s (size_); ar & serialization::make_nvp("size",s); if (Archive::is_loading::value) { size_ = s; - } - ar & serialization::make_nvp("index", index_); - } + } + ar & serialization::make_nvp("index", index_); + } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION - private: - size_type size_; + private: + size_type size_; size_type index_; typedef const value_type const_value_type; static const_value_type zero_; @@ -1543,22 +1551,24 @@ } BOOST_UBLAS_INLINE const_reverse_iterator rend () const { - return const_reverse_iterator (begin ()); - } + return const_reverse_iterator (begin ()); + } - // Serialization - template - void serialize(Archive & ar, const unsigned int /* file_version */){ +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION + // Serialization + template + void serialize(Archive & ar, const unsigned int /* file_version */){ serialization::collection_size_type s (size_); ar & serialization::make_nvp("size",s); if (Archive::is_loading::value) { size_ = s; - } - ar & serialization::make_nvp("value", value_); - } + } + ar & serialization::make_nvp("value", value_); + } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION - private: - size_type size_; + private: + size_type size_; value_type value_; }; @@ -2049,12 +2059,13 @@ } BOOST_UBLAS_INLINE reverse_iterator rend () { - return reverse_iterator (begin ()); - } + return reverse_iterator (begin ()); + } - // Serialization - template - void serialize(Archive & ar, const unsigned int /* file_version */){ +#ifndef BOOST_UBLAS_DISABLE_SERIALIZATION + // Serialization + template + void serialize(Archive & ar, const unsigned int /* file_version */){ serialization::collection_size_type s (size_); ar & serialization::make_nvp("size",s); @@ -2063,12 +2074,13 @@ if (s > N) bad_size("too large size in bounded_vector::load()\n").raise(); size_ = s; } - // ISSUE: this writes the full array - ar & serialization::make_nvp("data",data_); - } + // ISSUE: this writes the full array + ar & serialization::make_nvp("data",data_); + } +#endif // BOOST_UBLAS_DISABLE_SERIALIZATION - private: - size_type size_; + private: + size_type size_; array_type data_; }; Index: type_traits/has_new_operator.hpp =================================================================== --- type_traits/has_new_operator.hpp (revision 86799) +++ type_traits/has_new_operator.hpp (working copy) @@ -18,6 +18,16 @@ // should be the last #include #include +#if defined(new) + #define BOOST_TT_AUX_MACRO_NEW_DEFINED + #if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) + #pragma push_macro("new") + #else + #error Unsupported compiler. Macro "new" must be hidden. + #endif + #undef new +#endif + namespace boost { namespace detail { template @@ -135,6 +145,13 @@ } // namespace boost +#if defined(BOOST_TT_AUX_MACRO_NEW_DEFINED) + #if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) + #pragma pop_macro("new") + #endif + #undef BOOST_TT_AUX_MACRO_NEW_DEFINED +#endif + #include #endif // BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED