diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt index 3a252dde..f488de7b 100644 --- a/CMake/CMakeLists.txt +++ b/CMake/CMakeLists.txt @@ -143,8 +143,6 @@ add_library(serialization ../src/stl_port.cpp ../src/text_iarchive.cpp ../src/text_oarchive.cpp - ../src/text_wiarchive.cpp - ../src/text_woarchive.cpp ../src/utf8_codecvt_facet.cpp ../src/void_cast.cpp ../src/xml_archive_exception.cpp @@ -298,8 +296,9 @@ archive_test(test_valarray) archive_test(test_variant A) archive_test(test_vector A) -polymorphic_archive_test(test_polymorphic test_polymorphic_A A ) +polymorphic_archive_test(test_polymorphic test_polymorphic_A A) polymorphic_archive_test(test_polymorphic2 test_polymorphic2imp) +polymorphic_archive_test(test_polymorphic_helper) # end test targets #################### diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index e3950a4c..69e62a1c 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -99,7 +99,11 @@ lib boost_serialization : $(SOURCES).cpp : msvc:/Gy - #gcc:"-fvisibility=hidden" + msvc:_SCL_SECURE_NO_WARNINGS + gcc:"-fvisibility=hidden" + gcc:"-fvisibility-inlines-hidden" + darwin:"-fvisibility=hidden" + darwin:"-fvisibility-inlines-hidden" shared:BOOST_SERIALIZATION_DYN_LINK=1 ; @@ -107,7 +111,11 @@ lib boost_wserialization : $(WSOURCES).cpp boost_serialization : msvc:/Gy - #gcc:"-fvisibility=hidden" + msvc:_SCL_SECURE_NO_WARNINGS + gcc:"-fvisibility=hidden" + gcc:"-fvisibility-inlines-hidden" + darwin:"-fvisibility=hidden" + darwin:"-fvisibility-inlines-hidden" shared:BOOST_SERIALIZATION_DYN_LINK=1 ; diff --git a/doc/implementation.html b/doc/implementation.html index 839bc45c..08e9974b 100644 --- a/doc/implementation.html +++ b/doc/implementation.html @@ -26,20 +26,13 @@ http://www.boost.org/LICENSE_1_0.txt)
-
Partial Function Template Ordering
Character Encoding -
Template Invocation syntax -
Partial Template Specialization
Specific Compiler/Library Issues
-
GCC 3.X, 4.X -
GCC 2.95 +
44.X
Intel 8.0
Visual C++ 8.0
Visual C++ 7.1 -
Visual C++ 7.0 -
Visual C++ 6.0 -
Borland 5.64 and 5.51
Comeau 4.3.3
Code Warrior 9.x
Code Warrior 8.3 @@ -49,81 +42,6 @@ http://www.boost.org/LICENSE_1_0.txt)
-

Partial Function Template Ordering

-Not all C++ compilers correctly support partial function template ordering (PFTO). -For these compilers, the following code will fail to compile: -

-template<class Archive, class T>
-void serialize(
-    Archive & ar, 
-    T & t, 
-    const unsigned int file_version
-){
-    ...
-}
-
-template<class Archive, class T>
-void serialize(
-    Archive & ar, 
-    my_template<T> & t, 
-    const unsigned int file_version
-){
-    ...
-}
-
-The serialization library works around this issue by using a different -default definition of the first template: -

-template<class Archive, class T>
-void serialize(
-    Archive & ar, 
-    T & t, 
-    const unsigned long int file_version  // Note: change to long
-){
-    ...
-}
-
-Now, the second template is not matched with the first one so there -is no PFTO and no compile error. When the serialization library invokes -

-serialize(ar, t, 0);
-
-the function declaration is first matched against templates with -an integer for the third argument. If there is a match, the matching -template is instantiated and later invoked. If there is no match, -an attempt is made to match other templates by converting arguments to other types. -In this case the third argument can be converted to long to match -the first template - which is the default. So in this case, the first -template will be instantiated and later invoked. We have managed to -use function overloading to achieve the same effect as PFTO -were it correctly implemented. -

-This depends upon undefined behavior of a compiler already -determined to be non-conforming. In other words, there is no -guarantee that this will work on all compilers. If a compiler does not -correctly support PFTO and this method cannot be used to workaround -it, non-intrusive serialization cannot be supported for that compiler. -As of this writing, such a compiler has not been encountered. -

-It turns out that using this "trick" can create problems with -compilers that DO correctly support PFTO. For this reason we -define a macro BOOST_PTFO which -is defined to be long -for non-conforming compilers and nothing for conforming ones. So -the default definition is really: -The serialization library works around this issue by using a different -default definition of the first template: -


-template<class Archive, class T>
-void serialize(
-    Archive & ar, 
-    T & t, 
-    const unsigned BOOST_PFTO int file_version  // Note: change to BOOST_PFTO
-){
-    ...
-}
-
-

Character Encoding

The whole question of character encoding combined with wide characters is much more complicated than it would seem to be. The current library @@ -175,31 +93,8 @@ do the following.
  • Create the archive with the flag no_codecvt. Naturally, the input process has to be symmetrical. -

    Partial Template Specialization

    -Compilers which fail to support partial template specialization will fail to compile -the following code. To make this compile, the const has to be removed. -
    
    -void f(A const* a, text_oarchive& oa)
    -{
    -  oa << a;
    -}
    -
    -

    Template Invocation syntax

    -Some compilers may not recognize the syntax: -
    
    -ar.template register_type<T>();
    -
    -for "registering" derived pointers of polymorphic classes. The actual -function prototype is: -
    
    -template<T>
    -void register_type(T * t = NULL);
    -
    -so that one may write ar.register_type(static_cast<T *>(NULL)) instead of -the syntax described above. -

    Specific Compiler/Library Issues

    -

    GCC 3.X, 4.X

    +

    GCC 4.X

    • GCC versions for Cygwin and MinGW fail to support wide character I/O. So all tests using wide char I/O fail. Note that if wide character I/O support @@ -219,17 +114,6 @@ the syntax described above. -Wno-ctor-dtor-privacy
    -

    GCC 2.95

    -All of the above plus:
    -
      -
    • The serialization library depends on the templated stream - implementation to function properly. - So STLPort must be used to build the library. -
    • Polymorphic archive tests fail. -
    • XML serialization only works with version 1.6x of spirit. In order to build - and use this library with this compiler, one must use version 1.6x rather than the - latest version shipped with boost. See Release Notes. -

    Intel C++ 8.0

    No known issues. All tests compile and run in debug and release modes. @@ -311,77 +195,6 @@ decide to use these configurations. in sync with those included here. -

    Visual C++ 7.0

    -
      -
    • The "pimpl" demo fails to link. Cause and workaround for this is unknown -
    • XML serialization only works with version 1.6x of spirit. In order to build and use this - library with this compiler, one must use version 1.6x rather than the latest version - shipped with boost. See Release Notes. -
    • This compiler does not support partial template specialization. - The implementation of the new shared_ptr serialization depends upon - compiler support for partial template specialization. This compiler doesn't implement this - feature. In order to serialize shared_ptr<A>, - invoke the macro BOOST_SERIALIZATION_SHARED_PTR(A) - in the header code. -
    • Lack of support for partial template specialization also creates problems for - serialization of std::map. In order to serialize - instances of this type include the invocation of BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION - for the key type of the map. -
    -

    Visual C++ 6.5

    -all the above issues for Visual C++ 7.0 plus: -
      -
    • Out of line template definitions are not recognized and fail with a confusing - error message. To function save/load/serialize member function templates must be defined - within the class definition. This feature is essential to demo_pimpl. Hence, - this program will fail to compile. In this case the problem can't be worked around and - still demonstrate this facility. -
    • This compiler does not support wchar_t as a separate type. It defines - wchar_t as an alias for short int. In general things will still - function. However certain customizations, such as overloading archive operators for - saving/loading wide character arrays would produce surprises in this environment. -
    • Under certain circumstances, a program will fail to link with the message: - LIN1179 - "invalid or corrupt file: duplicate comdat". According - to - http://groups.google.com/groups?th=8a05c82c4ffee280 - (look for P78) - A LNK1179 error occurs when: -
        -
      • The template class takes at least two arguments. -
      • The template is used at least two times with identical first - and different second arguments. -
      • The static member variable is of an object type with at least one - base class. (In another scenario it also occurred using a member - without a base class.) -
      - Working around this in the implementation of the library for this compiler - entailed a ridiculous amount of effort. Even so, the effort wasn't entirely successful. - With this compiler, this message will still appear under the following conditions: -
        -
      • When serializing a class with multiple base classes. This problem causes two - failure in the test suite. I have been unable to devise a way to work around this. -
      • Using more than one kind of archive in the same code module. This should be easy - to work around in practice. -
      -
    • Code modules exceeding some undetermined size that use the library will fail with - fatal error C1204: compiler limit : internal structure overflow. This can be addressed - by dividing the module into smaller ones. -
    -

    Borland 5.64 and 5.51

    -
      -
    • enum data members cannot be serialized. - Conversion to/from integers will work around the problem. -
    • If class serialize functions are not accessible either by making them public or by - including friend declarations as described in - Class Serialization - Member Function, the code - will compile but fail at runtime. -
    • Tests using custom extended type which doesn't use RTTI fails. (5.64 only !). -
    • Tests built in release mode fail. This seems to be an issue with the boost test system - with this compiler. -
    • XML serialization only works with version 1.6x of spirit. In order to build - and use this library with this compiler, one must use version 1.6x rather than the - latest version shipped with boost. See Release Notes. -

    Comeau 4.3.3

    • This compiler fails to make a DLL with export under windows. @@ -434,7 +247,7 @@ These platforms have several issues:

      Revised 1 November, 2004 -

      © Copyright Robert Ramey 2002-2004. +

      © Copyright Robert Ramey 2002-2015. 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)

      diff --git a/doc/release.html b/doc/release.html index eb785438..71475264 100644 --- a/doc/release.html +++ b/doc/release.html @@ -29,6 +29,8 @@ http://www.boost.org/LICENSE_1_0.txt)
      +
      Differences from version 1.58
      +
      Differences from version 1.48
      Differences from version 1.45
      Differences from version 1.43
      Differences from version 1.42
      @@ -39,12 +41,28 @@ http://www.boost.org/LICENSE_1_0.txt)
      Differences from version 1.35
      Differences from version 1.34
      Differences from version 1.33
      -
      Differences from version 1.32
      +
      Differences from version 1.32
      Pending Issues
      As of this writing, there are no known bugs. However, due to compiler/library quirks and or bugs, some tests fail with some combinations of compilers and libraries. +

      Differences from Boost 1.58

      +
        +
      • Eliminated support for Borland compilers and Microsoft compilers prior to version +7.1. +
      • Eliminated support for compilers which do not support Partial Function Template +Ordering (pfto). +
      • Added support for "visibility hidden" for GCC compilers. Shared libraries +will only expose symbols actually needed rather than all sympols in the library. This +should result in smaller shared libraries which are faster to load. +
      +

      Differences from Boost 1.48

      +
        +
      • Added support for C++11 types such as std::shared_ptr, std::array, and others. +
      • Implemented the concept of a "Helper" which can be used to implement serialization of types which are otherwise not serializable." +
      • Made library compatible with C++11, Compatibility with C++03 has been maintained. +

      Differences from Boost 1.45

      Since the release of version 1.42, it has been discovered that binary archives created by versions 1.42-1.44 cannot always be read by the diff --git a/include/boost/archive/archive_exception.hpp b/include/boost/archive/archive_exception.hpp index ffb430c6..1159d277 100644 --- a/include/boost/archive/archive_exception.hpp +++ b/include/boost/archive/archive_exception.hpp @@ -21,7 +21,6 @@ #include #include -#include #include // note: the only reason this is in here is that windows header @@ -40,11 +39,16 @@ namespace archive { ////////////////////////////////////////////////////////////////////// // exceptions thrown by archives // -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception : +class BOOST_SYMBOL_VISIBLE archive_exception : public virtual std::exception { -protected: +private: char m_buffer[128]; +protected: + BOOST_ARCHIVE_DECL unsigned int + append(unsigned int l, const char * a); + BOOST_ARCHIVE_DECL + archive_exception() BOOST_NOEXCEPT; public: typedef enum { no_exception, // initialized without code @@ -76,19 +80,15 @@ public: // type has been instantiated in more than one module. output_stream_error // error on input stream } exception_code; -public: exception_code code; - archive_exception( + + BOOST_ARCHIVE_DECL archive_exception( exception_code c, const char * e1 = NULL, const char * e2 = NULL - ); - virtual ~archive_exception() throw(); - virtual const char *what() const throw(); -protected: - unsigned int - append(unsigned int l, const char * a); - archive_exception(); + ) BOOST_NOEXCEPT; + virtual BOOST_ARCHIVE_DECL ~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW ; + virtual BOOST_ARCHIVE_DECL const char * what() const BOOST_NOEXCEPT_OR_NOTHROW ; }; }// namespace archive diff --git a/include/boost/archive/basic_archive.hpp b/include/boost/archive/basic_archive.hpp index 04121123..ce7ac99a 100644 --- a/include/boost/archive/basic_archive.hpp +++ b/include/boost/archive/basic_archive.hpp @@ -69,7 +69,7 @@ public: } }; -BOOST_ARCHIVE_DECL(library_version_type) +BOOST_ARCHIVE_DECL library_version_type BOOST_ARCHIVE_VERSION(); class version_type { @@ -242,7 +242,7 @@ enum archive_flags { flags_last = 8 }; -BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_DECL const char * BOOST_ARCHIVE_SIGNATURE(); /* NOTE : Warning : Warning : Warning : Warning : Warning diff --git a/include/boost/archive/basic_binary_iarchive.hpp b/include/boost/archive/basic_binary_iarchive.hpp index a649d5e9..c0cc655c 100644 --- a/include/boost/archive/basic_binary_iarchive.hpp +++ b/include/boost/archive/basic_binary_iarchive.hpp @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -51,7 +50,7 @@ namespace detail { ///////////////////////////////////////////////////////////////////////// // class basic_binary_iarchive - read serialized objects from a input binary stream template -class basic_binary_iarchive : +class BOOST_SYMBOL_VISIBLE basic_binary_iarchive : public detail::common_iarchive { #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS @@ -72,8 +71,8 @@ protected: // note extra nonsense to sneak it pass the borland compiers typedef detail::common_iarchive detail_common_iarchive; template - void load_override(T & t, BOOST_PFTO int version){ - this->detail_common_iarchive::load_override(t, static_cast(version)); + void load_override(T & t){ + this->detail_common_iarchive::load_override(t); } // include these to trap a change in binary format which @@ -86,7 +85,7 @@ protected: BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t)); // binary files don't include the optional information - void load_override(class_id_optional_type & /* t */, int){} + void load_override(class_id_optional_type & /* t */){} void load_override(tracking_type & t, int /*version*/){ library_version_type lvt = this->get_library_version(); @@ -101,10 +100,10 @@ protected: t = boost::archive::tracking_type(x); } } - void load_override(class_id_type & t, int version){ + void load_override(class_id_type & t){ library_version_type lvt = this->get_library_version(); if(boost::archive::library_version_type(7) < lvt){ - this->detail_common_iarchive::load_override(t, version); + this->detail_common_iarchive::load_override(t); } else if(boost::archive::library_version_type(6) < lvt){ @@ -118,37 +117,14 @@ protected: t = boost::archive::class_id_type(x); } } - void load_override(class_id_reference_type & t, int version){ - load_override(static_cast(t), version); + void load_override(class_id_reference_type & t){ + load_override(static_cast(t)); } -#if 0 - void load_override(class_id_reference_type & t, int version){ - library_version_type lvt = this->get_library_version(); - if(boost::archive::library_version_type(7) < lvt){ - this->detail_common_iarchive::load_override(t, version); - } - else - if(boost::archive::library_version_type(6) < lvt){ - int_least16_t x=0; - * this->This() >> x; - t = boost::archive::class_id_reference_type( - boost::archive::class_id_type(x) - ); - } - else{ - int x=0; - * this->This() >> x; - t = boost::archive::class_id_reference_type( - boost::archive::class_id_type(x) - ); - } - } -#endif - void load_override(version_type & t, int version){ + void load_override(version_type & t){ library_version_type lvt = this->get_library_version(); if(boost::archive::library_version_type(7) < lvt){ - this->detail_common_iarchive::load_override(t, version); + this->detail_common_iarchive::load_override(t); } else if(boost::archive::library_version_type(6) < lvt){ @@ -176,11 +152,11 @@ protected: } } - void load_override(boost::serialization::item_version_type & t, int version){ + void load_override(boost::serialization::item_version_type & t){ library_version_type lvt = this->get_library_version(); // if(boost::archive::library_version_type(7) < lvt){ if(boost::archive::library_version_type(6) < lvt){ - this->detail_common_iarchive::load_override(t, version); + this->detail_common_iarchive::load_override(t); } else if(boost::archive::library_version_type(6) < lvt){ @@ -195,9 +171,9 @@ protected: } } - void load_override(serialization::collection_size_type & t, int version){ + void load_override(serialization::collection_size_type & t){ if(boost::archive::library_version_type(5) < this->get_library_version()){ - this->detail_common_iarchive::load_override(t, version); + this->detail_common_iarchive::load_override(t); } else{ unsigned int x=0; @@ -206,9 +182,9 @@ protected: } } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - load_override(class_name_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + load_override(class_name_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void init(); basic_binary_iarchive(unsigned int flags) : diff --git a/include/boost/archive/basic_binary_iprimitive.hpp b/include/boost/archive/basic_binary_iprimitive.hpp index 4b419912..5e826310 100644 --- a/include/boost/archive/basic_binary_iprimitive.hpp +++ b/include/boost/archive/basic_binary_iprimitive.hpp @@ -67,8 +67,7 @@ class codecvt_null; ///////////////////////////////////////////////////////////////////////////// // class binary_iarchive - read serialized objects from a input binary stream template -class basic_binary_iprimitive -{ +class BOOST_SYMBOL_VISIBLE basic_binary_iprimitive { #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS friend class load_access; protected: @@ -103,25 +102,25 @@ public: BOOST_ASSERT(0 == i || 1 == i); (void)i; // warning suppression for release builds. } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void load(std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void load(std::wstring &ws); #endif - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void load(char * t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void load(wchar_t * t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void init(); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_binary_iprimitive( std::basic_streambuf & sb, bool no_codecvt ); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL ~basic_binary_iprimitive(); public: // we provide an optimized load for all fundamental types diff --git a/include/boost/archive/basic_binary_oarchive.hpp b/include/boost/archive/basic_binary_oarchive.hpp index f8b53e9d..f05f2f86 100644 --- a/include/boost/archive/basic_binary_oarchive.hpp +++ b/include/boost/archive/basic_binary_oarchive.hpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -59,8 +58,8 @@ namespace detail { // does have the virtue of buiding the smalles archive in the minimum amount // of time. So under some circumstances it may be he right choice. template -class basic_binary_oarchive : - public archive::detail::common_oarchive +class BOOST_SYMBOL_VISIBLE basic_binary_oarchive : + public detail::common_oarchive { #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: @@ -77,8 +76,8 @@ protected: // any datatype not specifed below will be handled by base class typedef detail::common_oarchive detail_common_oarchive; template - void save_override(const T & t, BOOST_PFTO int version){ - this->detail_common_oarchive::save_override(t, static_cast(version)); + void save_override(const T & t){ + this->detail_common_oarchive::save_override(t); } // include these to trap a change in binary format which @@ -92,14 +91,14 @@ protected: BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t)); // binary files don't include the optional information - void save_override(const class_id_optional_type & /* t */, int){} + void save_override(const class_id_optional_type & /* t */){} // enable this if we decide to support generation of previous versions #if 0 - void save_override(const boost::archive::version_type & t, int version){ + void save_override(const boost::archive::version_type & t){ library_version_type lvt = this->get_library_version(); if(boost::archive::library_version_type(7) < lvt){ - this->detail_common_oarchive::save_override(t, version); + this->detail_common_oarchive::save_override(t); } else if(boost::archive::library_version_type(6) < lvt){ @@ -111,10 +110,10 @@ protected: * this->This() << x; } } - void save_override(const boost::serialization::item_version_type & t, int version){ + void save_override(const boost::serialization::item_version_type & t){ library_version_type lvt = this->get_library_version(); if(boost::archive::library_version_type(7) < lvt){ - this->detail_common_oarchive::save_override(t, version); + this->detail_common_oarchive::save_override(t); } else if(boost::archive::library_version_type(6) < lvt){ @@ -127,10 +126,10 @@ protected: } } - void save_override(class_id_type & t, int version){ + void save_override(class_id_type & t){ library_version_type lvt = this->get_library_version(); if(boost::archive::library_version_type(7) < lvt){ - this->detail_common_oarchive::save_override(t, version); + this->detail_common_oarchive::save_override(t); } else if(boost::archive::library_version_type(6) < lvt){ @@ -142,20 +141,20 @@ protected: * this->This() << x; } } - void save_override(class_id_reference_type & t, int version){ - save_override(static_cast(t), version); + void save_override(class_id_reference_type & t){ + save_override(static_cast(t)); } #endif // explicitly convert to char * to avoid compile ambiguities - void save_override(const class_name_type & t, int){ + void save_override(const class_name_type & t){ const std::string s(t); * this->This() << s; } #if 0 - void save_override(const serialization::collection_size_type & t, int){ + void save_override(const serialization::collection_size_type & t){ if (get_library_version() < boost::archive::library_version_type(6)){ unsigned int x=0; * this->This() >> x; @@ -166,7 +165,7 @@ protected: } } #endif - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void init(); basic_binary_oarchive(unsigned int flags) : diff --git a/include/boost/archive/basic_binary_oprimitive.hpp b/include/boost/archive/basic_binary_oprimitive.hpp index a79cd1da..077d705e 100644 --- a/include/boost/archive/basic_binary_oprimitive.hpp +++ b/include/boost/archive/basic_binary_oprimitive.hpp @@ -61,7 +61,7 @@ class codecvt_null; // class basic_binary_oprimitive - binary output of prmitives template -class basic_binary_oprimitive { +class BOOST_SYMBOL_VISIBLE basic_binary_oprimitive { #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS friend class save_access; protected: @@ -94,26 +94,26 @@ public: BOOST_ASSERT(0 == static_cast(t) || 1 == static_cast(t)); save_binary(& t, sizeof(t)); } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void save(const std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void save(const std::wstring &ws); #endif - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void save(const char * t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void save(const wchar_t * t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void init(); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_binary_oprimitive( std::basic_streambuf & sb, bool no_codecvt ); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL ~basic_binary_oprimitive(); public: diff --git a/include/boost/archive/basic_text_iarchive.hpp b/include/boost/archive/basic_text_iarchive.hpp index 0e78ff6d..583041d8 100644 --- a/include/boost/archive/basic_text_iarchive.hpp +++ b/include/boost/archive/basic_text_iarchive.hpp @@ -25,7 +25,6 @@ // use two template parameters #include -#include #include #include @@ -47,7 +46,7 @@ namespace detail { ///////////////////////////////////////////////////////////////////////// // class basic_text_iarchive - read serialized objects from a input text stream template -class basic_text_iarchive : +class BOOST_SYMBOL_VISIBLE basic_text_iarchive : public detail::common_iarchive { #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS @@ -67,16 +66,16 @@ protected: // template ordering typedef detail::common_iarchive detail_common_iarchive; template - void load_override(T & t, BOOST_PFTO int){ - this->detail_common_iarchive::load_override(t, 0); + void load_override(T & t){ + this->detail_common_iarchive::load_override(t); } // text file don't include the optional information - void load_override(class_id_optional_type & /*t*/, int){} + void load_override(class_id_optional_type & /*t*/){} - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - load_override(class_name_type & t, int); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + load_override(class_name_type & t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void init(void); basic_text_iarchive(unsigned int flags) : diff --git a/include/boost/archive/basic_text_iprimitive.hpp b/include/boost/archive/basic_text_iprimitive.hpp index dabc3c87..08da95c3 100644 --- a/include/boost/archive/basic_text_iprimitive.hpp +++ b/include/boost/archive/basic_text_iprimitive.hpp @@ -64,7 +64,7 @@ namespace archive { #endif template -class basic_text_iprimitive { +class BOOST_SYMBOL_VISIBLE basic_text_iprimitive { protected: IStream &is; io::ios_flags_saver flags_saver; @@ -116,12 +116,12 @@ protected: t = i; } #endif - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_text_iprimitive(IStream &is, bool no_codecvt); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL ~basic_text_iprimitive(); public: - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void load_binary(void *address, std::size_t count); }; diff --git a/include/boost/archive/basic_text_oarchive.hpp b/include/boost/archive/basic_text_oarchive.hpp index 0c60a310..6f7f8fb1 100644 --- a/include/boost/archive/basic_text_oarchive.hpp +++ b/include/boost/archive/basic_text_oarchive.hpp @@ -25,7 +25,6 @@ // use two template parameters #include -#include #include #include #include @@ -47,7 +46,7 @@ namespace detail { ///////////////////////////////////////////////////////////////////////// // class basic_text_oarchive template -class basic_text_oarchive : +class BOOST_SYMBOL_VISIBLE basic_text_oarchive : public detail::common_oarchive { #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS @@ -69,7 +68,7 @@ protected: space } delimiter; - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void newtoken(); void newline(){ @@ -80,25 +79,25 @@ protected: // extra stuff to get it passed borland compilers typedef detail::common_oarchive detail_common_oarchive; template - void save_override(T & t, BOOST_PFTO int){ - this->detail_common_oarchive::save_override(t, 0); + void save_override(T & t){ + this->detail_common_oarchive::save_override(t); } // start new objects on a new line - void save_override(const object_id_type & t, int){ + void save_override(const object_id_type & t){ this->This()->newline(); - this->detail_common_oarchive::save_override(t, 0); + this->detail_common_oarchive::save_override(t); } // text file don't include the optional information - void save_override(const class_id_optional_type & /* t */, int){} + void save_override(const class_id_optional_type & /* t */){} - void save_override(const class_name_type & t, int){ + void save_override(const class_name_type & t){ const std::string s(t); * this->This() << s; } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void init(); basic_text_oarchive(unsigned int flags) : diff --git a/include/boost/archive/basic_text_oprimitive.hpp b/include/boost/archive/basic_text_oprimitive.hpp index 3c4cb5bd..86330921 100644 --- a/include/boost/archive/basic_text_oprimitive.hpp +++ b/include/boost/archive/basic_text_oprimitive.hpp @@ -64,7 +64,7 @@ namespace archive { ///////////////////////////////////////////////////////////////////////// // class basic_text_oprimitive - output of prmitives to stream template -class basic_text_oprimitive +class BOOST_SYMBOL_VISIBLE basic_text_oprimitive { protected: OStream &os; @@ -174,9 +174,9 @@ protected: save_impl(t, tf); } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_text_oprimitive(OStream & os, bool no_codecvt); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL ~basic_text_oprimitive(); public: // unformatted append of one character @@ -192,7 +192,7 @@ public: while('\0' != *s) os.put(*s++); } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void save_binary(const void *address, std::size_t count); }; diff --git a/include/boost/archive/basic_xml_archive.hpp b/include/boost/archive/basic_xml_archive.hpp index a4ad3a2f..bef368b9 100644 --- a/include/boost/archive/basic_xml_archive.hpp +++ b/include/boost/archive/basic_xml_archive.hpp @@ -27,35 +27,35 @@ namespace archive { // constant strings used in xml i/o extern -BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_DECL const char * BOOST_ARCHIVE_XML_OBJECT_ID(); extern -BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_DECL const char * BOOST_ARCHIVE_XML_OBJECT_REFERENCE(); extern -BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_DECL const char * BOOST_ARCHIVE_XML_CLASS_ID(); extern -BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_DECL const char * BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(); extern -BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_DECL const char * BOOST_ARCHIVE_XML_CLASS_NAME(); extern -BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_DECL const char * BOOST_ARCHIVE_XML_TRACKING(); extern -BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_DECL const char * BOOST_ARCHIVE_XML_VERSION(); extern -BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_DECL const char * BOOST_ARCHIVE_XML_SIGNATURE(); }// namespace archive diff --git a/include/boost/archive/basic_xml_iarchive.hpp b/include/boost/archive/basic_xml_iarchive.hpp index 5047fef2..7834d8a1 100644 --- a/include/boost/archive/basic_xml_iarchive.hpp +++ b/include/boost/archive/basic_xml_iarchive.hpp @@ -17,7 +17,6 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include #include #include @@ -44,7 +43,7 @@ namespace detail { ///////////////////////////////////////////////////////////////////////// // class xml_iarchive - read serialized objects from a input text stream template -class basic_xml_iarchive : +class BOOST_SYMBOL_VISIBLE basic_xml_iarchive : public detail::common_iarchive { #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS @@ -60,21 +59,21 @@ protected: #endif #endif unsigned int depth; - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void load_start(const char *name); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void load_end(const char *name); // Anything not an attribute and not a name-value pair is an // should be trapped here. template - void load_override(T & t, BOOST_PFTO int) + void load_override(T & t) { // If your program fails to compile here, its most likely due to // not specifying an nvp wrapper around the variable to // be serialized. BOOST_MPL_ASSERT((serialization::is_wrapper< T >)); - this->detail_common_iarchive::load_override(t, 0); + this->detail_common_iarchive::load_override(t); } // Anything not an attribute - see below - should be a name value @@ -82,14 +81,10 @@ protected: typedef detail::common_iarchive detail_common_iarchive; template void load_override( - #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - const - #endif - boost::serialization::nvp< T > & t, - int + const boost::serialization::nvp< T > & t ){ this->This()->load_start(t.name()); - this->detail_common_iarchive::load_override(t.value(), 0); + this->detail_common_iarchive::load_override(t.value()); this->This()->load_end(t.name()); } @@ -101,23 +96,23 @@ protected: // an xml archive. So we can skip it here. Note: we MUST override // it otherwise it will be loaded as a normal primitive w/o tag and // leaving the archive in an undetermined state - void load_override(class_id_optional_type & /* t */, int){} - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - load_override(object_id_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - load_override(version_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - load_override(class_id_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - load_override(tracking_type & t, int); + void load_override(class_id_optional_type & /* t */){} + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + load_override(object_id_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + load_override(version_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + load_override(class_id_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + load_override(tracking_type & t); // class_name_type can't be handled here as it depends upon the // char type used by the stream. So require the derived implementation // handle this. - // void load_override(class_name_type & t, int); + // void load_override(class_name_type & t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_xml_iarchive(unsigned int flags); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL ~basic_xml_iarchive(); }; diff --git a/include/boost/archive/basic_xml_oarchive.hpp b/include/boost/archive/basic_xml_oarchive.hpp index 8a039fa1..0325eee6 100644 --- a/include/boost/archive/basic_xml_oarchive.hpp +++ b/include/boost/archive/basic_xml_oarchive.hpp @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -45,7 +44,7 @@ namespace detail { ////////////////////////////////////////////////////////////////////// // class basic_xml_oarchive - write serialized objects to a xml output stream template -class basic_xml_oarchive : +class BOOST_SYMBOL_VISIBLE basic_xml_oarchive : public detail::common_oarchive { #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS @@ -65,78 +64,74 @@ protected: unsigned int depth; bool indent_next; bool pending_preamble; - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void indent(); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void init(); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void write_attribute( const char *attribute_name, int t, const char *conjunction = "=\"" ); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void write_attribute( const char *attribute_name, const char *key ); // helpers used below - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void save_start(const char *name); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void save_end(const char *name); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + BOOST_ARCHIVE_OR_WARCHIVE_DECL void end_preamble(); // Anything not an attribute and not a name-value pair is an // error and should be trapped here. template - void save_override(T & t, BOOST_PFTO int) + void save_override(T & t) { // If your program fails to compile here, its most likely due to // not specifying an nvp wrapper around the variable to // be serialized. BOOST_MPL_ASSERT((serialization::is_wrapper< T >)); - this->detail_common_oarchive::save_override(t, 0); + this->detail_common_oarchive::save_override(t); } // special treatment for name-value pairs. typedef detail::common_oarchive detail_common_oarchive; template void save_override( - #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - const - #endif - ::boost::serialization::nvp< T > & t, - int + const ::boost::serialization::nvp< T > & t ){ this->This()->save_start(t.name()); - this->detail_common_oarchive::save_override(t.const_value(), 0); + this->detail_common_oarchive::save_override(t.const_value()); this->This()->save_end(t.name()); } // specific overrides for attributes - not name value pairs so we // want to trap them before the above "fall through" - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - save_override(const object_id_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - save_override(const object_reference_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - save_override(const version_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - save_override(const class_id_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - save_override(const class_id_optional_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - save_override(const class_id_reference_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - save_override(const class_name_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) - save_override(const tracking_type & t, int); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const object_id_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const object_reference_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const version_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const class_id_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const class_id_optional_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const class_id_reference_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const class_name_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const tracking_type & t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_xml_oarchive(unsigned int flags); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_OR_WARCHIVE_DECL ~basic_xml_oarchive(); }; diff --git a/include/boost/archive/binary_iarchive.hpp b/include/boost/archive/binary_iarchive.hpp index ce67ccab..785ce761 100644 --- a/include/boost/archive/binary_iarchive.hpp +++ b/include/boost/archive/binary_iarchive.hpp @@ -31,7 +31,7 @@ namespace archive { // do not derive from this class. If you want to extend this functionality // via inhertance, derived from binary_iarchive_impl instead. This will // preserve correct static polymorphism. -class binary_iarchive : +class BOOST_SYMBOL_VISIBLE binary_iarchive : public binary_iarchive_impl< boost::archive::binary_iarchive, std::istream::char_type, diff --git a/include/boost/archive/binary_iarchive_impl.hpp b/include/boost/archive/binary_iarchive_impl.hpp index a9afe616..3ff994ad 100644 --- a/include/boost/archive/binary_iarchive_impl.hpp +++ b/include/boost/archive/binary_iarchive_impl.hpp @@ -17,7 +17,6 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include #include #include @@ -54,12 +53,9 @@ protected: friend class load_access; #endif #endif - // note: the following should not needed - but one compiler (vc 7.1) - // fails to compile one test (test_shared_ptr) without it !!! - // make this protected so it can be called from a derived archive template - void load_override(T & t, BOOST_PFTO int){ - this->basic_binary_iarchive::load_override(t, 0L); + void load_override(T & t){ + this->basic_binary_iarchive::load_override(t); } void init(unsigned int flags){ if(0 != (flags & no_header)) diff --git a/include/boost/archive/binary_oarchive.hpp b/include/boost/archive/binary_oarchive.hpp index 89a86da4..e8313fd7 100644 --- a/include/boost/archive/binary_oarchive.hpp +++ b/include/boost/archive/binary_oarchive.hpp @@ -32,7 +32,7 @@ namespace archive { // do not derive from this class. If you want to extend this functionality // via inhertance, derived from binary_oarchive_impl instead. This will // preserve correct static polymorphism. -class binary_oarchive : +class BOOST_SYMBOL_VISIBLE binary_oarchive : public binary_oarchive_impl< binary_oarchive, std::ostream::char_type, std::ostream::traits_type > diff --git a/include/boost/archive/binary_oarchive_impl.hpp b/include/boost/archive/binary_oarchive_impl.hpp index a8c97333..76e3a656 100644 --- a/include/boost/archive/binary_oarchive_impl.hpp +++ b/include/boost/archive/binary_oarchive_impl.hpp @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -55,12 +54,9 @@ protected: friend class save_access; #endif #endif - // note: the following should not needed - but one compiler (vc 7.1) - // fails to compile one test (test_shared_ptr) without it !!! - // make this protected so it can be called from a derived archive template - void save_override(T & t, BOOST_PFTO int){ - this->basic_binary_oarchive::save_override(t, 0L); + void save_override(T & t){ + this->basic_binary_oarchive::save_override(t); } void init(unsigned int flags) { if(0 != (flags & no_header)) diff --git a/include/boost/archive/codecvt_null.hpp b/include/boost/archive/codecvt_null.hpp index 75387a97..324122b7 100644 --- a/include/boost/archive/codecvt_null.hpp +++ b/include/boost/archive/codecvt_null.hpp @@ -61,7 +61,7 @@ public: template<> class codecvt_null : public std::codecvt { - virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result) + virtual BOOST_WARCHIVE_DECL std::codecvt_base::result do_out( std::mbstate_t & state, const wchar_t * first1, @@ -71,7 +71,7 @@ class codecvt_null : public std::codecvt char * last2, char * & next2 ) const; - virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result) + virtual BOOST_WARCHIVE_DECL std::codecvt_base::result do_in( std::mbstate_t & state, const char * first1, diff --git a/include/boost/archive/detail/abi_prefix.hpp b/include/boost/archive/detail/abi_prefix.hpp index e39ef11f..debf79e9 100644 --- a/include/boost/archive/detail/abi_prefix.hpp +++ b/include/boost/archive/detail/abi_prefix.hpp @@ -14,7 +14,3 @@ # pragma warning(disable : 4251 4231 4660 4275) #endif -#if defined( __BORLANDC__ ) -#pragma nopushoptwarn -#endif - diff --git a/include/boost/archive/detail/abi_suffix.hpp b/include/boost/archive/detail/abi_suffix.hpp index a283b36c..4e054d66 100644 --- a/include/boost/archive/detail/abi_suffix.hpp +++ b/include/boost/archive/detail/abi_suffix.hpp @@ -13,7 +13,3 @@ #endif #include // pops abi_suffix.hpp pragmas -#if defined( __BORLANDC__ ) -#pragma nopushoptwarn -#endif - diff --git a/include/boost/archive/detail/archive_serializer_map.hpp b/include/boost/archive/detail/archive_serializer_map.hpp index 53fcae40..5432bfc7 100644 --- a/include/boost/archive/detail/archive_serializer_map.hpp +++ b/include/boost/archive/detail/archive_serializer_map.hpp @@ -36,12 +36,11 @@ namespace detail { class basic_serializer; template -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) -archive_serializer_map { +class BOOST_SYMBOL_VISIBLE archive_serializer_map { public: - static bool insert(const basic_serializer * bs); - static void erase(const basic_serializer * bs); - static const basic_serializer * find( + static BOOST_ARCHIVE_OR_WARCHIVE_DECL bool insert(const basic_serializer * bs); + static BOOST_ARCHIVE_OR_WARCHIVE_DECL void erase(const basic_serializer * bs); + static BOOST_ARCHIVE_OR_WARCHIVE_DECL const basic_serializer * find( const boost::serialization::extended_type_info & type_ ); }; diff --git a/include/boost/archive/detail/basic_archive_impl.hpp b/include/boost/archive/detail/basic_archive_impl.hpp deleted file mode 100644 index 860066f8..00000000 --- a/include/boost/archive/detail/basic_archive_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP -#define BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// basic_archive_impl.hpp: - -// (C) Copyright 2002 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. - -#include - -#include // must be the last header - -namespace boost { -namespace serialization { - class extended_type_info; -} // namespace serialization - -namespace archive { -namespace detail { - -////////////////////////////////////////////////////////////////////// -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_archive_impl -{ -}; - -} // namespace detail -} // namespace serialization -} // namespace boost - -#include // pops abi_suffix.hpp pragmas - -#endif //BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP - - - diff --git a/include/boost/archive/detail/basic_config.hpp b/include/boost/archive/detail/basic_config.hpp deleted file mode 100644 index 4bd2723e..00000000 --- a/include/boost/archive/detail/basic_config.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP -#define BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -// basic_config.hpp ---------------------------------------------// - -// (c) Copyright Robert Ramey 2004 -// 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 library home page at http://www.boost.org/libs/serialization - -//----------------------------------------------------------------------------// - -// This header implements separate compilation features as described in -// http://www.boost.org/more/separate_compilation.html - -#include - -#ifdef BOOST_HAS_DECLSPEC // defined in config system -// we need to import/export our code only if the user has specifically -// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost -// libraries to be dynamically linked, or BOOST_ARCHIVE_DYN_LINK -// if they want just this one to be dynamically linked: -#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ARCHIVE_DYN_LINK) -// export if this is our own source, otherwise import: -#ifdef BOOST_ARCHIVE_SOURCE -# define BOOST_ARCHIVE_DECL __declspec(dllexport) -#else -# define BOOST_ARCHIVE_DECL __declspec(dllimport) -#endif // BOOST_ARCHIVE_SOURCE -#endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC -// -// if BOOST_ARCHIVE_DECL isn't defined yet define it now: -#ifndef BOOST_ARCHIVE_DECL -#define BOOST_ARCHIVE_DECL -#endif - -#endif // BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP diff --git a/include/boost/archive/detail/basic_iarchive.hpp b/include/boost/archive/detail/basic_iarchive.hpp index ce8dbc07..befd0c75 100644 --- a/include/boost/archive/detail/basic_iarchive.hpp +++ b/include/boost/archive/detail/basic_iarchive.hpp @@ -37,11 +37,12 @@ namespace archive { namespace detail { class basic_iarchive_impl; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class basic_iserializer; +class basic_pointer_iserializer; + ////////////////////////////////////////////////////////////////////// // class basic_iarchive - read serialized objects from a input stream -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : +class BOOST_SYMBOL_VISIBLE basic_iarchive : private boost::noncopyable, public boost::archive::detail::helper_collection { @@ -56,41 +57,46 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : virtual void vload(class_name_type &t) = 0; virtual void vload(tracking_type &t) = 0; protected: - basic_iarchive(unsigned int flags); + BOOST_ARCHIVE_DECL basic_iarchive(unsigned int flags); + boost::archive::detail::helper_collection & + get_helper_collection(){ + return *this; + } public: + // some msvc versions require that the following function be public + // otherwise it should really protected. // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_iarchive(); + BOOST_ARCHIVE_DECL ~basic_iarchive(); // note: NOT part of the public API. - void next_object_pointer(void *t); - void register_basic_serializer( + BOOST_ARCHIVE_DECL void next_object_pointer(void *t); + BOOST_ARCHIVE_DECL void register_basic_serializer( const basic_iserializer & bis ); - void load_object( + BOOST_ARCHIVE_DECL void load_object( void *t, const basic_iserializer & bis ); - const basic_pointer_iserializer * + BOOST_ARCHIVE_DECL const basic_pointer_iserializer * load_pointer( void * & t, const basic_pointer_iserializer * bpis_ptr, const basic_pointer_iserializer * (*finder)( const boost::serialization::extended_type_info & eti ) - ); // real public API starts here - void + BOOST_ARCHIVE_DECL void set_library_version(library_version_type archive_library_version); - library_version_type + BOOST_ARCHIVE_DECL library_version_type get_library_version() const; - unsigned int + BOOST_ARCHIVE_DECL unsigned int get_flags() const; - void + BOOST_ARCHIVE_DECL void reset_object_address(const void * new_address, const void * old_address); - void + BOOST_ARCHIVE_DECL void delete_created_pointers(); }; diff --git a/include/boost/archive/detail/basic_iserializer.hpp b/include/boost/archive/detail/basic_iserializer.hpp index 3bff3e12..240f0bc0 100644 --- a/include/boost/archive/detail/basic_iserializer.hpp +++ b/include/boost/archive/detail/basic_iserializer.hpp @@ -39,23 +39,23 @@ namespace serialization { namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class basic_iarchive; +class basic_pointer_iserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer : +class BOOST_SYMBOL_VISIBLE basic_iserializer : public basic_serializer { private: basic_pointer_iserializer *m_bpis; protected: - explicit basic_iserializer( + explicit BOOST_ARCHIVE_DECL basic_iserializer( const boost::serialization::extended_type_info & type ); // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_iserializer(); + BOOST_ARCHIVE_DECL ~basic_iserializer(); public: bool serialized_as_pointer() const { return m_bpis != NULL; diff --git a/include/boost/archive/detail/basic_oarchive.hpp b/include/boost/archive/detail/basic_oarchive.hpp index fe192f0a..702c5604 100644 --- a/include/boost/archive/detail/basic_oarchive.hpp +++ b/include/boost/archive/detail/basic_oarchive.hpp @@ -35,12 +35,12 @@ namespace archive { namespace detail { class basic_oarchive_impl; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class basic_oserializer; +class basic_pointer_oserializer; ////////////////////////////////////////////////////////////////////// // class basic_oarchive - write serialized objects to an output stream -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : +class BOOST_SYMBOL_VISIBLE basic_oarchive : private boost::noncopyable, public boost::archive::detail::helper_collection { @@ -59,22 +59,26 @@ class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : virtual void vsave(const class_name_type & t) = 0; virtual void vsave(const tracking_type t) = 0; protected: - basic_oarchive(unsigned int flags = 0); + BOOST_ARCHIVE_DECL basic_oarchive(unsigned int flags = 0); + BOOST_ARCHIVE_DECL boost::archive::detail::helper_collection & + get_helper_collection(){ + return *this; + } // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_oarchive(); + BOOST_ARCHIVE_DECL ~basic_oarchive(); public: // note: NOT part of the public interface - void register_basic_serializer( + BOOST_ARCHIVE_DECL void register_basic_serializer( const basic_oserializer & bos ); - void save_object( + BOOST_ARCHIVE_DECL void save_object( const void *x, const basic_oserializer & bos ); - void save_pointer( + BOOST_ARCHIVE_DECL void save_pointer( const void * t, const basic_pointer_oserializer * bpos_ptr ); @@ -82,9 +86,9 @@ public: vsave(NULL_POINTER_TAG); } // real public interface starts here - void end_preamble(); // default implementation does nothing - library_version_type get_library_version() const; - unsigned int get_flags() const; + BOOST_ARCHIVE_DECL void end_preamble(); // default implementation does nothing + BOOST_ARCHIVE_DECL library_version_type get_library_version() const; + BOOST_ARCHIVE_DECL unsigned int get_flags() const; }; } // namespace detail diff --git a/include/boost/archive/detail/basic_oserializer.hpp b/include/boost/archive/detail/basic_oserializer.hpp index 6ae063f5..7a710ba6 100644 --- a/include/boost/archive/detail/basic_oserializer.hpp +++ b/include/boost/archive/detail/basic_oserializer.hpp @@ -40,23 +40,23 @@ namespace serialization { namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class basic_oarchive; +class basic_pointer_oserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer : +class BOOST_SYMBOL_VISIBLE basic_oserializer : public basic_serializer { private: basic_pointer_oserializer *m_bpos; protected: - explicit basic_oserializer( + explicit BOOST_ARCHIVE_DECL basic_oserializer( const boost::serialization::extended_type_info & type_ ); // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_oserializer(); + BOOST_ARCHIVE_DECL ~basic_oserializer(); public: bool serialized_as_pointer() const { return m_bpos != NULL; diff --git a/include/boost/archive/detail/basic_pointer_iserializer.hpp b/include/boost/archive/detail/basic_pointer_iserializer.hpp index 86badc19..23b9f906 100644 --- a/include/boost/archive/detail/basic_pointer_iserializer.hpp +++ b/include/boost/archive/detail/basic_pointer_iserializer.hpp @@ -37,20 +37,20 @@ namespace serialization { namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; +class basic_iarchive; +class basic_iserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer +class BOOST_SYMBOL_VISIBLE basic_pointer_iserializer : public basic_serializer { protected: - explicit basic_pointer_iserializer( + explicit BOOST_ARCHIVE_DECL basic_pointer_iserializer( const boost::serialization::extended_type_info & type_ ); // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_pointer_iserializer(); + BOOST_ARCHIVE_DECL ~basic_pointer_iserializer(); public: virtual void * heap_allocation() const = 0; virtual const basic_iserializer & get_basic_serializer() const = 0; diff --git a/include/boost/archive/detail/basic_pointer_oserializer.hpp b/include/boost/archive/detail/basic_pointer_oserializer.hpp index bafc46a1..868e2fa5 100644 --- a/include/boost/archive/detail/basic_pointer_oserializer.hpp +++ b/include/boost/archive/detail/basic_pointer_oserializer.hpp @@ -36,14 +36,14 @@ namespace serialization { namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; +class basic_oarchive; +class basic_oserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer : +class BOOST_SYMBOL_VISIBLE basic_pointer_oserializer : public basic_serializer { protected: - explicit basic_pointer_oserializer( + explicit BOOST_ARCHIVE_DECL basic_pointer_oserializer( const boost::serialization::extended_type_info & type_ ); public: @@ -51,7 +51,7 @@ public: #if defined(__GNUC__) virtual #endif - ~basic_pointer_oserializer(); + BOOST_ARCHIVE_DECL ~basic_pointer_oserializer(); virtual const basic_oserializer & get_basic_serializer() const = 0; virtual void save_object_ptr( basic_oarchive & ar, diff --git a/include/boost/archive/detail/basic_serializer_map.hpp b/include/boost/archive/detail/basic_serializer_map.hpp index 202c20e1..79341803 100644 --- a/include/boost/archive/detail/basic_serializer_map.hpp +++ b/include/boost/archive/detail/basic_serializer_map.hpp @@ -34,7 +34,7 @@ namespace detail { class basic_serializer; -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +class BOOST_SYMBOL_VISIBLE basic_serializer_map : public boost::noncopyable { @@ -50,9 +50,9 @@ basic_serializer_map : public > map_type; map_type m_map; public: - bool insert(const basic_serializer * bs); - void erase(const basic_serializer * bs); - const basic_serializer * find( + BOOST_ARCHIVE_DECL bool insert(const basic_serializer * bs); + BOOST_ARCHIVE_DECL void erase(const basic_serializer * bs); + BOOST_ARCHIVE_DECL const basic_serializer * find( const boost::serialization::extended_type_info & type_ ) const; private: diff --git a/include/boost/archive/detail/common_iarchive.hpp b/include/boost/archive/detail/common_iarchive.hpp index 45e6d34b..b4c44d27 100644 --- a/include/boost/archive/detail/common_iarchive.hpp +++ b/include/boost/archive/detail/common_iarchive.hpp @@ -62,7 +62,7 @@ private: protected: // default processing - invoke serialization library template - void load_override(T & t, BOOST_PFTO int){ + void load_override(T & t){ archive::load(* this->This(), t); } // default implementations of functions which emit start/end tags for diff --git a/include/boost/archive/detail/common_oarchive.hpp b/include/boost/archive/detail/common_oarchive.hpp index 0d7474bc..13c71bc5 100644 --- a/include/boost/archive/detail/common_oarchive.hpp +++ b/include/boost/archive/detail/common_oarchive.hpp @@ -65,7 +65,7 @@ private: protected: // default processing - invoke serialization library template - void save_override(T & t, BOOST_PFTO int){ + void save_override(T & t){ archive::save(* this->This(), t); } void save_start(const char * /*name*/){} diff --git a/include/boost/archive/detail/decl.hpp b/include/boost/archive/detail/decl.hpp index 44e22be9..bb386d86 100644 --- a/include/boost/archive/detail/decl.hpp +++ b/include/boost/archive/detail/decl.hpp @@ -22,58 +22,38 @@ // http://www.boost.org/more/separate_compilation.html #include -#include -#if defined(BOOST_HAS_DECLSPEC) - #if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)) - #if defined(BOOST_ARCHIVE_SOURCE) - #if defined(__BORLANDC__) - #define BOOST_ARCHIVE_DECL(T) T __export - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export - #else - #define BOOST_ARCHIVE_DECL(T) __declspec(dllexport) T - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T - #endif - #else - #if defined(__BORLANDC__) - #define BOOST_ARCHIVE_DECL(T) T __import - #else - #define BOOST_ARCHIVE_DECL(T) __declspec(dllimport) T - #endif - #endif - #if defined(BOOST_WARCHIVE_SOURCE) - #if defined(__BORLANDC__) - #define BOOST_WARCHIVE_DECL(T) T __export - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export - #else - #define BOOST_WARCHIVE_DECL(T) __declspec(dllexport) T - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T - #endif - #else - #if defined(__BORLANDC__) - #define BOOST_WARCHIVE_DECL(T) T __import - #else - #define BOOST_WARCHIVE_DECL(T) __declspec(dllimport) T - #endif - #endif - #if !defined(BOOST_WARCHIVE_SOURCE) && !defined(BOOST_ARCHIVE_SOURCE) - #if defined(__BORLANDC__) - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __import - #else - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllimport) T - #endif - #endif +#if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)) + #if defined(BOOST_ARCHIVE_SOURCE) + #define BOOST_ARCHIVE_DECL BOOST_SYMBOL_EXPORT + #else + #define BOOST_ARCHIVE_DECL BOOST_SYMBOL_IMPORT #endif -#endif // BOOST_HAS_DECLSPEC + #if defined(BOOST_WARCHIVE_SOURCE) + #define BOOST_WARCHIVE_DECL BOOST_SYMBOL_EXPORT + #else + #define BOOST_WARCHIVE_DECL BOOST_SYMBOL_IMPORT + #endif + #if !defined(BOOST_WARCHIVE_SOURCE) && !defined(BOOST_ARCHIVE_SOURCE) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_IMPORT + #endif + + #if defined(BOOST_WARCHIVE_SOURCE) || defined(BOOST_ARCHIVE_SOURCE) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_EXPORT + #else + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_IMPORT + #endif + +#endif #if ! defined(BOOST_ARCHIVE_DECL) - #define BOOST_ARCHIVE_DECL(T) T + #define BOOST_ARCHIVE_DECL #endif #if ! defined(BOOST_WARCHIVE_DECL) - #define BOOST_WARCHIVE_DECL(T) T + #define BOOST_WARCHIVE_DECL #endif #if ! defined(BOOST_ARCHIVE_OR_WARCHIVE_DECL) - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL #endif #endif // BOOST_ARCHIVE_DETAIL_DECL_HPP diff --git a/include/boost/archive/detail/helper_collection.hpp b/include/boost/archive/detail/helper_collection.hpp index cfa644f7..edb4125e 100644 --- a/include/boost/archive/detail/helper_collection.hpp +++ b/include/boost/archive/detail/helper_collection.hpp @@ -55,11 +55,12 @@ class helper_collection collection m_collection; struct predicate { + BOOST_DELETED_FUNCTION(predicate & operator=(const predicate & rhs)) + public: const void * const m_ti; bool operator()(helper_value_type const &rhs) const { return m_ti == rhs.first; } - predicate & operator=(const void * ti); // to suppress warning predicate(const void * ti) : m_ti(ti) {} @@ -69,7 +70,7 @@ protected: ~helper_collection(){} public: template - Helper& get_helper(void * const id = 0) { + Helper& find_helper(void * const id = 0) { collection::const_iterator it = std::find_if( m_collection.begin(), diff --git a/include/boost/archive/detail/interface_iarchive.hpp b/include/boost/archive/detail/interface_iarchive.hpp index b7bd1659..4a99e28b 100644 --- a/include/boost/archive/detail/interface_iarchive.hpp +++ b/include/boost/archive/detail/interface_iarchive.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include // must be the last header @@ -27,7 +28,7 @@ namespace boost { namespace archive { namespace detail { -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class basic_pointer_iserializer; template class interface_iarchive @@ -55,9 +56,16 @@ public: this->This()->register_basic_serializer(bpis.get_basic_serializer()); return & bpis; } + template + Helper & + get_helper(void * const id = 0){ + helper_collection & hc = this->This()->get_helper_collection(); + return hc.template find_helper(id); + } + template Archive & operator>>(T & t){ - this->This()->load_override(t, 0); + this->This()->load_override(t); return * this->This(); } diff --git a/include/boost/archive/detail/interface_oarchive.hpp b/include/boost/archive/detail/interface_oarchive.hpp index 7ae71768..187013b6 100644 --- a/include/boost/archive/detail/interface_oarchive.hpp +++ b/include/boost/archive/detail/interface_oarchive.hpp @@ -29,7 +29,7 @@ namespace boost { namespace archive { namespace detail { -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_pointer_oserializer; template class interface_oarchive @@ -57,22 +57,25 @@ public: this->This()->register_basic_serializer(bpos.get_basic_serializer()); return & bpos; } + + template + Helper & + get_helper(void * const id = 0){ + helper_collection & hc = this->This()->get_helper_collection(); + return hc.template find_helper(id); + } template - Archive & operator<<(T & t){ - this->This()->save_override(t, 0); + Archive & operator<<(const T & t){ + this->This()->save_override(t); return * this->This(); } // the & operator template - Archive & operator&(T & t){ - #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - return * this->This() << const_cast(t); - #else - return * this->This() << t; - #endif - } + Archive & operator&(const T & t){ + return * this ->This() << t; + }; }; } // namespace detail diff --git a/include/boost/archive/detail/iserializer.hpp b/include/boost/archive/detail/iserializer.hpp index 65dfe8e3..d6d3f42f 100644 --- a/include/boost/archive/detail/iserializer.hpp +++ b/include/boost/archive/detail/iserializer.hpp @@ -58,8 +58,7 @@ namespace std{ #include #define DONT_USE_HAS_NEW_OPERATOR ( \ - defined(__BORLANDC__) \ - || BOOST_WORKAROUND(__IBMCPP__, < 1210) \ + BOOST_WORKAROUND(__IBMCPP__, < 1210) \ || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \ ) #if ! DONT_USE_HAS_NEW_OPERATOR @@ -618,40 +617,6 @@ inline void load(Archive & ar, T &t){ typex::invoke(ar, t); } -#if 0 - -// BORLAND -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) -// borland has a couple of problems -// a) if function is partially specialized - see below -// const paramters are transformed to non-const ones -// b) implementation of base_object can't be made to work -// correctly which results in all base_object s being const. -// So, strip off the const for borland. This breaks the trap -// for loading const objects - but I see no alternative -template -inline void load(Archive &ar, const T & t){ - load(ar, const_cast(t)); -} -#endif - -// let wrappers through. -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -template -inline void load_wrapper(Archive &ar, const T&t, mpl::true_){ - boost::archive::load(ar, const_cast(t)); -} - -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) -template -inline void load(Archive &ar, const T&t){ - load_wrapper(ar,t,serialization::is_wrapper< T >()); -} -#endif -#endif - -#endif - } // namespace archive } // namespace boost diff --git a/include/boost/archive/detail/polymorphic_iarchive_route.hpp b/include/boost/archive/detail/polymorphic_iarchive_route.hpp index a8eb7aa9..2c57a3f5 100644 --- a/include/boost/archive/detail/polymorphic_iarchive_route.hpp +++ b/include/boost/archive/detail/polymorphic_iarchive_route.hpp @@ -39,8 +39,8 @@ namespace serialization { namespace archive { namespace detail{ -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class BOOST_ARCHIVE_DECL basic_iserializer; +class BOOST_ARCHIVE_DECL basic_pointer_iserializer; #ifdef BOOST_MSVC # pragma warning(push) @@ -166,10 +166,13 @@ private: virtual void load_end(const char * name){ ArchiveImplementation::load_end(name); } - virtual void register_basic_serializer(const basic_iserializer & bis){ ArchiveImplementation::register_basic_serializer(bis); } + virtual helper_collection & + get_helper_collection(){ + return ArchiveImplementation::get_helper_collection(); + } public: // this can't be inheriteded because they appear in mulitple // parents diff --git a/include/boost/archive/detail/polymorphic_oarchive_route.hpp b/include/boost/archive/detail/polymorphic_oarchive_route.hpp index 9211df2a..ae750133 100644 --- a/include/boost/archive/detail/polymorphic_oarchive_route.hpp +++ b/include/boost/archive/detail/polymorphic_oarchive_route.hpp @@ -39,8 +39,8 @@ namespace serialization { namespace archive { namespace detail{ -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class BOOST_ARCHIVE_DECL basic_oserializer; +class BOOST_ARCHIVE_DECL basic_pointer_oserializer; #ifdef BOOST_MSVC # pragma warning(push) @@ -160,6 +160,10 @@ private: virtual void register_basic_serializer(const detail::basic_oserializer & bos){ ArchiveImplementation::register_basic_serializer(bos); } + virtual helper_collection & + get_helper_collection(){ + return ArchiveImplementation::get_helper_collection(); + } public: // this can't be inheriteded because they appear in mulitple // parents diff --git a/include/boost/archive/impl/archive_serializer_map.ipp b/include/boost/archive/impl/archive_serializer_map.ipp index c8ad96b3..8dabf0d0 100644 --- a/include/boost/archive/impl/archive_serializer_map.ipp +++ b/include/boost/archive/impl/archive_serializer_map.ipp @@ -37,7 +37,7 @@ namespace extra_detail { // anon #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(bool) +BOOST_ARCHIVE_OR_WARCHIVE_DECL bool archive_serializer_map::insert(const basic_serializer * bs){ return boost::serialization::singleton< extra_detail::map @@ -45,7 +45,7 @@ archive_serializer_map::insert(const basic_serializer * bs){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void archive_serializer_map::erase(const basic_serializer * bs){ if(boost::serialization::singleton< extra_detail::map @@ -57,7 +57,7 @@ archive_serializer_map::erase(const basic_serializer * bs){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(const basic_serializer *) +BOOST_ARCHIVE_OR_WARCHIVE_DECL const basic_serializer * archive_serializer_map::find( const boost::serialization::extended_type_info & eti ) { diff --git a/include/boost/archive/impl/basic_binary_iarchive.ipp b/include/boost/archive/impl/basic_binary_iarchive.ipp index 5067b098..d5619ab6 100644 --- a/include/boost/archive/impl/basic_binary_iarchive.ipp +++ b/include/boost/archive/impl/basic_binary_iarchive.ipp @@ -32,11 +32,11 @@ namespace archive { /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // implementation of binary_binary_archive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_binary_iarchive::load_override(class_name_type & t, int){ +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_binary_iarchive::load_override(class_name_type & t){ std::string cn; cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE); - load_override(cn, 0); + load_override(cn); if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)) boost::serialization::throw_exception( archive_exception(archive_exception::invalid_class_name) @@ -47,8 +47,8 @@ basic_binary_iarchive::load_override(class_name_type & t, int){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_binary_iarchive::init(){ +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_binary_iarchive::init(void){ // read signature in an archive version independent manner std::string file_signature; diff --git a/include/boost/archive/impl/basic_binary_iprimitive.ipp b/include/boost/archive/impl/basic_binary_iprimitive.ipp index e22c3bd6..bee7bafe 100644 --- a/include/boost/archive/impl/basic_binary_iprimitive.ipp +++ b/include/boost/archive/impl/basic_binary_iprimitive.ipp @@ -37,7 +37,7 @@ namespace archive { // implementation of basic_binary_iprimitive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_iprimitive::init() { // Detect attempts to pass native binary archives across @@ -90,7 +90,7 @@ basic_binary_iprimitive::init() } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_iprimitive::load(wchar_t * ws) { std::size_t l; // number of wchar_t !!! @@ -100,7 +100,7 @@ basic_binary_iprimitive::load(wchar_t * ws) } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_iprimitive::load(std::string & s) { std::size_t l; @@ -117,7 +117,7 @@ basic_binary_iprimitive::load(std::string & s) #ifndef BOOST_NO_CWCHAR template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_iprimitive::load(char * s) { std::size_t l; @@ -129,7 +129,7 @@ basic_binary_iprimitive::load(char * s) #ifndef BOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_iprimitive::load(std::wstring & ws) { std::size_t l; @@ -145,7 +145,7 @@ basic_binary_iprimitive::load(std::wstring & ws) #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_binary_iprimitive::basic_binary_iprimitive( std::basic_streambuf & sb, bool no_codecvt @@ -194,7 +194,7 @@ class input_streambuf_access : public std::basic_streambuf { // scoped_ptr requires that archive_locale be a complete type at time of // destruction so define destructor here rather than in the header template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_binary_iprimitive::~basic_binary_iprimitive(){ // push back unread characters //destructor can't throw ! diff --git a/include/boost/archive/impl/basic_binary_oarchive.ipp b/include/boost/archive/impl/basic_binary_oarchive.ipp index 467fd6fe..d5a019d3 100644 --- a/include/boost/archive/impl/basic_binary_oarchive.ipp +++ b/include/boost/archive/impl/basic_binary_oarchive.ipp @@ -28,11 +28,7 @@ namespace archive { // implementation of binary_binary_oarchive template -#if !defined(__BORLANDC__) -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -#else -void -#endif +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_oarchive::init(){ // write signature in an archive version independent manner const std::string file_signature(BOOST_ARCHIVE_SIGNATURE()); diff --git a/include/boost/archive/impl/basic_binary_oprimitive.ipp b/include/boost/archive/impl/basic_binary_oprimitive.ipp index 238617d5..88cc1243 100644 --- a/include/boost/archive/impl/basic_binary_oprimitive.ipp +++ b/include/boost/archive/impl/basic_binary_oprimitive.ipp @@ -41,7 +41,7 @@ namespace archive { // implementation of basic_binary_oprimitive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_oprimitive::init() { // record native sizes of fundamental types @@ -57,7 +57,7 @@ basic_binary_oprimitive::init() } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_oprimitive::save(const char * s) { std::size_t l = std::strlen(s); @@ -66,7 +66,7 @@ basic_binary_oprimitive::save(const char * s) } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_oprimitive::save(const std::string &s) { std::size_t l = static_cast(s.size()); @@ -76,7 +76,7 @@ basic_binary_oprimitive::save(const std::string &s) #ifndef BOOST_NO_CWCHAR template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_oprimitive::save(const wchar_t * ws) { std::size_t l = std::wcslen(ws); @@ -87,7 +87,7 @@ basic_binary_oprimitive::save(const wchar_t * ws) #ifndef BOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_binary_oprimitive::save(const std::wstring &ws) { std::size_t l = ws.size(); @@ -97,7 +97,7 @@ basic_binary_oprimitive::save(const std::wstring &ws) #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_binary_oprimitive::basic_binary_oprimitive( std::basic_streambuf & sb, bool no_codecvt @@ -146,7 +146,7 @@ class output_streambuf_access : public std::basic_streambuf { // scoped_ptr requires that g be a complete type at time of // destruction so define destructor here rather than in the header template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_binary_oprimitive::~basic_binary_oprimitive(){ // flush buffer //destructor can't throw diff --git a/include/boost/archive/impl/basic_text_iarchive.ipp b/include/boost/archive/impl/basic_text_iarchive.ipp index 8d364f9b..9ec8c658 100644 --- a/include/boost/archive/impl/basic_text_iarchive.ipp +++ b/include/boost/archive/impl/basic_text_iarchive.ipp @@ -29,11 +29,11 @@ namespace archive { // implementation of text_text_archive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_text_iarchive::load_override(class_name_type & t, int){ +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_text_iarchive::load_override(class_name_type & t){ std::string cn; cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE); - load_override(cn, 0); + load_override(cn); if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)) boost::serialization::throw_exception( archive_exception(archive_exception::invalid_class_name) @@ -44,7 +44,7 @@ basic_text_iarchive::load_override(class_name_type & t, int){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_text_iarchive::init(void){ // read signature in an archive version independent manner std::string file_signature; diff --git a/include/boost/archive/impl/basic_text_iprimitive.ipp b/include/boost/archive/impl/basic_text_iprimitive.ipp index 9b667896..e245dc54 100644 --- a/include/boost/archive/impl/basic_text_iprimitive.ipp +++ b/include/boost/archive/impl/basic_text_iprimitive.ipp @@ -19,7 +19,6 @@ namespace std{ #endif #include -#include #include #include @@ -53,7 +52,7 @@ namespace detail { // translate base64 text into binary and copy into buffer // until buffer is full. template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_text_iprimitive::load_binary( void *address, std::size_t count @@ -87,11 +86,7 @@ basic_text_iprimitive::load_binary( > binary; - binary i = binary( - BOOST_MAKE_PFTO_WRAPPER( - iterators::istream_iterator(is) - ) - ); + binary i = binary(iterators::istream_iterator(is)); char * caddr = static_cast(address); @@ -112,7 +107,7 @@ basic_text_iprimitive::load_binary( } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_text_iprimitive::basic_text_iprimitive( IStream &is_, bool no_codecvt @@ -142,7 +137,7 @@ basic_text_iprimitive::basic_text_iprimitive( #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_text_iprimitive::~basic_text_iprimitive(){ is.sync(); } diff --git a/include/boost/archive/impl/basic_text_oarchive.ipp b/include/boost/archive/impl/basic_text_oarchive.ipp index 4170c971..44bc1401 100644 --- a/include/boost/archive/impl/basic_text_oarchive.ipp +++ b/include/boost/archive/impl/basic_text_oarchive.ipp @@ -27,7 +27,7 @@ namespace archive { // implementation of basic_text_oarchive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_text_oarchive::newtoken() { switch(delimiter){ @@ -48,7 +48,7 @@ basic_text_oarchive::newtoken() } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_text_oarchive::init(){ // write signature in an archive version independent manner const std::string file_signature(BOOST_ARCHIVE_SIGNATURE()); diff --git a/include/boost/archive/impl/basic_text_oprimitive.ipp b/include/boost/archive/impl/basic_text_oprimitive.ipp index 10e21338..f2b0a10a 100644 --- a/include/boost/archive/impl/basic_text_oprimitive.ipp +++ b/include/boost/archive/impl/basic_text_oprimitive.ipp @@ -10,7 +10,6 @@ #include // NULL #include // std::copy -#include #include #include @@ -26,7 +25,7 @@ namespace archive { // translate to base64 and copy in to buffer. template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_text_oprimitive::save_binary( const void *address, std::size_t count @@ -59,9 +58,9 @@ basic_text_oprimitive::save_binary( boost::archive::iterators::ostream_iterator oi(os); std::copy( - base64_text(BOOST_MAKE_PFTO_WRAPPER(static_cast(address))), + base64_text(static_cast(address)), base64_text( - BOOST_MAKE_PFTO_WRAPPER(static_cast(address) + count) + static_cast(address) + count ), oi ); @@ -75,7 +74,7 @@ basic_text_oprimitive::save_binary( } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_text_oprimitive::basic_text_oprimitive( OStream & os_, bool no_codecvt @@ -105,7 +104,7 @@ basic_text_oprimitive::basic_text_oprimitive( #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_text_oprimitive::~basic_text_oprimitive(){ os << std::endl; } diff --git a/include/boost/archive/impl/basic_xml_grammar.hpp b/include/boost/archive/impl/basic_xml_grammar.hpp index 66ca1f0b..70a6013a 100644 --- a/include/boost/archive/impl/basic_xml_grammar.hpp +++ b/include/boost/archive/impl/basic_xml_grammar.hpp @@ -72,14 +72,14 @@ public: friend struct return_values; private: - typedef BOOST_DEDUCED_TYPENAME std::basic_istream IStream; - typedef BOOST_DEDUCED_TYPENAME std::basic_string StringType; - typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::chset chset_t; - typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::chlit chlit_t; - typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::scanner< - BOOST_DEDUCED_TYPENAME std::basic_string::iterator + typedef typename std::basic_istream IStream; + typedef typename std::basic_string StringType; + typedef typename boost::spirit::classic::chset chset_t; + typedef typename boost::spirit::classic::chlit chlit_t; + typedef typename boost::spirit::classic::scanner< + typename std::basic_string::iterator > scanner_t; - typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::rule rule_t; + typedef typename boost::spirit::classic::rule rule_t; // Start grammar definition rule_t Reference, diff --git a/include/boost/archive/impl/basic_xml_iarchive.ipp b/include/boost/archive/impl/basic_xml_iarchive.ipp index 52dfde1a..9e670120 100644 --- a/include/boost/archive/impl/basic_xml_iarchive.ipp +++ b/include/boost/archive/impl/basic_xml_iarchive.ipp @@ -24,7 +24,7 @@ namespace archive { // implementation of xml_text_archive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_iarchive::load_start(const char *name){ // if there's no name if(NULL == name) @@ -41,7 +41,7 @@ basic_xml_iarchive::load_start(const char *name){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_iarchive::load_end(const char *name){ // if there's no name if(NULL == name) @@ -77,37 +77,37 @@ basic_xml_iarchive::load_end(const char *name){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_iarchive::load_override(object_id_type & t, int){ +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_iarchive::load_override(object_id_type & t){ t = object_id_type(this->This()->gimpl->rv.object_id); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_iarchive::load_override(version_type & t, int){ +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_iarchive::load_override(version_type & t){ t = version_type(this->This()->gimpl->rv.version); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_iarchive::load_override(class_id_type & t, int){ +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_iarchive::load_override(class_id_type & t){ t = class_id_type(this->This()->gimpl->rv.class_id); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_iarchive::load_override(tracking_type & t, int){ +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_iarchive::load_override(tracking_type & t){ t = this->This()->gimpl->rv.tracking_level; } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_xml_iarchive::basic_xml_iarchive(unsigned int flags) : detail::common_iarchive(flags), depth(0) {} template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_xml_iarchive::~basic_xml_iarchive(){} } // namespace archive diff --git a/include/boost/archive/impl/basic_xml_oarchive.ipp b/include/boost/archive/impl/basic_xml_oarchive.ipp index 0c57a12c..5db1e130 100644 --- a/include/boost/archive/impl/basic_xml_oarchive.ipp +++ b/include/boost/archive/impl/basic_xml_oarchive.ipp @@ -58,7 +58,7 @@ struct XML_name { // implemenations of functions common to both types of xml output template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::write_attribute( const char *attribute_name, int t, @@ -72,7 +72,7 @@ basic_xml_oarchive::write_attribute( } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::write_attribute( const char *attribute_name, const char *key @@ -85,7 +85,7 @@ basic_xml_oarchive::write_attribute( } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::indent(){ int i; for(i = depth; i-- > 0;) @@ -93,7 +93,7 @@ basic_xml_oarchive::indent(){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::save_start(const char *name) { if(NULL == name) @@ -115,7 +115,7 @@ basic_xml_oarchive::save_start(const char *name) } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::save_end(const char *name) { if(NULL == name) @@ -139,7 +139,7 @@ basic_xml_oarchive::save_end(const char *name) } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::end_preamble(){ if(pending_preamble){ this->This()->put('>'); @@ -148,14 +148,14 @@ basic_xml_oarchive::end_preamble(){ } #if 0 template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_oarchive::save_override(const object_id_type & t, int) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_oarchive::save_override(const object_id_type & t) { int i = t.t; // extra .t is for borland write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_"); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::save_override( const object_reference_type & t, int @@ -164,8 +164,8 @@ basic_xml_oarchive::save_override( write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_"); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_oarchive::save_override(const version_type & t, int) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_oarchive::save_override(const version_type & t) { int i = t.t; // extra .t is for borland write_attribute(BOOST_ARCHIVE_XML_VERSION(), i); @@ -173,55 +173,52 @@ basic_xml_oarchive::save_override(const version_type & t, int) #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_oarchive::save_override(const object_id_type & t, int) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_oarchive::save_override(const object_id_type & t) { // borland doesn't do conversion of STRONG_TYPEDEFs very well const unsigned int i = t; write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_"); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::save_override( - const object_reference_type & t, - int + const object_reference_type & t ){ const unsigned int i = t; write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_"); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_oarchive::save_override(const version_type & t, int) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_oarchive::save_override(const version_type & t) { const unsigned int i = t; write_attribute(BOOST_ARCHIVE_XML_VERSION(), i); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_oarchive::save_override(const class_id_type & t, int) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_oarchive::save_override(const class_id_type & t) { write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::save_override( - const class_id_reference_type & t, - int + const class_id_reference_type & t ){ write_attribute(BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(), t); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::save_override( - const class_id_optional_type & t, - int + const class_id_optional_type & t ){ write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_oarchive::save_override(const class_name_type & t, int) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_oarchive::save_override(const class_name_type & t) { const char * key = t; if(NULL == key) @@ -230,14 +227,14 @@ basic_xml_oarchive::save_override(const class_name_type & t, int) } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) -basic_xml_oarchive::save_override(const tracking_type & t, int) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_oarchive::save_override(const tracking_type & t) { write_attribute(BOOST_ARCHIVE_XML_TRACKING(), t.t); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +BOOST_ARCHIVE_OR_WARCHIVE_DECL void basic_xml_oarchive::init(){ // xml header this->This()->put("\n"); @@ -250,7 +247,7 @@ basic_xml_oarchive::init(){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_xml_oarchive::basic_xml_oarchive(unsigned int flags) : detail::common_oarchive(flags), depth(0), @@ -260,7 +257,7 @@ basic_xml_oarchive::basic_xml_oarchive(unsigned int flags) : } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_xml_oarchive::~basic_xml_oarchive(){ if(0 == (this->get_flags() & no_header)){ BOOST_TRY{ diff --git a/include/boost/archive/impl/text_iarchive_impl.ipp b/include/boost/archive/impl/text_iarchive_impl.ipp index f14c0d8e..ae4e2750 100644 --- a/include/boost/archive/impl/text_iarchive_impl.ipp +++ b/include/boost/archive/impl/text_iarchive_impl.ipp @@ -28,7 +28,7 @@ namespace boost { namespace archive { template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_iarchive_impl::load(char *s) { std::size_t size; @@ -41,7 +41,7 @@ text_iarchive_impl::load(char *s) } template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_iarchive_impl::load(std::string &s) { std::size_t size; @@ -60,7 +60,7 @@ text_iarchive_impl::load(std::string &s) #ifndef BOOST_NO_CWCHAR #ifndef BOOST_NO_INTRINSIC_WCHAR_T template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_iarchive_impl::load(wchar_t *ws) { std::size_t size; @@ -74,7 +74,7 @@ text_iarchive_impl::load(wchar_t *ws) #ifndef BOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_iarchive_impl::load(std::wstring &ws) { std::size_t size; @@ -93,19 +93,19 @@ text_iarchive_impl::load(std::wstring &ws) #endif // BOOST_NO_CWCHAR template -BOOST_ARCHIVE_DECL(void) -text_iarchive_impl::load_override(class_name_type & t, int){ - basic_text_iarchive::load_override(t, 0); +BOOST_ARCHIVE_DECL void +text_iarchive_impl::load_override(class_name_type & t){ + basic_text_iarchive::load_override(t); } template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_iarchive_impl::init(){ basic_text_iarchive::init(); } template -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL text_iarchive_impl::text_iarchive_impl( std::istream & is, unsigned int flags diff --git a/include/boost/archive/impl/text_oarchive_impl.ipp b/include/boost/archive/impl/text_oarchive_impl.ipp index 2df0b460..4ff488f4 100644 --- a/include/boost/archive/impl/text_oarchive_impl.ipp +++ b/include/boost/archive/impl/text_oarchive_impl.ipp @@ -38,7 +38,7 @@ namespace archive { // of template parameters used to create a text_oprimitive template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_oarchive_impl::save(const char * s) { const std::size_t len = std::ostream::traits_type::length(s); @@ -48,7 +48,7 @@ text_oarchive_impl::save(const char * s) } template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_oarchive_impl::save(const std::string &s) { const std::size_t size = s.size(); @@ -60,7 +60,7 @@ text_oarchive_impl::save(const std::string &s) #ifndef BOOST_NO_CWCHAR #ifndef BOOST_NO_INTRINSIC_WCHAR_T template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_oarchive_impl::save(const wchar_t * ws) { const std::size_t l = std::wcslen(ws); @@ -72,7 +72,7 @@ text_oarchive_impl::save(const wchar_t * ws) #ifndef BOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_oarchive_impl::save(const std::wstring &ws) { const std::size_t l = ws.size(); @@ -84,7 +84,7 @@ text_oarchive_impl::save(const std::wstring &ws) #endif // BOOST_NO_CWCHAR template -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL text_oarchive_impl::text_oarchive_impl( std::ostream & os, unsigned int flags @@ -104,7 +104,7 @@ text_oarchive_impl::text_oarchive_impl( } template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void text_oarchive_impl::save_binary(const void *address, std::size_t count){ put('\n'); this->end_preamble(); diff --git a/include/boost/archive/impl/text_wiarchive_impl.ipp b/include/boost/archive/impl/text_wiarchive_impl.ipp index 6938c226..12af2b9f 100644 --- a/include/boost/archive/impl/text_wiarchive_impl.ipp +++ b/include/boost/archive/impl/text_wiarchive_impl.ipp @@ -29,7 +29,7 @@ namespace archive { // implementation of wiprimtives functions // template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void text_wiarchive_impl::load(char *s) { std::size_t size; @@ -43,7 +43,7 @@ text_wiarchive_impl::load(char *s) } template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void text_wiarchive_impl::load(std::string &s) { std::size_t size; @@ -63,7 +63,7 @@ text_wiarchive_impl::load(std::string &s) #ifndef BOOST_NO_INTRINSIC_WCHAR_T template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void text_wiarchive_impl::load(wchar_t *s) { std::size_t size; @@ -78,7 +78,7 @@ text_wiarchive_impl::load(wchar_t *s) #ifndef BOOST_NO_STD_WSTRING template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void text_wiarchive_impl::load(std::wstring &ws) { std::size_t size; @@ -97,7 +97,7 @@ text_wiarchive_impl::load(std::wstring &ws) #endif template -BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_WARCHIVE_DECL text_wiarchive_impl::text_wiarchive_impl( std::wistream & is, unsigned int flags diff --git a/include/boost/archive/impl/text_woarchive_impl.ipp b/include/boost/archive/impl/text_woarchive_impl.ipp index 6683f528..2b6d427c 100644 --- a/include/boost/archive/impl/text_woarchive_impl.ipp +++ b/include/boost/archive/impl/text_woarchive_impl.ipp @@ -31,7 +31,7 @@ namespace archive { // implementation of woarchive functions // template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void text_woarchive_impl::save(const char *s) { // note: superfluous local variable fixes borland warning @@ -43,7 +43,7 @@ text_woarchive_impl::save(const char *s) } template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void text_woarchive_impl::save(const std::string &s) { const std::size_t size = s.size(); @@ -56,7 +56,7 @@ text_woarchive_impl::save(const std::string &s) #ifndef BOOST_NO_INTRINSIC_WCHAR_T template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void text_woarchive_impl::save(const wchar_t *ws) { const std::size_t size = std::wostream::traits_type::length(ws); @@ -68,7 +68,7 @@ text_woarchive_impl::save(const wchar_t *ws) #ifndef BOOST_NO_STD_WSTRING template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void text_woarchive_impl::save(const std::wstring &ws) { const std::size_t size = ws.length(); diff --git a/include/boost/archive/impl/xml_iarchive_impl.ipp b/include/boost/archive/impl/xml_iarchive_impl.ipp index 89e09818..7639ecb3 100644 --- a/include/boost/archive/impl/xml_iarchive_impl.ipp +++ b/include/boost/archive/impl/xml_iarchive_impl.ipp @@ -51,7 +51,7 @@ namespace archive { #ifndef BOOST_NO_CWCHAR #ifndef BOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void xml_iarchive_impl::load(std::wstring &ws){ std::string s; bool result = gimpl->parse_string(is, s); @@ -85,7 +85,7 @@ xml_iarchive_impl::load(std::wstring &ws){ #ifndef BOOST_NO_INTRINSIC_WCHAR_T template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void xml_iarchive_impl::load(wchar_t * ws){ std::string s; bool result = gimpl->parse_string(is, s); @@ -117,7 +117,7 @@ xml_iarchive_impl::load(wchar_t * ws){ #endif // BOOST_NO_CWCHAR template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void xml_iarchive_impl::load(std::string &s){ bool result = gimpl->parse_string(is, s); if(! result) @@ -127,7 +127,7 @@ xml_iarchive_impl::load(std::string &s){ } template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void xml_iarchive_impl::load(char * s){ std::string tstring; bool result = gimpl->parse_string(is, tstring); @@ -140,8 +140,8 @@ xml_iarchive_impl::load(char * s){ } template -BOOST_ARCHIVE_DECL(void) -xml_iarchive_impl::load_override(class_name_type & t, int){ +BOOST_ARCHIVE_DECL void +xml_iarchive_impl::load_override(class_name_type & t){ const std::string & s = gimpl->rv.class_name; if(s.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1) boost::serialization::throw_exception( @@ -153,7 +153,7 @@ xml_iarchive_impl::load_override(class_name_type & t, int){ } template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void xml_iarchive_impl::init(){ gimpl->init(is); this->set_library_version( @@ -162,7 +162,7 @@ xml_iarchive_impl::init(){ } template -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL xml_iarchive_impl::xml_iarchive_impl( std::istream &is_, unsigned int flags @@ -179,7 +179,7 @@ xml_iarchive_impl::xml_iarchive_impl( } template -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL xml_iarchive_impl::~xml_iarchive_impl(){ if(0 == (this->get_flags() & no_header)){ BOOST_TRY{ diff --git a/include/boost/archive/impl/xml_oarchive_impl.ipp b/include/boost/archive/impl/xml_oarchive_impl.ipp index ab1a2177..9e714f3c 100644 --- a/include/boost/archive/impl/xml_oarchive_impl.ipp +++ b/include/boost/archive/impl/xml_oarchive_impl.ipp @@ -42,15 +42,15 @@ void save_iterator(std::ostream &os, InputIterator begin, InputIterator end){ boost::archive::iterators::xml_escape > translator; std::copy( - translator(BOOST_MAKE_PFTO_WRAPPER(begin)), - translator(BOOST_MAKE_PFTO_WRAPPER(end)), + translator(begin), + translator(end), boost::archive::iterators::ostream_iterator(os) ); } #ifndef BOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void xml_oarchive_impl::save(const std::wstring & ws){ // at least one library doesn't typedef value_type for strings // so rather than using string directly make a pointer iterator out of it @@ -61,7 +61,7 @@ xml_oarchive_impl::save(const std::wstring & ws){ #ifndef BOOST_NO_INTRINSIC_WCHAR_T template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void xml_oarchive_impl::save(const wchar_t * ws){ save_iterator(os, ws, ws + std::wcslen(ws)); } @@ -70,7 +70,7 @@ xml_oarchive_impl::save(const wchar_t * ws){ #endif // BOOST_NO_CWCHAR template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void xml_oarchive_impl::save(const std::string & s){ // at least one library doesn't typedef value_type for strings // so rather than using string directly make a pointer iterator out of it @@ -78,27 +78,27 @@ xml_oarchive_impl::save(const std::string & s){ const char * > xml_escape_translator; std::copy( - xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s.data())), - xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s.data()+ s.size())), + xml_escape_translator(s.data()), + xml_escape_translator(s.data()+ s.size()), boost::archive::iterators::ostream_iterator(os) ); } template -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void xml_oarchive_impl::save(const char * s){ typedef boost::archive::iterators::xml_escape< const char * > xml_escape_translator; std::copy( - xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s)), - xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s + std::strlen(s))), + xml_escape_translator(s), + xml_escape_translator(s + std::strlen(s)), boost::archive::iterators::ostream_iterator(os) ); } template -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL xml_oarchive_impl::xml_oarchive_impl( std::ostream & os_, unsigned int flags diff --git a/include/boost/archive/impl/xml_wiarchive_impl.ipp b/include/boost/archive/impl/xml_wiarchive_impl.ipp index 257b5759..a837347e 100644 --- a/include/boost/archive/impl/xml_wiarchive_impl.ipp +++ b/include/boost/archive/impl/xml_wiarchive_impl.ipp @@ -28,7 +28,6 @@ namespace std{ #include #include -#include #include #include @@ -52,10 +51,10 @@ namespace { // anonymous void copy_to_ptr(char * s, const std::wstring & ws){ std::copy( iterators::mb_from_wchar( - BOOST_MAKE_PFTO_WRAPPER(ws.begin()) + ws.begin() ), iterators::mb_from_wchar( - BOOST_MAKE_PFTO_WRAPPER(ws.end()) + ws.end() ), s ); @@ -65,7 +64,7 @@ void copy_to_ptr(char * s, const std::wstring & ws){ } // anonymous template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void xml_wiarchive_impl::load(std::string & s){ std::wstring ws; bool result = gimpl->parse_string(is, ws); @@ -80,10 +79,10 @@ xml_wiarchive_impl::load(std::string & s){ s.reserve(ws.size()); std::copy( iterators::mb_from_wchar( - BOOST_MAKE_PFTO_WRAPPER(ws.begin()) + ws.begin() ), iterators::mb_from_wchar( - BOOST_MAKE_PFTO_WRAPPER(ws.end()) + ws.end() ), std::back_inserter(s) ); @@ -91,7 +90,7 @@ xml_wiarchive_impl::load(std::string & s){ #ifndef BOOST_NO_STD_WSTRING template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void xml_wiarchive_impl::load(std::wstring & ws){ bool result = gimpl->parse_string(is, ws); if(! result) @@ -102,7 +101,7 @@ xml_wiarchive_impl::load(std::wstring & ws){ #endif template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void xml_wiarchive_impl::load(char * s){ std::wstring ws; bool result = gimpl->parse_string(is, ws); @@ -115,7 +114,7 @@ xml_wiarchive_impl::load(char * s){ #ifndef BOOST_NO_INTRINSIC_WCHAR_T template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void xml_wiarchive_impl::load(wchar_t * ws){ std::wstring twstring; bool result = gimpl->parse_string(is, twstring); @@ -129,8 +128,8 @@ xml_wiarchive_impl::load(wchar_t * ws){ #endif template -BOOST_WARCHIVE_DECL(void) -xml_wiarchive_impl::load_override(class_name_type & t, int){ +BOOST_WARCHIVE_DECL void +xml_wiarchive_impl::load_override(class_name_type & t){ const std::wstring & ws = gimpl->rv.class_name; if(ws.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1) boost::serialization::throw_exception( @@ -140,7 +139,7 @@ xml_wiarchive_impl::load_override(class_name_type & t, int){ } template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void xml_wiarchive_impl::init(){ gimpl->init(is); this->set_library_version( @@ -149,7 +148,7 @@ xml_wiarchive_impl::init(){ } template -BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_WARCHIVE_DECL xml_wiarchive_impl::xml_wiarchive_impl( std::wistream &is_, unsigned int flags @@ -177,7 +176,7 @@ xml_wiarchive_impl::xml_wiarchive_impl( } template -BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_WARCHIVE_DECL xml_wiarchive_impl::~xml_wiarchive_impl(){ if(0 == (this->get_flags() & no_header)){ BOOST_TRY{ diff --git a/include/boost/archive/impl/xml_woarchive_impl.ipp b/include/boost/archive/impl/xml_woarchive_impl.ipp index 1e5139bc..d5586d51 100644 --- a/include/boost/archive/impl/xml_woarchive_impl.ipp +++ b/include/boost/archive/impl/xml_woarchive_impl.ipp @@ -52,14 +52,14 @@ void save_iterator(std::wostream &os, InputIterator begin, InputIterator end){ iterators::xml_escape > xmbtows; std::copy( - xmbtows(BOOST_MAKE_PFTO_WRAPPER(begin)), - xmbtows(BOOST_MAKE_PFTO_WRAPPER(end)), + xmbtows(begin), + xmbtows(end), boost::archive::iterators::ostream_iterator(os) ); } template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void xml_woarchive_impl::save(const std::string & s){ // note: we don't use s.begin() and s.end() because dinkumware // doesn't have string::value_type defined. So use a wrapper @@ -71,47 +71,47 @@ xml_woarchive_impl::save(const std::string & s){ #ifndef BOOST_NO_STD_WSTRING template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void xml_woarchive_impl::save(const std::wstring & ws){ #if 0 typedef iterators::xml_escape xmbtows; std::copy( - xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.begin())), - xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.end())), + xmbtows(ws.begin()), + xmbtows(ws.end()), boost::archive::iterators::ostream_iterator(os) ); #endif typedef iterators::xml_escape xmbtows; std::copy( - xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data())), - xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data() + ws.size())), + xmbtows(ws.data()), + xmbtows(ws.data() + ws.size()), boost::archive::iterators::ostream_iterator(os) ); } #endif //BOOST_NO_STD_WSTRING template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void xml_woarchive_impl::save(const char * s){ save_iterator(os, s, s + std::strlen(s)); } #ifndef BOOST_NO_INTRINSIC_WCHAR_T template -BOOST_WARCHIVE_DECL(void) +BOOST_WARCHIVE_DECL void xml_woarchive_impl::save(const wchar_t * ws){ os << ws; typedef iterators::xml_escape xmbtows; std::copy( - xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws)), - xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws + std::wcslen(ws))), + xmbtows(ws), + xmbtows(ws + std::wcslen(ws)), boost::archive::iterators::ostream_iterator(os) ); } #endif template -BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_WARCHIVE_DECL xml_woarchive_impl::xml_woarchive_impl( std::wostream & os_, unsigned int flags @@ -141,7 +141,7 @@ xml_woarchive_impl::xml_woarchive_impl( } template -BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_WARCHIVE_DECL xml_woarchive_impl::~xml_woarchive_impl(){ } diff --git a/include/boost/archive/iterators/base64_from_binary.hpp b/include/boost/archive/iterators/base64_from_binary.hpp index 836d93de..00c4e10c 100644 --- a/include/boost/archive/iterators/base64_from_binary.hpp +++ b/include/boost/archive/iterators/base64_from_binary.hpp @@ -25,8 +25,6 @@ namespace std{ } // namespace std #endif -#include - #include #include @@ -88,9 +86,9 @@ class base64_from_binary : public: // make composible buy using templated constructor template - base64_from_binary(BOOST_PFTO_WRAPPER(T) start) : + base64_from_binary(T start) : super_t( - Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))), + Base(static_cast< T >(start)), detail::from_6_bit() ) {} diff --git a/include/boost/archive/iterators/binary_from_base64.hpp b/include/boost/archive/iterators/binary_from_base64.hpp index 9d2c87eb..2eb78282 100644 --- a/include/boost/archive/iterators/binary_from_base64.hpp +++ b/include/boost/archive/iterators/binary_from_base64.hpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -96,9 +95,9 @@ class binary_from_base64 : public public: // make composible buy using templated constructor template - binary_from_base64(BOOST_PFTO_WRAPPER(T) start) : + binary_from_base64(T start) : super_t( - Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))), + Base(static_cast< T >(start)), detail::to_6_bit() ) {} diff --git a/include/boost/archive/iterators/insert_linebreaks.hpp b/include/boost/archive/iterators/insert_linebreaks.hpp index 7fbc79f1..2504b030 100644 --- a/include/boost/archive/iterators/insert_linebreaks.hpp +++ b/include/boost/archive/iterators/insert_linebreaks.hpp @@ -23,8 +23,6 @@ namespace std{ using ::memcpy; } #endif -#include - #include #include @@ -83,8 +81,8 @@ private: public: // make composible buy using templated constructor template - insert_linebreaks(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + insert_linebreaks(T start) : + super_t(Base(static_cast< T >(start))), m_count(0) {} // intel 7.1 doesn't like default copy constructor diff --git a/include/boost/archive/iterators/mb_from_wchar.hpp b/include/boost/archive/iterators/mb_from_wchar.hpp index 04e7c7e9..deb798f6 100644 --- a/include/boost/archive/iterators/mb_from_wchar.hpp +++ b/include/boost/archive/iterators/mb_from_wchar.hpp @@ -28,7 +28,6 @@ namespace std{ } // namespace std #endif -#include #include namespace boost { @@ -86,7 +85,7 @@ class mb_from_wchar wchar_t value = * this->base_reference(); #if (defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 3) \ || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 8)))) - m_bend = std::wcrtomb(m_buffer, value, 0); + m_bend = std::wcrtomb(m_buffer, value,0); #else m_bend = std::wctomb(m_buffer, value); #endif @@ -114,8 +113,8 @@ class mb_from_wchar public: // make composible buy using templated constructor template - mb_from_wchar(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + mb_from_wchar(T start) : + super_t(Base(static_cast< T >(start))), m_bend(0), m_bnext(0), m_full(false) diff --git a/include/boost/archive/iterators/remove_whitespace.hpp b/include/boost/archive/iterators/remove_whitespace.hpp index 43839870..c3580ab2 100644 --- a/include/boost/archive/iterators/remove_whitespace.hpp +++ b/include/boost/archive/iterators/remove_whitespace.hpp @@ -18,8 +18,6 @@ #include -#include - #include #include #include @@ -153,8 +151,8 @@ public: // remove_whitespace(){} // why is this needed? // make composible buy using templated constructor template - remove_whitespace(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) + remove_whitespace(T start) : + super_t(Base(static_cast< T >(start))) {} // intel 7.1 doesn't like default copy constructor remove_whitespace(const remove_whitespace & rhs) : diff --git a/include/boost/archive/iterators/transform_width.hpp b/include/boost/archive/iterators/transform_width.hpp index 15dd8dfc..d042560e 100644 --- a/include/boost/archive/iterators/transform_width.hpp +++ b/include/boost/archive/iterators/transform_width.hpp @@ -24,8 +24,6 @@ // character and 8 bit bytes. Lowest common multiple is 24 => 4 6 bit characters // or 3 8 bit characters -#include - #include #include @@ -110,8 +108,8 @@ class transform_width : public: // make composible buy using templated constructor template - transform_width(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + transform_width(T start) : + super_t(Base(static_cast< T >(start))), m_buffer_out_full(false), // To disable GCC warning, but not truly necessary //(m_buffer_in will be initialized later before being @@ -154,7 +152,7 @@ void transform_width::fill() { // append these bits to the next output // up to the size of the output - unsigned int i = std::min(missing_bits, m_remaining_bits); + unsigned int i = (std::min)(missing_bits, m_remaining_bits); // shift interesting bits to least significant position base_value_type j = m_buffer_in >> (m_remaining_bits - i); // and mask off the un interesting higher bits diff --git a/include/boost/archive/iterators/wchar_from_mb.hpp b/include/boost/archive/iterators/wchar_from_mb.hpp index ab81f17b..ad1d4cbb 100644 --- a/include/boost/archive/iterators/wchar_from_mb.hpp +++ b/include/boost/archive/iterators/wchar_from_mb.hpp @@ -30,7 +30,6 @@ namespace std{ #endif #include -#include #include #include @@ -89,8 +88,8 @@ class wchar_from_mb public: // make composible buy using templated constructor template - wchar_from_mb(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + wchar_from_mb(T start) : + super_t(Base(static_cast< T >(start))), m_full(false) {} // intel 7.1 doesn't like default copy constructor diff --git a/include/boost/archive/iterators/xml_escape.hpp b/include/boost/archive/iterators/xml_escape.hpp index a5d2c512..c838a73b 100644 --- a/include/boost/archive/iterators/xml_escape.hpp +++ b/include/boost/archive/iterators/xml_escape.hpp @@ -17,7 +17,6 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include #include namespace boost { @@ -40,8 +39,8 @@ public: wchar_t fill(const wchar_t * & bstart, const wchar_t * & bend); template - xml_escape(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) + xml_escape(T start) : + super_t(Base(static_cast< T >(start))) {} // intel 7.1 doesn't like default copy constructor xml_escape(const xml_escape & rhs) : diff --git a/include/boost/archive/iterators/xml_unescape.hpp b/include/boost/archive/iterators/xml_unescape.hpp index 69438ed0..69977404 100644 --- a/include/boost/archive/iterators/xml_unescape.hpp +++ b/include/boost/archive/iterators/xml_unescape.hpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -54,8 +53,8 @@ public: value_type drain(); template - xml_unescape(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) + xml_unescape(T start) : + super_t(Base(static_cast< T >(start))) {} // intel 7.1 doesn't like default copy constructor xml_unescape(const xml_unescape & rhs) : diff --git a/include/boost/archive/polymorphic_iarchive.hpp b/include/boost/archive/polymorphic_iarchive.hpp index 50488a33..7f19410d 100644 --- a/include/boost/archive/polymorphic_iarchive.hpp +++ b/include/boost/archive/polymorphic_iarchive.hpp @@ -29,7 +29,6 @@ namespace std{ #include -#include #include #include #include @@ -44,13 +43,13 @@ namespace serialization { } // namespace serialization namespace archive { namespace detail { - class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; - class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; + class BOOST_ARCHIVE_DECL basic_iarchive; + class BOOST_ARCHIVE_DECL basic_iarchive; } class polymorphic_iarchive; -class polymorphic_iarchive_impl : +class BOOST_SYMBOL_VISIBLE polymorphic_iarchive_impl : public detail::interface_iarchive { #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS @@ -98,22 +97,19 @@ public: virtual void load_start(const char * name) = 0; virtual void load_end(const char * name) = 0; virtual void register_basic_serializer(const detail::basic_iserializer & bis) = 0; + virtual detail::helper_collection & get_helper_collection() = 0; // msvc and borland won't automatically pass these to the base class so // make it explicit here template - void load_override(T & t, BOOST_PFTO int) + void load_override(T & t) { archive::load(* this->This(), t); } // special treatment for name-value pairs. template void load_override( - #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - const - #endif - boost::serialization::nvp< T > & t, - int + const boost::serialization::nvp< T > & t ){ load_start(t.name()); archive::load(* this->This(), t.value()); @@ -156,7 +152,7 @@ public: namespace boost { namespace archive { -class polymorphic_iarchive : +class BOOST_SYMBOL_VISIBLE polymorphic_iarchive : public polymorphic_iarchive_impl { public: diff --git a/include/boost/archive/polymorphic_oarchive.hpp b/include/boost/archive/polymorphic_oarchive.hpp index 1eb9e0b4..aa30b2ac 100644 --- a/include/boost/archive/polymorphic_oarchive.hpp +++ b/include/boost/archive/polymorphic_oarchive.hpp @@ -28,7 +28,6 @@ namespace std{ #endif #include -#include #include #include #include @@ -43,13 +42,13 @@ namespace serialization { } // namespace serialization namespace archive { namespace detail { - class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive; - class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; + class BOOST_ARCHIVE_DECL basic_oarchive; + class BOOST_ARCHIVE_DECL basic_oserializer; } class polymorphic_oarchive; -class polymorphic_oarchive_impl : +class BOOST_SYMBOL_VISIBLE polymorphic_oarchive_impl : public detail::interface_oarchive { #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS @@ -98,23 +97,21 @@ public: virtual void save_start(const char * name) = 0; virtual void save_end(const char * name) = 0; virtual void register_basic_serializer(const detail::basic_oserializer & bos) = 0; + virtual detail::helper_collection & get_helper_collection() = 0; virtual void end_preamble() = 0; // msvc and borland won't automatically pass these to the base class so // make it explicit here template - void save_override(T & t, BOOST_PFTO int) + void save_override(T & t) { archive::save(* this->This(), t); } // special treatment for name-value pairs. template void save_override( - #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - const - #endif - ::boost::serialization::nvp< T > & t, int + const ::boost::serialization::nvp< T > & t ){ save_start(t.name()); archive::save(* this->This(), t.const_value()); @@ -139,7 +136,7 @@ public: }; // note: preserve naming symmetry -class polymorphic_oarchive : +class BOOST_SYMBOL_VISIBLE polymorphic_oarchive : public polymorphic_oarchive_impl { public: diff --git a/include/boost/archive/text_iarchive.hpp b/include/boost/archive/text_iarchive.hpp index 1fd0f608..e40db837 100644 --- a/include/boost/archive/text_iarchive.hpp +++ b/include/boost/archive/text_iarchive.hpp @@ -40,7 +40,7 @@ namespace detail { } // namespace detail template -class text_iarchive_impl : +class BOOST_SYMBOL_VISIBLE text_iarchive_impl : public basic_text_iprimitive, public basic_text_iarchive { @@ -72,33 +72,30 @@ protected: load(v); t = boost::serialization::item_version_type(v); } - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void load(char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void load(wchar_t * t); #endif - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void load(std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void load(std::wstring &ws); #endif - // note: the following should not needed - but one compiler (vc 7.1) - // fails to compile one test (test_shared_ptr) without it !!! - // make this protected so it can be called from a derived archive template - void load_override(T & t, BOOST_PFTO int){ - basic_text_iarchive::load_override(t, 0); + void load_override(T & t){ + basic_text_iarchive::load_override(t); } - BOOST_ARCHIVE_DECL(void) - load_override(class_name_type & t, int); - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void + load_override(class_name_type & t); + BOOST_ARCHIVE_DECL void init(); - BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_DECL text_iarchive_impl(std::istream & is, unsigned int flags); // don't import inline definitions! leave this as a reminder. - //BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + //BOOST_ARCHIVE_DECL ~text_iarchive_impl(){}; }; @@ -119,7 +116,7 @@ protected: namespace boost { namespace archive { -class text_iarchive : +class BOOST_SYMBOL_VISIBLE text_iarchive : public text_iarchive_impl{ public: text_iarchive(std::istream & is_, unsigned int flags = 0) : diff --git a/include/boost/archive/text_oarchive.hpp b/include/boost/archive/text_oarchive.hpp index 9fd63a9b..7eaea172 100644 --- a/include/boost/archive/text_oarchive.hpp +++ b/include/boost/archive/text_oarchive.hpp @@ -47,7 +47,7 @@ namespace detail { } // namespace detail template -class text_oarchive_impl : +class BOOST_SYMBOL_VISIBLE text_oarchive_impl : /* protected ? */ public basic_text_oprimitive, public basic_text_oarchive { @@ -78,32 +78,32 @@ protected: void save(const boost::serialization::item_version_type & t){ save(static_cast(t)); } - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void save(const char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void save(const wchar_t * t); #endif - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void save(const std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void save(const std::wstring &ws); #endif - BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_DECL text_oarchive_impl(std::ostream & os, unsigned int flags); // don't import inline definitions! leave this as a reminder. - //BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + //BOOST_ARCHIVE_DECL ~text_oarchive_impl(){}; public: - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void save_binary(const void *address, std::size_t count); }; // do not derive from this class. If you want to extend this functionality // via inhertance, derived from text_oarchive_impl instead. This will // preserve correct static polymorphism. -class text_oarchive : +class BOOST_SYMBOL_VISIBLE text_oarchive : public text_oarchive_impl { public: diff --git a/include/boost/archive/text_wiarchive.hpp b/include/boost/archive/text_wiarchive.hpp index 5105d351..3adf068a 100644 --- a/include/boost/archive/text_wiarchive.hpp +++ b/include/boost/archive/text_wiarchive.hpp @@ -44,7 +44,7 @@ namespace detail { } // namespace detail template -class text_wiarchive_impl : +class BOOST_SYMBOL_VISIBLE text_wiarchive_impl : public basic_text_iprimitive, public basic_text_iarchive { @@ -76,25 +76,23 @@ protected: load(v); t = boost::serialization::item_version_type(v); } - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void load(char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void load(wchar_t * t); #endif - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void load(std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void load(std::wstring &ws); #endif - // note: the following should not needed - but one compiler (vc 7.1) - // fails to compile one test (test_shared_ptr) without it !!! template - void load_override(T & t, BOOST_PFTO int){ - basic_text_iarchive::load_override(t, 0); + void load_override(T & t){ + basic_text_iarchive::load_override(t); } - BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_WARCHIVE_DECL text_wiarchive_impl(std::wistream & is, unsigned int flags); ~text_wiarchive_impl(){}; }; @@ -116,7 +114,7 @@ protected: namespace boost { namespace archive { -class text_wiarchive : +class BOOST_SYMBOL_VISIBLE text_wiarchive : public text_wiarchive_impl{ public: text_wiarchive(std::wistream & is, unsigned int flags = 0) : diff --git a/include/boost/archive/text_woarchive.hpp b/include/boost/archive/text_woarchive.hpp index 2f75204d..b6b4f8ed 100644 --- a/include/boost/archive/text_woarchive.hpp +++ b/include/boost/archive/text_woarchive.hpp @@ -52,7 +52,7 @@ namespace detail { } // namespace detail template -class text_woarchive_impl : +class BOOST_SYMBOL_VISIBLE text_woarchive_impl : public basic_text_oprimitive, public basic_text_oarchive { @@ -83,16 +83,16 @@ protected: void save(const boost::serialization::item_version_type & t){ save(static_cast(t)); } - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void save(const char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void save(const wchar_t * t); #endif - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void save(const std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void save(const std::wstring &ws); #endif text_woarchive_impl(std::wostream & os, unsigned int flags) : @@ -129,7 +129,7 @@ public: // do not derive from this class. If you want to extend this functionality // via inhertance, derived from text_oarchive_impl instead. This will // preserve correct static polymorphism. -class text_woarchive : +class BOOST_SYMBOL_VISIBLE text_woarchive : public text_woarchive_impl { public: diff --git a/include/boost/archive/xml_archive_exception.hpp b/include/boost/archive/xml_archive_exception.hpp index 622cafea..b07f9a0c 100644 --- a/include/boost/archive/xml_archive_exception.hpp +++ b/include/boost/archive/xml_archive_exception.hpp @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -32,7 +31,7 @@ namespace archive { ////////////////////////////////////////////////////////////////////// // exceptions thrown by xml archives // -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) xml_archive_exception : +class BOOST_SYMBOL_VISIBLE xml_archive_exception : public virtual boost::archive::archive_exception { public: @@ -41,7 +40,7 @@ public: xml_archive_tag_mismatch, xml_archive_tag_name_error } exception_code; - xml_archive_exception( + BOOST_ARCHIVE_DECL xml_archive_exception( exception_code c, const char * e1 = NULL, const char * e2 = NULL diff --git a/include/boost/archive/xml_iarchive.hpp b/include/boost/archive/xml_iarchive.hpp index ecaeeebe..055ba0f4 100644 --- a/include/boost/archive/xml_iarchive.hpp +++ b/include/boost/archive/xml_iarchive.hpp @@ -44,7 +44,7 @@ class basic_xml_grammar; typedef basic_xml_grammar xml_grammar; template -class xml_iarchive_impl : +class BOOST_SYMBOL_VISIBLE xml_iarchive_impl : public basic_text_iprimitive, public basic_xml_iarchive { @@ -86,29 +86,29 @@ protected: load(v); t = boost::serialization::item_version_type(v); } - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void load(char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void load(wchar_t * t); #endif - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void load(std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void load(std::wstring &ws); #endif template - void load_override(T & t, BOOST_PFTO int){ - basic_xml_iarchive::load_override(t, 0); + void load_override(T & t){ + basic_xml_iarchive::load_override(t); } - BOOST_ARCHIVE_DECL(void) - load_override(class_name_type & t, int); - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void + load_override(class_name_type & t); + BOOST_ARCHIVE_DECL void init(); - BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_DECL xml_iarchive_impl(std::istream & is, unsigned int flags); - BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_DECL ~xml_iarchive_impl(); }; @@ -128,7 +128,7 @@ protected: namespace boost { namespace archive { -class xml_iarchive : +class BOOST_SYMBOL_VISIBLE xml_iarchive : public xml_iarchive_impl{ public: xml_iarchive(std::istream & is, unsigned int flags = 0) : diff --git a/include/boost/archive/xml_oarchive.hpp b/include/boost/archive/xml_oarchive.hpp index 2ac4ae1d..c5e6da92 100644 --- a/include/boost/archive/xml_oarchive.hpp +++ b/include/boost/archive/xml_oarchive.hpp @@ -47,7 +47,7 @@ namespace detail { } // namespace detail template -class xml_oarchive_impl : +class BOOST_SYMBOL_VISIBLE xml_oarchive_impl : public basic_text_oprimitive, public basic_xml_oarchive { @@ -82,19 +82,19 @@ protected: save(const boost::serialization::item_version_type & t){ save(static_cast(t)); } - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void save(const char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void save(const wchar_t * t); #endif - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void save(const std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void save(const std::wstring &ws); #endif - BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_DECL xml_oarchive_impl(std::ostream & os, unsigned int flags); ~xml_oarchive_impl(){} public: @@ -118,7 +118,7 @@ public: // do not derive from this class. If you want to extend this functionality // via inhertance, derived from xml_oarchive_impl instead. This will // preserve correct static polymorphism. -class xml_oarchive : +class BOOST_SYMBOL_VISIBLE xml_oarchive : public xml_oarchive_impl { public: diff --git a/include/boost/archive/xml_wiarchive.hpp b/include/boost/archive/xml_wiarchive.hpp index a1baa1f8..dbc2d721 100644 --- a/include/boost/archive/xml_wiarchive.hpp +++ b/include/boost/archive/xml_wiarchive.hpp @@ -58,7 +58,7 @@ class basic_xml_grammar; typedef basic_xml_grammar xml_wgrammar; template -class xml_wiarchive_impl : +class BOOST_SYMBOL_VISIBLE xml_wiarchive_impl : public basic_text_iprimitive, public basic_xml_iarchive { @@ -99,29 +99,29 @@ protected: load(v); t = boost::serialization::item_version_type(v); } - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void load(char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void load(wchar_t * t); #endif - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void load(std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void load(std::wstring &ws); #endif template - void load_override(T & t, BOOST_PFTO int){ - basic_xml_iarchive::load_override(t, 0); + void load_override(T & t){ + basic_xml_iarchive::load_override(t); } - BOOST_WARCHIVE_DECL(void) - load_override(class_name_type & t, int); - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void + load_override(class_name_type & t); + BOOST_WARCHIVE_DECL void init(); - BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_WARCHIVE_DECL xml_wiarchive_impl(std::wistream & is, unsigned int flags) ; - BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_WARCHIVE_DECL ~xml_wiarchive_impl(); }; @@ -142,7 +142,7 @@ protected: namespace boost { namespace archive { -class xml_wiarchive : +class BOOST_SYMBOL_VISIBLE xml_wiarchive : public xml_wiarchive_impl{ public: xml_wiarchive(std::wistream & is, unsigned int flags = 0) : diff --git a/include/boost/archive/xml_woarchive.hpp b/include/boost/archive/xml_woarchive.hpp index 338bf748..62700162 100644 --- a/include/boost/archive/xml_woarchive.hpp +++ b/include/boost/archive/xml_woarchive.hpp @@ -61,7 +61,7 @@ namespace detail { } // namespace detail template -class xml_woarchive_impl : +class BOOST_SYMBOL_VISIBLE xml_woarchive_impl : public basic_text_oprimitive, public basic_xml_oarchive { @@ -97,21 +97,21 @@ protected: save(const boost::serialization::item_version_type & t){ save(static_cast(t)); } - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void save(const char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void save(const wchar_t * t); #endif - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void save(const std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL void save(const std::wstring &ws); #endif - BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_WARCHIVE_DECL xml_woarchive_impl(std::wostream & os, unsigned int flags); - BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_WARCHIVE_DECL ~xml_woarchive_impl(); public: void @@ -135,7 +135,7 @@ public: // do not derive from this class. If you want to extend this functionality // via inhertance, derived from xml_woarchive_impl instead. This will // preserve correct static polymorphism. -class xml_woarchive : +class BOOST_SYMBOL_VISIBLE xml_woarchive : public xml_woarchive_impl { public: diff --git a/include/boost/serialization/access.hpp b/include/boost/serialization/access.hpp index ec88ff5a..f6581acc 100644 --- a/include/boost/serialization/access.hpp +++ b/include/boost/serialization/access.hpp @@ -18,8 +18,6 @@ #include -#include - namespace boost { namespace archive { @@ -66,19 +64,19 @@ public: friend inline void serialize( Archive & ar, T & t, - const BOOST_PFTO unsigned int file_version + const unsigned int file_version ); template friend inline void save_construct_data( Archive & ar, const T * t, - const BOOST_PFTO unsigned int file_version + const unsigned int file_version ); template friend inline void load_construct_data( Archive & ar, T * t, - const BOOST_PFTO unsigned int file_version + const unsigned int file_version ); #endif diff --git a/include/boost/serialization/array.hpp b/include/boost/serialization/array.hpp index 35c640ce..97ac0c25 100644 --- a/include/boost/serialization/array.hpp +++ b/include/boost/serialization/array.hpp @@ -33,17 +33,8 @@ namespace boost { namespace serialization { // traits to specify whether to use an optimized array serialization -#ifdef __BORLANDC__ -// workaround for Borland compiler -template -struct use_array_optimization { - template struct apply : boost::mpl::false_ {}; -}; - -#else template struct use_array_optimization : boost::mpl::always {}; -#endif template class array : @@ -125,10 +116,7 @@ private: template inline -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -const -#endif -array< T > make_array( T* t, std::size_t s){ +const array< T > make_array( T* t, std::size_t s){ return array< T >(t, s); } @@ -154,10 +142,6 @@ void serialize(Archive& ar, std::array& a, const unsigned int /* version */ } } // end namespace boost::serialization -#ifdef __BORLANDC__ -// ignore optimizations for Borland -#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive) -#else #define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive) \ namespace boost { namespace serialization { \ template <> struct use_array_optimization { \ @@ -166,6 +150,5 @@ template <> struct use_array_optimization { \ , typename boost::remove_const::type \ >::type {}; \ }; }} -#endif // __BORLANDC__ #endif //BOOST_SERIALIZATION_ARRAY_HPP diff --git a/include/boost/serialization/base_object.hpp b/include/boost/serialization/base_object.hpp index 562dbd50..7ede6473 100644 --- a/include/boost/serialization/base_object.hpp +++ b/include/boost/serialization/base_object.hpp @@ -84,16 +84,6 @@ namespace detail }; } // namespace detail -#if defined(__BORLANDC__) && __BORLANDC__ < 0x610 -template -const Base & -base_object(const Derived & d) -{ - BOOST_STATIC_ASSERT(! is_pointer::value); - detail::base_register::invoke(); - return access::cast_reference(d); -} -#else template typename detail::base_cast::type & base_object(Derived &d) @@ -104,7 +94,6 @@ base_object(Derived &d) detail::base_register::invoke(); return access::cast_reference(d); } -#endif } // namespace serialization } // namespace boost diff --git a/include/boost/serialization/binary_object.hpp b/include/boost/serialization/binary_object.hpp index 7e230768..23c734be 100644 --- a/include/boost/serialization/binary_object.hpp +++ b/include/boost/serialization/binary_object.hpp @@ -68,10 +68,7 @@ struct binary_object : // just a little helper to support the convention that all serialization // wrappers follow the naming convention make_xxxxx inline -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -const -#endif -binary_object +const binary_object make_binary_object(/* const */ void * t, std::size_t size){ return binary_object(t, size); } diff --git a/include/boost/serialization/collections_load_imp.hpp b/include/boost/serialization/collections_load_imp.hpp index 2291e742..246b64ed 100644 --- a/include/boost/serialization/collections_load_imp.hpp +++ b/include/boost/serialization/collections_load_imp.hpp @@ -38,6 +38,8 @@ namespace std{ #include #include #include +#include +#include namespace boost{ namespace serialization { @@ -47,118 +49,55 @@ namespace stl { // implementation of serialization for STL containers // -// sequential container input -template -struct archive_input_seq -{ - inline typename Container::iterator - operator()( - Archive &ar, - Container &s, - const unsigned int v, - typename Container::iterator hint - ){ - typedef typename Container::value_type type; - detail::stack_construct t(ar, v); - // borland fails silently w/o full namespace - ar >> boost::serialization::make_nvp("item", t.reference()); - s.push_back(t.reference()); - ar.reset_object_address(& s.back() , & t.reference()); - return hint; - } -}; - -// map input -template -struct archive_input_map -{ - inline typename Container::iterator - operator()( - Archive &ar, - Container &s, - const unsigned int v, - typename Container::iterator hint - ){ - typedef typename Container::value_type type; - detail::stack_construct t(ar, v); - // borland fails silently w/o full namespace - ar >> boost::serialization::make_nvp("item", t.reference()); - typename Container::iterator result = - s.insert(hint, t.reference()); - // note: the following presumes that the map::value_type was NOT tracked - // in the archive. This is the usual case, but here there is no way - // to determine that. - ar.reset_object_address( - & (result->second), - & t.reference().second - ); - return result; - } -}; - -// set input -template -struct archive_input_set -{ - inline typename Container::iterator - operator()( - Archive &ar, - Container &s, - const unsigned int v, - typename Container::iterator hint - ){ - typedef typename Container::value_type type; - detail::stack_construct t(ar, v); - // borland fails silently w/o full namespace - ar >> boost::serialization::make_nvp("item", t.reference()); - typename Container::iterator result = - s.insert(hint, t.reference()); - ar.reset_object_address(& (* result), & t.reference()); - return result; - } -}; - -template -class reserve_imp -{ -public: - void operator()(Container &s, std::size_t count) const { - s.reserve(count); - } -}; - -template -class no_reserve_imp -{ -public: - void operator()(Container & /* s */, std::size_t /* count */) const{} -}; - -template -inline void load_collection(Archive & ar, Container &s) -{ - s.clear(); - const boost::archive::library_version_type library_version( - ar.get_library_version() - ); - // retrieve number of elements - item_version_type item_version(0); - collection_size_type count; - ar >> BOOST_SERIALIZATION_NVP(count); - if(boost::archive::library_version_type(3) < library_version){ - ar >> BOOST_SERIALIZATION_NVP(item_version); - } - - R rx; - rx(s, count); - InputFunction ifunc; - typename Container::iterator hint; - hint = s.begin(); +template< + class Archive, + class T +> +typename boost::enable_if< + typename detail::is_default_constructible< + typename T::value_type + >, + void +>::type +collection_load_impl( + Archive & ar, + T & t, + collection_size_type count, + item_version_type item_version +){ + t.resize(count); + typename T::iterator hint; + hint = t.begin(); while(count-- > 0){ - hint = ifunc(ar, s, item_version, hint); + ar >> boost::serialization::make_nvp("item", *hint++); } } +template< + class Archive, + class T +> +typename boost::disable_if< + typename detail::is_default_constructible< + typename T::value_type + >, + void +>::type +collection_load_impl( + Archive & ar, + T & t, + collection_size_type count, + item_version_type item_version +){ + t.clear(); + while(count-- > 0){ + detail::stack_construct u(ar, item_version); + ar >> boost::serialization::make_nvp("item", u.reference()); + t.push_back(u.reference()); + ar.reset_object_address(& t.back() , & u.reference()); + } +} + } // namespace stl } // namespace serialization } // namespace boost diff --git a/include/boost/serialization/config.hpp b/include/boost/serialization/config.hpp index ce586a7d..ea8cb923 100644 --- a/include/boost/serialization/config.hpp +++ b/include/boost/serialization/config.hpp @@ -17,7 +17,6 @@ #include #include -#include // note: this version incorporates the related code into the the // the same library as BOOST_ARCHIVE. This could change some day in the @@ -28,7 +27,6 @@ #undef BOOST_SERIALIZATION_DECL #endif -#ifdef BOOST_HAS_DECLSPEC // defined in config system // we need to import/export our code only if the user has specifically // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost // libraries to be dynamically linked, or BOOST_SERIALIZATION_DYN_LINK @@ -39,24 +37,15 @@ #endif // export if this is our own source, otherwise import: #if defined(BOOST_SERIALIZATION_SOURCE) - #if defined(__BORLANDC__) - #define BOOST_SERIALIZATION_DECL(T) T __export - #else - #define BOOST_SERIALIZATION_DECL(T) __declspec(dllexport) T - #endif + #define BOOST_SERIALIZATION_DECL BOOST_SYMBOL_EXPORT #else - #if defined(__BORLANDC__) - #define BOOST_SERIALIZATION_DECL(T) T __import - #else - #define BOOST_SERIALIZATION_DECL(T) __declspec(dllimport) T - #endif + #define BOOST_SERIALIZATION_DECL BOOST_SYMBOL_IMPORT #endif // defined(BOOST_SERIALIZATION_SOURCE) #endif // defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK) -#endif // BOOST_HAS_DECLSPEC // if BOOST_SERIALIZATION_DECL isn't defined yet define it now: #ifndef BOOST_SERIALIZATION_DECL - #define BOOST_SERIALIZATION_DECL(T) T + #define BOOST_SERIALIZATION_DECL #endif // enable automatic library variant selection ------------------------------// diff --git a/include/boost/serialization/deque.hpp b/include/boost/serialization/deque.hpp index e182f7b6..f4b58c32 100644 --- a/include/boost/serialization/deque.hpp +++ b/include/boost/serialization/deque.hpp @@ -21,8 +21,8 @@ #include #include +#include #include -#include #include namespace boost { @@ -43,7 +43,7 @@ template inline void load( Archive & ar, std::deque &t, - const unsigned int /*file_version*/ + const unsigned int /* file_version */ ){ const boost::archive::library_version_type library_version( ar.get_library_version() @@ -55,23 +55,7 @@ inline void load( if(boost::archive::library_version_type(3) < library_version){ ar >> BOOST_SERIALIZATION_NVP(item_version); } - if(detail::is_default_constructible()){ - t.resize(count); - typename std::deque::iterator hint; - hint = t.begin(); - while(count-- > 0){ - ar >> boost::serialization::make_nvp("item", *hint++); - } - } - else{ - t.clear(); - while(count-- > 0){ - detail::stack_construct u(ar, item_version); - ar >> boost::serialization::make_nvp("item", u.reference()); - t.push_back(u.reference()); - ar.reset_object_address(& t.back() , & u.reference()); - } - } + stl::collection_load_impl(ar, t, count, item_version); } // split non-intrusive serialization function member into separate diff --git a/include/boost/serialization/detail/is_default_constructible.hpp b/include/boost/serialization/detail/is_default_constructible.hpp index d928e693..451cca4d 100644 --- a/include/boost/serialization/detail/is_default_constructible.hpp +++ b/include/boost/serialization/detail/is_default_constructible.hpp @@ -16,7 +16,10 @@ // See http://www.boost.org for updates, documentation, and revision history. -#ifndef BOOST_NO_CXX11_HDR_TYPE_TRAITS +#include + +#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 1101) \ +|| ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) #include namespace boost{ namespace serialization { diff --git a/include/boost/serialization/detail/shared_count_132.hpp b/include/boost/serialization/detail/shared_count_132.hpp index a63e4884..a5872557 100644 --- a/include/boost/serialization/detail/shared_count_132.hpp +++ b/include/boost/serialization/detail/shared_count_132.hpp @@ -45,11 +45,6 @@ namespace std{ } // namespace std #endif -#ifdef __BORLANDC__ -# pragma warn -8026 // Functions with excep. spec. are not expanded inline -# pragma warn -8027 // Functions containing try are not expanded inline -#endif - namespace boost_132 { // Debug hooks @@ -71,10 +66,6 @@ void sp_array_destructor_hook(void * px); // Hence, the temporary #pragma option -pc below. The version // check is deliberately conservative. -#if defined(__BORLANDC__) && __BORLANDC__ == 0x551 -# pragma option push -pc -#endif - class bad_weak_ptr: public std::exception { public: @@ -85,10 +76,6 @@ public: } }; -#if defined(__BORLANDC__) && __BORLANDC__ == 0x551 -# pragma option pop -#endif - namespace detail{ class sp_counted_base @@ -201,12 +188,12 @@ public: #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) -template void cbi_call_constructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &, int) +template void cbi_call_constructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &) { boost::sp_scalar_constructor_hook(px, sizeof(T), pn); } -template void cbi_call_constructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &, int) +template void cbi_call_constructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &) { boost::sp_array_constructor_hook(px); } @@ -215,12 +202,12 @@ template void cbi_call_constructor_hook(sp_counted_base *, P c { } -template void cbi_call_destructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &, int) +template void cbi_call_destructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &) { boost::sp_scalar_destructor_hook(px, sizeof(T), pn); } -template void cbi_call_destructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &, int) +template void cbi_call_destructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &) { boost::sp_array_destructor_hook(px); } @@ -561,9 +548,4 @@ inline shared_count::shared_count(weak_count const & r): pi_(r.pi_) BOOST_SERIALIZATION_ASSUME_ABSTRACT(boost_132::detail::sp_counted_base) -#ifdef __BORLANDC__ -# pragma warn .8027 // Functions containing try are not expanded inline -# pragma warn .8026 // Functions with excep. spec. are not expanded inline -#endif - #endif // #ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED diff --git a/include/boost/serialization/detail/shared_ptr_132.hpp b/include/boost/serialization/detail/shared_ptr_132.hpp index 969b53a7..ee98b7b9 100644 --- a/include/boost/serialization/detail/shared_ptr_132.hpp +++ b/include/boost/serialization/detail/shared_ptr_132.hpp @@ -120,13 +120,8 @@ public: { } -#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x564) ) template explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter()) // Y must be complete -#else - template - explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter()) // Y must be complete -#endif { detail::sp_enable_shared_from_this( pn, p, p ); } @@ -145,15 +140,13 @@ public: // generated copy constructor, assignment, destructor are fine... // except that Borland C++ has a bug, and g++ with -Wsynth warns -#if defined(__BORLANDC__) || defined(__GNUC__) - +#if defined(__GNUC__) shared_ptr & operator=(shared_ptr const & r) // never throws { px = r.px; pn = r.pn; // shared_count::op= doesn't throw return *this; } - #endif template diff --git a/include/boost/serialization/detail/stack_constructor.hpp b/include/boost/serialization/detail/stack_constructor.hpp index 70a80296..9027717a 100644 --- a/include/boost/serialization/detail/stack_constructor.hpp +++ b/include/boost/serialization/detail/stack_constructor.hpp @@ -36,11 +36,7 @@ struct stack_allocate private: typedef typename boost::aligned_storage< sizeof(T), - #if BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560)) - 8 - #else - boost::alignment_of::value - #endif + boost::alignment_of::value > type; type storage_; }; diff --git a/include/boost/serialization/ephemeral.hpp b/include/boost/serialization/ephemeral.hpp index b913fef0..09e50161 100644 --- a/include/boost/serialization/ephemeral.hpp +++ b/include/boost/serialization/ephemeral.hpp @@ -63,10 +63,7 @@ private: template inline -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -const -#endif -ephemeral_object ephemeral(const char * name, T & t){ +const ephemeral_object ephemeral(const char * name, T & t){ return ephemeral_object(name, t); } diff --git a/include/boost/serialization/export.hpp b/include/boost/serialization/export.hpp index 99354782..9da9434a 100644 --- a/include/boost/serialization/export.hpp +++ b/include/boost/serialization/export.hpp @@ -86,9 +86,6 @@ struct ptr_serialization_support { # if defined(BOOST_MSVC) || defined(__SUNPRO_CC) virtual BOOST_DLLEXPORT void instantiate() BOOST_USED; -# elif defined(__BORLANDC__) - static BOOST_DLLEXPORT void instantiate() BOOST_USED; - enum { x = sizeof(instantiate(),3) }; # else static BOOST_DLLEXPORT void instantiate() BOOST_USED; typedef instantiate_function< @@ -102,17 +99,11 @@ BOOST_DLLEXPORT void ptr_serialization_support::instantiate() { export_impl::enable_save( - #if ! defined(__BORLANDC__) - typename - #endif - Archive::is_saving() + typename Archive::is_saving() ); export_impl::enable_load( - #if ! defined(__BORLANDC__) - typename - #endif - Archive::is_loading() + typename Archive::is_loading() ); } diff --git a/include/boost/serialization/extended_type_info.hpp b/include/boost/serialization/extended_type_info.hpp index d4b57afa..c96a576e 100644 --- a/include/boost/serialization/extended_type_info.hpp +++ b/include/boost/serialization/extended_type_info.hpp @@ -41,7 +41,7 @@ namespace void_cast_detail{ class void_caster; } -class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info : +class BOOST_SYMBOL_VISIBLE extended_type_info : private boost::noncopyable { private: @@ -56,12 +56,12 @@ private: const char * m_key; protected: - void key_unregister() const; - void key_register() const; + BOOST_SERIALIZATION_DECL void key_unregister() const; + BOOST_SERIALIZATION_DECL void key_register() const; // this class can't be used as is. It's just the // common functionality for all type_info replacement // systems. Hence, make these protected - extended_type_info( + BOOST_SERIALIZATION_DECL extended_type_info( const unsigned int type_info_key, const char * key ); @@ -69,20 +69,20 @@ protected: #if defined(__GNUC__) virtual #endif - ~extended_type_info(); + BOOST_SERIALIZATION_DECL ~extended_type_info(); public: const char * get_key() const { return m_key; } virtual const char * get_debug_info() const = 0; - bool operator<(const extended_type_info &rhs) const; - bool operator==(const extended_type_info &rhs) const; + BOOST_SERIALIZATION_DECL bool operator<(const extended_type_info &rhs) const; + BOOST_SERIALIZATION_DECL bool operator==(const extended_type_info &rhs) const; bool operator!=(const extended_type_info &rhs) const { return !(operator==(rhs)); } // note explicit "export" of static function to work around // gcc 4.5 mingw error - static const extended_type_info * + static BOOST_SERIALIZATION_DECL const extended_type_info * find(const char *key); // for plugins virtual void * construct(unsigned int /*count*/ = 0, ...) const = 0; diff --git a/include/boost/serialization/extended_type_info_no_rtti.hpp b/include/boost/serialization/extended_type_info_no_rtti.hpp index 62b24738..aaa8b444 100644 --- a/include/boost/serialization/extended_type_info_no_rtti.hpp +++ b/include/boost/serialization/extended_type_info_no_rtti.hpp @@ -52,16 +52,16 @@ namespace no_rtti_system { // common base class to share type_info_key. This is used to // identify the method used to keep track of the extended type -class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info_no_rtti_0 : +class BOOST_SYMBOL_VISIBLE extended_type_info_no_rtti_0 : public extended_type_info { protected: - extended_type_info_no_rtti_0(const char * key); - ~extended_type_info_no_rtti_0(); + BOOST_SERIALIZATION_DECL extended_type_info_no_rtti_0(const char * key); + BOOST_SERIALIZATION_DECL ~extended_type_info_no_rtti_0(); public: - virtual bool + virtual BOOST_SERIALIZATION_DECL bool is_less_than(const boost::serialization::extended_type_info &rhs) const ; - virtual bool + virtual BOOST_SERIALIZATION_DECL bool is_equal(const boost::serialization::extended_type_info &rhs) const ; }; diff --git a/include/boost/serialization/extended_type_info_typeid.hpp b/include/boost/serialization/extended_type_info_typeid.hpp index 6a003be1..d9e99e03 100644 --- a/include/boost/serialization/extended_type_info_typeid.hpp +++ b/include/boost/serialization/extended_type_info_typeid.hpp @@ -49,7 +49,7 @@ namespace boost { namespace serialization { namespace typeid_system { -class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info_typeid_0 : +class BOOST_SYMBOL_VISIBLE extended_type_info_typeid_0 : public extended_type_info { virtual const char * get_debug_info() const { @@ -59,16 +59,16 @@ class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info_typeid_0 : } protected: const std::type_info * m_ti; - extended_type_info_typeid_0(const char * key); - ~extended_type_info_typeid_0(); - void type_register(const std::type_info & ti); - void type_unregister(); - const extended_type_info * + BOOST_SERIALIZATION_DECL extended_type_info_typeid_0(const char * key); + BOOST_SERIALIZATION_DECL ~extended_type_info_typeid_0(); + BOOST_SERIALIZATION_DECL void type_register(const std::type_info & ti); + BOOST_SERIALIZATION_DECL void type_unregister(); + BOOST_SERIALIZATION_DECL const extended_type_info * get_extended_type_info(const std::type_info & ti) const; public: - virtual bool + virtual BOOST_SERIALIZATION_DECL bool is_less_than(const extended_type_info &rhs) const; - virtual bool + virtual BOOST_SERIALIZATION_DECL bool is_equal(const extended_type_info &rhs) const; const std::type_info & get_typeid() const { return *m_ti; diff --git a/include/boost/serialization/factory.hpp b/include/boost/serialization/factory.hpp index b601af62..916d75d7 100644 --- a/include/boost/serialization/factory.hpp +++ b/include/boost/serialization/factory.hpp @@ -21,7 +21,6 @@ #include #include -#include namespace std{ #if defined(__LIBCOMO__) diff --git a/include/boost/serialization/force_include.hpp b/include/boost/serialization/force_include.hpp index 468be37f..55ab79d0 100644 --- a/include/boost/serialization/force_include.hpp +++ b/include/boost/serialization/force_include.hpp @@ -31,11 +31,7 @@ // release mode. #if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__) -# if defined(__BORLANDC__) -# define BOOST_DLLEXPORT __export -# else -# define BOOST_DLLEXPORT __declspec(dllexport) -# endif +# define BOOST_DLLEXPORT __declspec(dllexport) #elif ! defined(_WIN32) && ! defined(_WIN64) # if defined(__MWERKS__) # define BOOST_DLLEXPORT __declspec(dllexport) diff --git a/include/boost/serialization/forward_list.hpp b/include/boost/serialization/forward_list.hpp index 612413b9..fd52f860 100644 --- a/include/boost/serialization/forward_list.hpp +++ b/include/boost/serialization/forward_list.hpp @@ -16,20 +16,12 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include // size_t #include #include // distance -#include // msvc 6.0 needs this for warning suppression -#if defined(BOOST_NO_STDC_NAMESPACE) -namespace std{ - using ::size_t; -} // namespace std -#endif - #include +#include #include -#include #include #include #include @@ -53,6 +45,42 @@ inline void save( >(ar, t, count); } +namespace stl { + +template< + class Archive, + class T, + class Allocator +> +typename boost::disable_if< + typename detail::is_default_constructible< + typename std::forward_list::value_type + >, + void +>::type +collection_load_impl( + Archive & ar, + std::forward_list &t, + collection_size_type count, + item_version_type item_version +){ + t.clear(); + boost::serialization::detail::stack_construct u(ar, item_version); + ar >> boost::serialization::make_nvp("item", u.reference()); + t.push_front(u.reference()); + typename std::forward_list::iterator last; + last = t.begin(); + ar.reset_object_address(&(*t.begin()) , & u.reference()); + while(--count > 0){ + detail::stack_construct u(ar, item_version); + ar >> boost::serialization::make_nvp("item", u.reference()); + last = t.insert_after(last, u.reference()); + ar.reset_object_address(&(*last) , & u.reference()); + } +} + +} // stl + template inline void load( Archive & ar, @@ -69,29 +97,7 @@ inline void load( if(boost::archive::library_version_type(3) < library_version){ ar >> BOOST_SERIALIZATION_NVP(item_version); } - if(detail::is_default_constructible()){ - t.resize(count); - typename std::forward_list::iterator hint; - hint = t.begin(); - while(count-- > 0){ - ar >> boost::serialization::make_nvp("item", *hint++); - } - } - else{ - t.clear(); - boost::serialization::detail::stack_construct u(ar, item_version); - ar >> boost::serialization::make_nvp("item", u.reference()); - t.push_front(u.reference()); - typename std::forward_list::iterator last; - last = t.begin(); - ar.reset_object_address(&(*t.begin()) , & u.reference()); - while(--count > 0){ - detail::stack_construct u(ar, item_version); - ar >> boost::serialization::make_nvp("item", u.reference()); - last = t.insert_after(last, u.reference()); - ar.reset_object_address(&(*last) , & u.reference()); - } - } + stl::collection_load_impl(ar, t, count, item_version); } // split non-intrusive serialization function member into separate diff --git a/include/boost/serialization/level.hpp b/include/boost/serialization/level.hpp index b037f7eb..f6a84d10 100644 --- a/include/boost/serialization/level.hpp +++ b/include/boost/serialization/level.hpp @@ -63,19 +63,11 @@ struct implementation_level_impl { //else typename mpl::eval_if< is_array< T >, - #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) - mpl::int_, - #else mpl::int_, - #endif //else typename mpl::eval_if< is_enum< T >, - //#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) - // mpl::int_, - //#else mpl::int_, - //#endif //else mpl::int_ > diff --git a/include/boost/serialization/list.hpp b/include/boost/serialization/list.hpp index b745d876..741dbbe7 100644 --- a/include/boost/serialization/list.hpp +++ b/include/boost/serialization/list.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -29,7 +30,6 @@ #include #include #include -#include namespace boost { namespace serialization { @@ -62,23 +62,7 @@ inline void load( if(boost::archive::library_version_type(3) < library_version){ ar >> BOOST_SERIALIZATION_NVP(item_version); } - if(detail::is_default_constructible()){ - t.resize(count); - typename std::list::iterator hint; - hint = t.begin(); - while(count-- > 0){ - ar >> boost::serialization::make_nvp("item", *hint++); - } - } - else{ - t.clear(); - while(count-- > 0){ - detail::stack_construct u(ar, item_version); - ar >> boost::serialization::make_nvp("item", u.reference()); - t.push_back(u.reference()); - ar.reset_object_address(& t.back() , & u.reference()); - } - } + stl::collection_load_impl(ar, t, count, item_version); } // split non-intrusive serialization function member into separate diff --git a/include/boost/serialization/nvp.hpp b/include/boost/serialization/nvp.hpp index f33707c3..6a1eb826 100644 --- a/include/boost/serialization/nvp.hpp +++ b/include/boost/serialization/nvp.hpp @@ -87,10 +87,7 @@ struct nvp : template inline -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -const -#endif -nvp< T > make_nvp(const char * name, T & t){ +const nvp< T > make_nvp(const char * name, T & t){ return nvp< T >(name, t); } diff --git a/include/boost/serialization/pfto.hpp b/include/boost/serialization/pfto.hpp deleted file mode 100644 index 0370d283..00000000 --- a/include/boost/serialization/pfto.hpp +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef BOOST_SERIALIZATION_PFTO_HPP -#define BOOST_SERIALIZATION_PFTO_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// pfto.hpp: workarounds for compilers which have problems supporting -// Partial Function Template Ordering (PFTO). - -// (C) Copyright 2002 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/libs/serialization for updates, documentation, and revision history. -// PFTO version is used to specify the last argument of certain functions -// Function it is used to support compilers that fail to support correct Partial -// Template Ordering -#include - -// some compilers can use an exta argument and use function overloading -// to choose desired function. This extra argument is long in the default -// function implementation and int for the rest. The function is called -// with an int argument. This first attempts to match functions with an -// int argument before the default one (with a long argument). This is -// known to function with VC 6.0. On other compilers this fails (Borland) -// or causes other problems (GCC). note: this - -#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) - #define BOOST_PFTO long -#else - #define BOOST_PFTO -#endif - -// here's another approach. Rather than use a default function - make sure -// there is no default at all by requiring that all function invocations -// have a "wrapped" argument type. This solves a problem with VC 6.0 -// (and perhaps others) while implementing templated constructors. - -namespace boost { -namespace serialization { - -template -struct pfto_wrapper { - const T & t; - operator const T & (){ - return t; - } - pfto_wrapper (const T & rhs) : t(rhs) {} -}; - -template -pfto_wrapper< T > make_pfto_wrapper(const T & t, BOOST_PFTO int){ - return pfto_wrapper< T >(t); -} - -template -pfto_wrapper< T > make_pfto_wrapper(const pfto_wrapper< T > & t, int){ - return t; -} - -} // namespace serialization -} // namespace boost - -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - #define BOOST_PFTO_WRAPPER(T) \ - boost::serialization::pfto_wrapper< T > - #define BOOST_MAKE_PFTO_WRAPPER(t) \ - boost::serialization::make_pfto_wrapper(t, 0) -#else - #define BOOST_PFTO_WRAPPER(T) T - #define BOOST_MAKE_PFTO_WRAPPER(t) t -#endif - -#endif // BOOST_SERIALIZATION_PFTO_HPP diff --git a/include/boost/serialization/serialization.hpp b/include/boost/serialization/serialization.hpp index 8462b594..a4d04723 100644 --- a/include/boost/serialization/serialization.hpp +++ b/include/boost/serialization/serialization.hpp @@ -12,7 +12,6 @@ #include #include -#include /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // serialization.hpp: interface for serialization system. @@ -64,7 +63,7 @@ BOOST_STRONG_TYPEDEF(unsigned int, version_type) // default implementation - call the member function "serialize" template inline void serialize( - Archive & ar, T & t, const BOOST_PFTO unsigned int file_version + Archive & ar, T & t, const unsigned int file_version ){ access::serialize(ar, t, static_cast(file_version)); } @@ -74,7 +73,7 @@ template inline void save_construct_data( Archive & /*ar*/, const T * /*t*/, - const BOOST_PFTO unsigned int /*file_version */ + const unsigned int /*file_version */ ){ // default is to save no data because default constructor // requires no arguments. @@ -85,7 +84,7 @@ template inline void load_construct_data( Archive & /*ar*/, T * t, - const BOOST_PFTO unsigned int /*file_version*/ + const unsigned int /*file_version*/ ){ // default just uses the default constructor. going // through access permits usage of otherwise private default @@ -123,12 +122,8 @@ inline void serialize_adl( // Note that this trick generates problems for compiles which don't support // PFTO, suppress it here. As far as we know, there are no compilers // which fail to support PFTO while supporting two-phase lookup. - #if ! defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) - const version_type v(file_version); - serialize(ar, t, v); - #else - serialize(ar, t, file_version); - #endif + const version_type v(file_version); + serialize(ar, t, v); } template @@ -138,12 +133,8 @@ inline void save_construct_data_adl( const unsigned int file_version ){ // see above - #if ! defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) - const version_type v(file_version); - save_construct_data(ar, t, v); - #else - save_construct_data(ar, t, file_version); - #endif + const version_type v(file_version); + save_construct_data(ar, t, v); } template @@ -153,12 +144,8 @@ inline void load_construct_data_adl( const unsigned int file_version ){ // see above comment - #if ! defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) - const version_type v(file_version); - load_construct_data(ar, t, v); - #else - load_construct_data(ar, t, file_version); - #endif + const version_type v(file_version); + load_construct_data(ar, t, v); } } // namespace serialization diff --git a/include/boost/serialization/shared_ptr.hpp b/include/boost/serialization/shared_ptr.hpp index 345aae96..0d4c5ae6 100644 --- a/include/boost/serialization/shared_ptr.hpp +++ b/include/boost/serialization/shared_ptr.hpp @@ -48,11 +48,7 @@ #else typedef mpl::int_<1> type; #endif - #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) - BOOST_STATIC_CONSTANT(int, value = 1); - #else BOOST_STATIC_CONSTANT(int, value = type::value); - #endif }; // don't track shared pointers template @@ -63,11 +59,7 @@ #else typedef mpl::int_< ::boost::serialization::track_never> type; #endif - #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) - BOOST_STATIC_CONSTANT(int, value = ::boost::serialization::track_never); - #else BOOST_STATIC_CONSTANT(int, value = type::value); - #endif }; }} #define BOOST_SERIALIZATION_SHARED_PTR(T) diff --git a/include/boost/serialization/shared_ptr_132.hpp b/include/boost/serialization/shared_ptr_132.hpp index ea02abdb..3dfaba4d 100644 --- a/include/boost/serialization/shared_ptr_132.hpp +++ b/include/boost/serialization/shared_ptr_132.hpp @@ -78,7 +78,7 @@ inline void save_construct_data( Archive & ar, const boost_132::detail::sp_counted_base_impl *t, - const BOOST_PFTO unsigned int /* file_version */ + const unsigned int /* file_version */ ){ // variables used for construction ar << boost::serialization::make_nvp("ptr", t->ptr); diff --git a/include/boost/serialization/shared_ptr_helper.hpp b/include/boost/serialization/shared_ptr_helper.hpp index 64269a95..189447a8 100644 --- a/include/boost/serialization/shared_ptr_helper.hpp +++ b/include/boost/serialization/shared_ptr_helper.hpp @@ -57,7 +57,7 @@ template class SPT> class shared_ptr_helper { typedef std::map< const void *, // address of object - SPT // address shared ptr to single instance + SPT // address shared ptr to single instance > object_shared_pointer_map; // list of shared_pointers create accessable by raw pointer. This @@ -71,7 +71,9 @@ class shared_ptr_helper { void operator()(void const *) const {} }; -#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) || defined(BOOST_MSVC) +#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \ +|| defined(BOOST_MSVC) \ +|| defined(__SUNPRO_CC) public: #else template @@ -92,7 +94,7 @@ public: // by a change in load_construct_data below. It makes this file suitable // only for loading pointers into a 1.33 or later boost system. std::list > * m_pointers_132; - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL void append(const boost_132::shared_ptr & t){ if(NULL == m_pointers_132) m_pointers_132 = new std::list >; diff --git a/include/boost/serialization/singleton.hpp b/include/boost/serialization/singleton.hpp index 546118c8..a397da57 100644 --- a/include/boost/serialization/singleton.hpp +++ b/include/boost/serialization/singleton.hpp @@ -77,7 +77,7 @@ namespace serialization { // attempt to retieve a mutable instances while locked will // generate a assertion if compiled for debug. -class singleton_module : +class BOOST_SYMBOL_VISIBLE singleton_module : public boost::noncopyable { private: diff --git a/include/boost/serialization/slist.hpp b/include/boost/serialization/slist.hpp index 424aa514..af300683 100644 --- a/include/boost/serialization/slist.hpp +++ b/include/boost/serialization/slist.hpp @@ -16,20 +16,17 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include // size_t -#include // msvc 6.0 needs this for warning suppression -#if defined(BOOST_NO_STDC_NAMESPACE) -namespace std{ - using ::size_t; -} // namespace std -#endif - +#include #ifdef BOOST_HAS_SLIST #include BOOST_SLIST_HEADER #include -#include +#include +#include #include +#include +#include +#include #include #include @@ -48,6 +45,42 @@ inline void save( >(ar, t); } +namespace stl { + +template< + class Archive, + class T, + class Allocator +> +typename boost::disable_if< + typename detail::is_default_constructible< + typename BOOST_STD_EXTENSION_NAMESPACE::slist::value_type + >, + void +>::type +collection_load_impl( + Archive & ar, + BOOST_STD_EXTENSION_NAMESPACE::slist &t, + collection_size_type count, + item_version_type item_version +){ + t.clear(); + boost::serialization::detail::stack_construct u(ar, item_version); + ar >> boost::serialization::make_nvp("item", u.reference()); + t.push_front(u.reference()); + typename BOOST_STD_EXTENSION_NAMESPACE::slist::iterator last; + last = t.begin(); + ar.reset_object_address(&(*t.begin()) , & u.reference()); + while(--count > 0){ + detail::stack_construct u(ar, item_version); + ar >> boost::serialization::make_nvp("item", u.reference()); + last = t.insert_after(last, u.reference()); + ar.reset_object_address(&(*last) , & u.reference()); + } +} + +} // stl + template inline void load( Archive & ar, diff --git a/include/boost/serialization/smart_cast.hpp b/include/boost/serialization/smart_cast.hpp index 02edb4be..563f36aa 100644 --- a/include/boost/serialization/smart_cast.hpp +++ b/include/boost/serialization/smart_cast.hpp @@ -85,7 +85,6 @@ namespace smart_cast_impl { static T cast(U & u){ // if we're in debug mode #if ! defined(NDEBUG) \ - || defined(__BORLANDC__) && (__BORLANDC__ <= 0x560) \ || defined(__MWERKS__) // do a checked dynamic cast return cross::cast(u); @@ -124,20 +123,12 @@ namespace smart_cast_impl { }; template static T cast(U & u){ - #if defined(__BORLANDC__) - return mpl::eval_if< - boost::is_polymorphic, - mpl::identity, - mpl::identity - >::type::cast(u); - #else - typedef typename mpl::eval_if< - boost::is_polymorphic, - mpl::identity, - mpl::identity - >::type typex; - return typex::cast(u); - #endif + typedef typename mpl::eval_if< + boost::is_polymorphic, + mpl::identity, + mpl::identity + >::type typex; + return typex::cast(u); } }; @@ -169,34 +160,23 @@ namespace smart_cast_impl { template static T cast(U * u){ - // if we're in debug mode - #if 0 //! defined(NDEBUG) || defined(__BORLANDC__) && (__BORLANDC__ <= 0x560) - // do a checked dynamic cast - return cross::cast(u); - #else - // borland 5.51 chokes here so we can't use it - // note: if remove_pointer isn't function for these types - // cross casting will be selected this will work but will - // not be the most efficient method. This will conflict with - // the original smart_cast motivation. - typedef - typename mpl::eval_if< - typename mpl::and_< - mpl::not_::type, - U - > >, - mpl::not_::type - > > - >, - // borland chokes w/o full qualification here - mpl::identity, - mpl::identity - >::type typex; - return typex::cast(u); - #endif + typedef + typename mpl::eval_if< + typename mpl::and_< + mpl::not_::type, + U + > >, + mpl::not_::type + > > + >, + // borland chokes w/o full qualification here + mpl::identity, + mpl::identity + >::type typex; + return typex::cast(u); } #else template @@ -219,20 +199,12 @@ namespace smart_cast_impl { template static T cast(U * u){ - #if defined(__BORLANDC__) - return mpl::eval_if< - boost::is_polymorphic, - mpl::identity, - mpl::identity - >::type::cast(u); - #else - typedef typename mpl::eval_if< - boost::is_polymorphic, - mpl::identity, - mpl::identity - >::type typex; - return typex::cast(u); - #endif + typedef typename mpl::eval_if< + boost::is_polymorphic, + mpl::identity, + mpl::identity + >::type typex; + return typex::cast(u); } }; @@ -251,7 +223,7 @@ namespace smart_cast_impl { // cast on a system which doesn't support partial template // specialization template - static T cast(U u){ + static T cast(U){ BOOST_STATIC_ASSERT(sizeof(T)==0); return * static_cast(NULL); } diff --git a/include/boost/serialization/static_warning.hpp b/include/boost/serialization/static_warning.hpp index d2f23d36..cbbcb826 100644 --- a/include/boost/serialization/static_warning.hpp +++ b/include/boost/serialization/static_warning.hpp @@ -57,13 +57,7 @@ //------------------Enable selected warnings----------------------------------// -// Enable the warnings relied on by BOOST_STATIC_WARNING, where possible. The -// only pragma which is absolutely necessary here is for Borland 5.x, since -// W8073 is disabled by default. If enabling selected warnings is considered -// unacceptable, this section can be replaced with: -// #if defined(__BORLANDC__) && (__BORLANDC__ <= 0x600) -// pragma warn +st -// #endif +// Enable the warnings relied on by BOOST_STATIC_WARNING, where possible. // 6. replaced implementation with one which depends solely on // mpl::print<>. The previous one was found to fail for functions diff --git a/include/boost/serialization/strong_typedef.hpp b/include/boost/serialization/strong_typedef.hpp index 54a51626..c1bf1844 100644 --- a/include/boost/serialization/strong_typedef.hpp +++ b/include/boost/serialization/strong_typedef.hpp @@ -25,42 +25,22 @@ #include #include -#if !defined(__BORLANDC__) || __BORLANDC__ >= 0x590 - #define BOOST_STRONG_TYPEDEF(T, D) \ - struct D \ - : boost::totally_ordered1< D \ - , boost::totally_ordered2< D, T \ - > > \ - { \ - T t; \ - explicit D(const T t_) : t(t_) {}; \ - D(): t() {}; \ - D(const D & t_) : t(t_.t){} \ - D & operator=(const D & rhs) { t = rhs.t; return *this;} \ - D & operator=(const T & rhs) { t = rhs; return *this;} \ - operator const T & () const {return t; } \ - operator T & () { return t; } \ - bool operator==(const D & rhs) const { return t == rhs.t; } \ - bool operator<(const D & rhs) const { return t < rhs.t; } \ - }; -#else - #define BOOST_STRONG_TYPEDEF(T, D) \ - struct D \ - : boost::totally_ordered1< D \ - , boost::totally_ordered2< D, T \ - > > \ - { \ - T t; \ - explicit D(const T t_) : t(t_) {}; \ - D() : t(){}; \ - D(const D & t_) : t(t_.t){} \ - D & operator=(const D & rhs) { t = rhs.t; return *this;} \ - D & operator=(const T & rhs) { t = rhs; return *this;} \ - /*operator const T & () const {return t; }*/ \ - operator T & () { return t; } \ - bool operator==(const D & rhs) const { return t == rhs.t; } \ - bool operator<(const D & rhs) const { return t < rhs.t; } \ - }; -#endif // !defined(__BORLANDC) || __BORLANDC__ >= 0x590 +#define BOOST_STRONG_TYPEDEF(T, D) \ +struct D \ + : boost::totally_ordered1< D \ + , boost::totally_ordered2< D, T \ + > > \ +{ \ + T t; \ + explicit D(const T t_) : t(t_) {}; \ + D(): t() {}; \ + D(const D & t_) : t(t_.t){} \ + D & operator=(const D & rhs) { t = rhs.t; return *this;} \ + D & operator=(const T & rhs) { t = rhs; return *this;} \ + operator const T & () const {return t; } \ + operator T & () { return t; } \ + bool operator==(const D & rhs) const { return t == rhs.t; } \ + bool operator<(const D & rhs) const { return t < rhs.t; } \ +}; #endif // BOOST_SERIALIZATION_STRONG_TYPEDEF_HPP diff --git a/include/boost/serialization/type_info_implementation.hpp b/include/boost/serialization/type_info_implementation.hpp index 2c033fc8..24637a8d 100644 --- a/include/boost/serialization/type_info_implementation.hpp +++ b/include/boost/serialization/type_info_implementation.hpp @@ -55,18 +55,6 @@ struct type_info_implementation { // define a macro to assign a particular derivation of extended_type_info // to a specified a class. -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) -#define BOOST_CLASS_TYPE_INFO(T, ETI) \ -namespace boost { \ -namespace serialization { \ -template<> \ -struct type_info_implementation< T > { \ - typedef const ETI type; \ -}; \ -} \ -} \ -/**/ -#else #define BOOST_CLASS_TYPE_INFO(T, ETI) \ namespace boost { \ namespace serialization { \ @@ -81,6 +69,5 @@ struct type_info_implementation< const T > { \ } \ } \ /**/ -#endif #endif /// BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP diff --git a/include/boost/serialization/vector.hpp b/include/boost/serialization/vector.hpp index aa3aaca2..6e49bff3 100644 --- a/include/boost/serialization/vector.hpp +++ b/include/boost/serialization/vector.hpp @@ -29,12 +29,13 @@ #include #include +#include #include #include #include #include -#include #include +#include // default is being compatible with version 1.34.1 files, not 1.35 files #ifndef BOOST_SERIALIZATION_VECTOR_VERSIONED @@ -86,23 +87,8 @@ inline void load( if(boost::archive::library_version_type(3) < library_version){ ar >> BOOST_SERIALIZATION_NVP(item_version); } - if(detail::is_default_constructible()){ - t.resize(count); - typename std::vector::iterator hint; - hint = t.begin(); - while(count-- > 0){ - ar >> boost::serialization::make_nvp("item", *hint++); - } - } - else{ - t.reserve(count); - while(count-- > 0){ - detail::stack_construct u(ar, item_version); - ar >> boost::serialization::make_nvp("item", u.reference()); - t.push_back(u.reference()); - ar.reset_object_address(& t.back() , & u.reference()); - } - } + t.reserve(count); + stl::collection_load_impl(ar, t, count, item_version); } // the optimized versions @@ -212,8 +198,7 @@ inline void load( collection_size_type count; ar >> BOOST_SERIALIZATION_NVP(count); t.resize(count); - int i; - for(i = 0; i < count; ++i){ + for(collection_size_type i = collection_size_type(0); i < count; ++i){ bool b; ar >> boost::serialization::make_nvp("item", b); t[i] = b; diff --git a/include/boost/serialization/void_cast.hpp b/include/boost/serialization/void_cast.hpp index 61b6449e..f1b38286 100644 --- a/include/boost/serialization/void_cast.hpp +++ b/include/boost/serialization/void_cast.hpp @@ -47,7 +47,7 @@ class extended_type_info; // Return the altered pointer. If there exists no sequence of casts that // can transform from_type to to_type, return a NULL. -BOOST_SERIALIZATION_DECL(void const *) +BOOST_SERIALIZATION_DECL void const * void_upcast( extended_type_info const & derived, extended_type_info const & base, @@ -67,7 +67,7 @@ void_upcast( )); } -BOOST_SERIALIZATION_DECL(void const *) +BOOST_SERIALIZATION_DECL void const * void_downcast( extended_type_info const & derived, extended_type_info const & base, @@ -89,26 +89,26 @@ void_downcast( namespace void_cast_detail { -class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) void_caster : +class BOOST_SYMBOL_VISIBLE void_caster : private boost::noncopyable { friend - BOOST_SERIALIZATION_DECL(void const *) + BOOST_SERIALIZATION_DECL void const * boost::serialization::void_upcast( extended_type_info const & derived, extended_type_info const & base, void const * const ); friend - BOOST_SERIALIZATION_DECL(void const *) + BOOST_SERIALIZATION_DECL void const * boost::serialization::void_downcast( extended_type_info const & derived, extended_type_info const & base, void const * const ); protected: - void recursive_register(bool includes_virtual_base = false) const; - void recursive_unregister() const; + BOOST_SERIALIZATION_DECL void recursive_register(bool includes_virtual_base = false) const; + BOOST_SERIALIZATION_DECL void recursive_unregister() const; virtual bool has_virtual_base() const = 0; public: // Data members @@ -151,7 +151,7 @@ public: #endif template -class void_caster_primitive : +class BOOST_SYMBOL_VISIBLE void_caster_primitive : public void_caster { virtual void const * downcast(void const * const t) const { @@ -199,7 +199,7 @@ void_caster_primitive::~void_caster_primitive(){ } template -class void_caster_virtual_base : +class BOOST_SYMBOL_VISIBLE void_caster_virtual_base : public void_caster { virtual bool has_virtual_base() const { @@ -244,7 +244,7 @@ void_caster_virtual_base::~void_caster_virtual_base(){ } template -struct void_caster_base : +struct BOOST_SYMBOL_VISIBLE void_caster_base : public void_caster { typedef @@ -281,7 +281,7 @@ inline const void_cast_detail::void_caster & void_cast_register( } template -class void_caster : +class BOOST_SYMBOL_VISIBLE void_caster : public void_cast_detail::void_caster_base::type { }; diff --git a/src/archive_exception.cpp b/src/archive_exception.cpp index d06303f6..b850f899 100644 --- a/src/archive_exception.cpp +++ b/src/archive_exception.cpp @@ -13,7 +13,6 @@ #endif #include -//#include #include #define BOOST_ARCHIVE_SOURCE @@ -34,12 +33,12 @@ archive_exception::append(unsigned int l, const char * a){ return l; } -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL archive_exception::archive_exception( exception_code c, const char * e1, const char * e2 -) : +) BOOST_NOEXCEPT : code(c) { unsigned int length = 0; @@ -110,17 +109,16 @@ archive_exception::archive_exception( break; } } -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) -archive_exception::~archive_exception() throw() {} +BOOST_ARCHIVE_DECL +archive_exception::~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW {} -BOOST_ARCHIVE_DECL(const char *) -archive_exception::what( ) const throw() -{ +BOOST_ARCHIVE_DECL const char * +archive_exception::what( ) const BOOST_NOEXCEPT_OR_NOTHROW { return m_buffer; } -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) -archive_exception::archive_exception() : - code(no_exception) +BOOST_ARCHIVE_DECL +archive_exception::archive_exception() BOOST_NOEXCEPT : + code(no_exception) {} } // archive diff --git a/src/basic_archive.cpp b/src/basic_archive.cpp index 3f6c3e35..1a7b57d1 100644 --- a/src/basic_archive.cpp +++ b/src/basic_archive.cpp @@ -41,7 +41,7 @@ namespace archive { // constants used in archive signature //This should never ever change. note that is not an std::string // string. -BOOST_ARCHIVE_DECL(const char *) +BOOST_SYMBOL_VISIBLE const char * BOOST_ARCHIVE_SIGNATURE(){ return "serialization::archive"; } @@ -73,10 +73,11 @@ BOOST_ARCHIVE_SIGNATURE(){ // 10- fixed base64 output/input. // 11- not changes // 12- improved serialization of collections +// 13- simplified visibility, removed Borland, removed pfto -BOOST_ARCHIVE_DECL(library_version_type) +BOOST_SYMBOL_VISIBLE library_version_type BOOST_ARCHIVE_VERSION(){ - return library_version_type(12); + return library_version_type(13); } } // namespace archive diff --git a/src/basic_iarchive.cpp b/src/basic_iarchive.cpp index 9e25092a..197cf676 100644 --- a/src/basic_iarchive.cpp +++ b/src/basic_iarchive.cpp @@ -518,26 +518,26 @@ namespace boost { namespace archive { namespace detail { -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_iarchive::next_object_pointer(void *t){ pimpl->next_object_pointer(t); } -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_iarchive::basic_iarchive(unsigned int flags) : pimpl(new basic_iarchive_impl(flags)) {} -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_iarchive::~basic_iarchive() {} -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_iarchive::set_library_version(library_version_type archive_library_version){ pimpl->set_library_version(archive_library_version); } -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_iarchive::reset_object_address( const void * new_address, const void * old_address @@ -545,7 +545,7 @@ basic_iarchive::reset_object_address( pimpl->reset_object_address(new_address, old_address); } -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_iarchive::load_object( void *t, const basic_iserializer & bis @@ -554,7 +554,7 @@ basic_iarchive::load_object( } // load a pointer object -BOOST_ARCHIVE_DECL(const basic_pointer_iserializer *) +BOOST_ARCHIVE_DECL const basic_pointer_iserializer * basic_iarchive::load_pointer( void * &t, const basic_pointer_iserializer * bpis_ptr, @@ -566,23 +566,23 @@ basic_iarchive::load_pointer( return pimpl->load_pointer(*this, t, bpis_ptr, finder); } -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_iarchive::register_basic_serializer(const basic_iserializer & bis){ pimpl->register_type(bis); } -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_iarchive::delete_created_pointers() { pimpl->delete_created_pointers(); } -BOOST_ARCHIVE_DECL(boost::archive::library_version_type) +BOOST_ARCHIVE_DECL boost::archive::library_version_type basic_iarchive::get_library_version() const{ return pimpl->m_archive_library_version; } -BOOST_ARCHIVE_DECL(unsigned int) +BOOST_ARCHIVE_DECL unsigned int basic_iarchive::get_flags() const{ return pimpl->m_flags; } diff --git a/src/basic_iserializer.cpp b/src/basic_iserializer.cpp index e18e16fe..2b273927 100644 --- a/src/basic_iserializer.cpp +++ b/src/basic_iserializer.cpp @@ -17,7 +17,7 @@ namespace boost { namespace archive { namespace detail { -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_iserializer::basic_iserializer( const boost::serialization::extended_type_info & eti ) : @@ -25,7 +25,7 @@ basic_iserializer::basic_iserializer( m_bpis(NULL) {} -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_iserializer::~basic_iserializer(){} } // namespace detail diff --git a/src/basic_oarchive.cpp b/src/basic_oarchive.cpp index 2ce98c6d..c99baeb4 100644 --- a/src/basic_oarchive.cpp +++ b/src/basic_oarchive.cpp @@ -410,16 +410,16 @@ namespace boost { namespace archive { namespace detail { -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_oarchive::basic_oarchive(unsigned int flags) : pimpl(new basic_oarchive_impl(flags)) {} -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_oarchive::~basic_oarchive() {} -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_oarchive::save_object( const void *x, const basic_oserializer & bos @@ -427,7 +427,7 @@ basic_oarchive::save_object( pimpl->save_object(*this, x, bos); } -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_oarchive::save_pointer( const void * t, const basic_pointer_oserializer * bpos_ptr @@ -435,22 +435,22 @@ basic_oarchive::save_pointer( pimpl->save_pointer(*this, t, bpos_ptr); } -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_oarchive::register_basic_serializer(const basic_oserializer & bos){ pimpl->register_type(bos); } -BOOST_ARCHIVE_DECL(library_version_type) +BOOST_ARCHIVE_DECL library_version_type basic_oarchive::get_library_version() const{ return BOOST_ARCHIVE_VERSION(); } -BOOST_ARCHIVE_DECL(unsigned int) +BOOST_ARCHIVE_DECL unsigned int basic_oarchive::get_flags() const{ return pimpl->m_flags; } -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_oarchive::end_preamble(){ } diff --git a/src/basic_oserializer.cpp b/src/basic_oserializer.cpp index 0e218064..70b1106b 100644 --- a/src/basic_oserializer.cpp +++ b/src/basic_oserializer.cpp @@ -17,7 +17,7 @@ namespace boost { namespace archive { namespace detail { -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_oserializer::basic_oserializer( const boost::serialization::extended_type_info & eti ) : @@ -25,7 +25,7 @@ basic_oserializer::basic_oserializer( m_bpos(NULL) {} -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_oserializer::~basic_oserializer(){} } // namespace detail diff --git a/src/basic_pointer_iserializer.cpp b/src/basic_pointer_iserializer.cpp index fac766fd..6edf4510 100644 --- a/src/basic_pointer_iserializer.cpp +++ b/src/basic_pointer_iserializer.cpp @@ -15,14 +15,14 @@ namespace boost { namespace archive { namespace detail { -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_pointer_iserializer::basic_pointer_iserializer( const boost::serialization::extended_type_info & eti ) : basic_serializer(eti) {} -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_pointer_iserializer::~basic_pointer_iserializer() {} } // namespace detail diff --git a/src/basic_pointer_oserializer.cpp b/src/basic_pointer_oserializer.cpp index 9e9f1dd1..a5fc65c1 100644 --- a/src/basic_pointer_oserializer.cpp +++ b/src/basic_pointer_oserializer.cpp @@ -15,14 +15,14 @@ namespace boost { namespace archive { namespace detail { -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_pointer_oserializer::basic_pointer_oserializer( const boost::serialization::extended_type_info & eti ) : basic_serializer(eti) {} -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL basic_pointer_oserializer::~basic_pointer_oserializer() {} } // namespace detail diff --git a/src/basic_serializer_map.cpp b/src/basic_serializer_map.cpp index 7df0b3dd..fea50a6d 100644 --- a/src/basic_serializer_map.cpp +++ b/src/basic_serializer_map.cpp @@ -40,7 +40,7 @@ basic_serializer_map::type_info_pointer_compare::operator()( return *lhs < *rhs; } -BOOST_ARCHIVE_DECL(bool) +BOOST_ARCHIVE_DECL bool basic_serializer_map::insert(const basic_serializer * bs){ // attempt to insert serializer into it's map // the following is commented out - rather than being just @@ -72,7 +72,7 @@ basic_serializer_map::insert(const basic_serializer * bs){ return true; } -BOOST_ARCHIVE_DECL(void) +BOOST_ARCHIVE_DECL void basic_serializer_map::erase(const basic_serializer * bs){ map_type::iterator it = m_map.begin(); map_type::iterator it_end = m_map.end(); @@ -92,7 +92,7 @@ basic_serializer_map::erase(const basic_serializer * bs){ //if(*it == bs) // m_map.erase(it); } -BOOST_ARCHIVE_DECL(const basic_serializer *) +BOOST_ARCHIVE_DECL const basic_serializer * basic_serializer_map::find( const boost::serialization::extended_type_info & eti ) const { diff --git a/src/basic_xml_archive.cpp b/src/basic_xml_archive.cpp index e71aaef3..3d846633 100644 --- a/src/basic_xml_archive.cpp +++ b/src/basic_xml_archive.cpp @@ -14,35 +14,35 @@ namespace boost { namespace archive { -BOOST_ARCHIVE_DECL(const char *) +BOOST_SYMBOL_VISIBLE const char * BOOST_ARCHIVE_XML_OBJECT_ID(){ return "object_id"; } -BOOST_ARCHIVE_DECL(const char *) +BOOST_SYMBOL_VISIBLE const char * BOOST_ARCHIVE_XML_OBJECT_REFERENCE(){ return "object_id_reference"; } -BOOST_ARCHIVE_DECL(const char *) +BOOST_SYMBOL_VISIBLE const char * BOOST_ARCHIVE_XML_CLASS_ID(){ return "class_id"; } -BOOST_ARCHIVE_DECL(const char *) +BOOST_SYMBOL_VISIBLE const char * BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(){ return "class_id_reference"; } -BOOST_ARCHIVE_DECL(const char *) +BOOST_SYMBOL_VISIBLE const char * BOOST_ARCHIVE_XML_CLASS_NAME(){ return "class_name"; } -BOOST_ARCHIVE_DECL(const char *) +BOOST_SYMBOL_VISIBLE const char * BOOST_ARCHIVE_XML_TRACKING(){ return "tracking_level"; } -BOOST_ARCHIVE_DECL(const char *) +BOOST_SYMBOL_VISIBLE const char * BOOST_ARCHIVE_XML_VERSION(){ return "version"; } -BOOST_ARCHIVE_DECL(const char *) +BOOST_SYMBOL_VISIBLE const char * BOOST_ARCHIVE_XML_SIGNATURE(){ return "signature"; } diff --git a/src/basic_xml_grammar.ipp b/src/basic_xml_grammar.ipp index 28be525c..c7b500a1 100644 --- a/src/basic_xml_grammar.ipp +++ b/src/basic_xml_grammar.ipp @@ -14,11 +14,11 @@ #include #include -#include // BOOST_DEDUCED_TYPENAME +#include // typename #ifdef BOOST_MSVC # pragma warning(push) -# pragma warning(disable : 4511 4512) +# pragma warning(disable : 4244 4511 4512) #endif // spirit stuff @@ -33,7 +33,6 @@ // for head_iterator test //#include #include -#include #include #include @@ -146,7 +145,7 @@ template struct append_char { String & contents; void operator()(const unsigned int char_value) const { - const BOOST_DEDUCED_TYPENAME String::value_type z = char_value; + const typename String::value_type z = char_value; contents += z; } append_char(String & contents_) @@ -159,7 +158,7 @@ struct append_lit { String & contents; template void operator()(const X & /*x*/, const Y & /*y*/) const { - const BOOST_DEDUCED_TYPENAME String::value_type z = c; + const typename String::value_type z = c; contents += z; } append_lit(String & contents_) @@ -175,7 +174,7 @@ struct append_lit { template bool basic_xml_grammar::my_parse( - BOOST_DEDUCED_TYPENAME basic_xml_grammar::IStream & is, + typename basic_xml_grammar::IStream & is, const rule_t & rule_, CharType delimiter ) const { @@ -192,7 +191,7 @@ bool basic_xml_grammar::my_parse( CharType val; do{ - BOOST_DEDUCED_TYPENAME basic_xml_grammar::IStream::int_type + typename basic_xml_grammar::IStream::int_type result = is.get(); if(is.fail()) return false; @@ -206,14 +205,14 @@ bool basic_xml_grammar::my_parse( // is terminated. This will permit the archive to be used for debug // and transaction data logging in the standard way. - parse_info::iterator> + parse_info::iterator> result = boost::spirit::classic::parse(arg.begin(), arg.end(), rule_); return result.hit; } template bool basic_xml_grammar::parse_start_tag( - BOOST_DEDUCED_TYPENAME basic_xml_grammar::IStream & is + typename basic_xml_grammar::IStream & is ){ rv.class_name.resize(0); return my_parse(is, STag); @@ -283,7 +282,7 @@ basic_xml_grammar::basic_xml_grammar(){ CharDataChars [ xml::append_string< StringType, - BOOST_DEDUCED_TYPENAME std::basic_string::const_iterator + typename std::basic_string::const_iterator >(rv.contents) ] ; diff --git a/src/codecvt_null.cpp b/src/codecvt_null.cpp index 80ba2a33..86ece4ad 100644 --- a/src/codecvt_null.cpp +++ b/src/codecvt_null.cpp @@ -17,7 +17,7 @@ namespace boost { namespace archive { -BOOST_WARCHIVE_DECL(std::codecvt_base::result) +BOOST_WARCHIVE_DECL std::codecvt_base::result codecvt_null::do_out( std::mbstate_t & /*state*/, const wchar_t * first1, @@ -45,7 +45,7 @@ codecvt_null::do_out( return std::codecvt_base::ok; } -BOOST_WARCHIVE_DECL(std::codecvt_base::result) +BOOST_WARCHIVE_DECL std::codecvt_base::result codecvt_null::do_in( std::mbstate_t & /*state*/, const char * first1, diff --git a/src/extended_type_info.cpp b/src/extended_type_info.cpp index 48bbc562..1c6aa317 100644 --- a/src/extended_type_info.cpp +++ b/src/extended_type_info.cpp @@ -110,14 +110,14 @@ public: } // namespace detail -BOOST_SERIALIZATION_DECL(void) +BOOST_SERIALIZATION_DECL void extended_type_info::key_register() const{ if(NULL == get_key()) return; singleton::get_mutable_instance().insert(this); } -BOOST_SERIALIZATION_DECL(void) +BOOST_SERIALIZATION_DECL void extended_type_info::key_unregister() const{ if(NULL == get_key()) return; @@ -135,7 +135,7 @@ extended_type_info::key_unregister() const{ } } -BOOST_SERIALIZATION_DECL(const extended_type_info *) +BOOST_SERIALIZATION_DECL const extended_type_info * extended_type_info::find(const char *key) { BOOST_ASSERT(NULL != key); const detail::ktmap & k = singleton::get_const_instance(); @@ -146,7 +146,7 @@ extended_type_info::find(const char *key) { return *(it); } -BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +BOOST_SERIALIZATION_DECL extended_type_info::extended_type_info( const unsigned int type_info_key, const char * key @@ -156,11 +156,11 @@ extended_type_info::extended_type_info( { } -BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +BOOST_SERIALIZATION_DECL extended_type_info::~extended_type_info(){ } -BOOST_SERIALIZATION_DECL(bool) +BOOST_SERIALIZATION_DECL bool extended_type_info::operator<(const extended_type_info &rhs) const { // short cut for a common cases if(this == & rhs) @@ -173,7 +173,7 @@ extended_type_info::operator<(const extended_type_info &rhs) const { return false; } -BOOST_SERIALIZATION_DECL(bool) +BOOST_SERIALIZATION_DECL bool extended_type_info::operator==(const extended_type_info &rhs) const { // short cut for a common cases if(this == & rhs) diff --git a/src/extended_type_info_no_rtti.cpp b/src/extended_type_info_no_rtti.cpp index 3b2a8884..32d0437e 100644 --- a/src/extended_type_info_no_rtti.cpp +++ b/src/extended_type_info_no_rtti.cpp @@ -27,14 +27,14 @@ namespace boost { namespace serialization { namespace no_rtti_system { -BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +BOOST_SERIALIZATION_DECL extended_type_info_no_rtti_0::extended_type_info_no_rtti_0( const char * key ) : extended_type_info(EXTENDED_TYPE_INFO_NO_RTTI_KEY, key) {} -BOOST_SERIALIZATION_DECL(bool) +BOOST_SERIALIZATION_DECL bool extended_type_info_no_rtti_0::is_less_than( const boost::serialization::extended_type_info &rhs) const { @@ -57,7 +57,7 @@ extended_type_info_no_rtti_0::is_less_than( return std::strcmp(l, r) < 0; } -BOOST_SERIALIZATION_DECL(bool) +BOOST_SERIALIZATION_DECL bool extended_type_info_no_rtti_0::is_equal( const boost::serialization::extended_type_info &rhs) const { @@ -76,7 +76,7 @@ extended_type_info_no_rtti_0::is_equal( return 0 == std::strcmp(l, r); } -BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +BOOST_SERIALIZATION_DECL extended_type_info_no_rtti_0::~extended_type_info_no_rtti_0() {} diff --git a/src/extended_type_info_typeid.cpp b/src/extended_type_info_typeid.cpp index 8d970309..36be277b 100644 --- a/src/extended_type_info_typeid.cpp +++ b/src/extended_type_info_typeid.cpp @@ -44,7 +44,7 @@ typedef std::multiset< type_compare > tkmap; -BOOST_SERIALIZATION_DECL(bool) +BOOST_SERIALIZATION_DECL bool extended_type_info_typeid_0::is_less_than( const boost::serialization::extended_type_info & rhs ) const { @@ -56,7 +56,7 @@ extended_type_info_typeid_0::is_less_than( ); } -BOOST_SERIALIZATION_DECL(bool) +BOOST_SERIALIZATION_DECL bool extended_type_info_typeid_0::is_equal( const boost::serialization::extended_type_info & rhs ) const { @@ -70,7 +70,7 @@ extended_type_info_typeid_0::is_equal( ; } -BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +BOOST_SERIALIZATION_DECL extended_type_info_typeid_0::extended_type_info_typeid_0( const char * key ) : @@ -78,17 +78,17 @@ extended_type_info_typeid_0::extended_type_info_typeid_0( m_ti(NULL) {} -BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +BOOST_SERIALIZATION_DECL extended_type_info_typeid_0::~extended_type_info_typeid_0() {} -BOOST_SERIALIZATION_DECL(void) +BOOST_SERIALIZATION_DECL void extended_type_info_typeid_0::type_register(const std::type_info & ti){ m_ti = & ti; singleton::get_mutable_instance().insert(this); } -BOOST_SERIALIZATION_DECL(void) +BOOST_SERIALIZATION_DECL void extended_type_info_typeid_0::type_unregister() { if(NULL != m_ti){ @@ -144,7 +144,7 @@ public: # pragma warning(pop) #endif -BOOST_SERIALIZATION_DECL(const extended_type_info *) +BOOST_SERIALIZATION_DECL const extended_type_info * extended_type_info_typeid_0::get_extended_type_info( const std::type_info & ti ) const { diff --git a/src/stl_port.cpp b/src/stl_port.cpp index e5378bca..343faa6d 100644 --- a/src/stl_port.cpp +++ b/src/stl_port.cpp @@ -13,8 +13,7 @@ #endif // this befuddles the msvc 6 compiler so we can't use it -#if ! ((defined _MSC_VER) && (_MSC_VER <= 1300)) \ -&& ! defined(__BORLANDC__) +#if ! ((defined _MSC_VER) && (_MSC_VER <= 1300)) #include diff --git a/src/void_cast.cpp b/src/void_cast.cpp index df31235f..8ea5595e 100644 --- a/src/void_cast.cpp +++ b/src/void_cast.cpp @@ -27,6 +27,7 @@ // BOOST #define BOOST_SERIALIZATION_SOURCE +#include #include #include #include @@ -212,7 +213,7 @@ public: #endif // implementation of void caster base class -BOOST_SERIALIZATION_DECL(void) +BOOST_SERIALIZATION_DECL void void_caster::recursive_register(bool includes_virtual_base) const { void_cast_detail::set_type & s = void_cast_detail::void_caster_registry::get_mutable_instance(); @@ -270,7 +271,7 @@ void_caster::recursive_register(bool includes_virtual_base) const { } } -BOOST_SERIALIZATION_DECL(void) +BOOST_SERIALIZATION_DECL void void_caster::recursive_unregister() const { if(void_caster_registry::is_destroyed()) return; @@ -306,11 +307,18 @@ void_caster::recursive_unregister() const { } // namespace void_cast_detail +BOOST_SYMBOL_VISIBLE void const * +void_upcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const t +); + // Given a void *, assume that it really points to an instance of one type // and alter it so that it would point to an instance of a related type. // Return the altered pointer. If there exists no sequence of casts that // can transform from_type to to_type, return a NULL. -BOOST_SERIALIZATION_DECL(void const *) +BOOST_SERIALIZATION_DECL void const * void_upcast( extended_type_info const & derived, extended_type_info const & base, @@ -333,7 +341,14 @@ void_upcast( return NULL; } -BOOST_SERIALIZATION_DECL(void const *) +BOOST_SYMBOL_VISIBLE void const * +void_downcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const t +); + +BOOST_SERIALIZATION_DECL void const * void_downcast( extended_type_info const & derived, extended_type_info const & base, diff --git a/src/xml_archive_exception.cpp b/src/xml_archive_exception.cpp index 41d33fda..c1431e27 100644 --- a/src/xml_archive_exception.cpp +++ b/src/xml_archive_exception.cpp @@ -23,7 +23,7 @@ namespace boost { namespace archive { -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +BOOST_ARCHIVE_DECL xml_archive_exception::xml_archive_exception( exception_code c, const char * e1, diff --git a/src/xml_iarchive.cpp b/src/xml_iarchive.cpp index 43118935..4fe65bad 100644 --- a/src/xml_iarchive.cpp +++ b/src/xml_iarchive.cpp @@ -14,14 +14,8 @@ #define BOOST_ARCHIVE_SOURCE -// the following works around an issue between spirit 1.61 and borland. -// it turns out the the certain spirit stuff must be defined before -// certain parts of mpl. including this here makes sure that happens #include #include -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x560 ) -#include -#endif #include #include diff --git a/src/xml_wiarchive.cpp b/src/xml_wiarchive.cpp index 02665488..704ddb07 100644 --- a/src/xml_wiarchive.cpp +++ b/src/xml_wiarchive.cpp @@ -21,13 +21,6 @@ #define BOOST_WARCHIVE_SOURCE -// the following works around an issue between spirit 1.61 and borland. -// it turns out the the certain spirit stuff must be defined before -// certain parts of mpl. including this here makes sure that happens -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x560 ) -#include -#endif - #include #include diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index c993a0f7..d52daac3 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -110,6 +110,7 @@ test-suite "serialization" : [ test-bsl-run_files test_shared_ptr_132 ] [ test-bsl-run_polymorphic_archive test_polymorphic : test_polymorphic_A A ] [ test-bsl-run_polymorphic_archive test_polymorphic2 : test_polymorphic2imp ] + [ test-bsl-run_polymorphic_archive test_polymorphic_helper ] ; if ! $(BOOST_ARCHIVE_LIST) { @@ -139,7 +140,7 @@ if ! $(BOOST_ARCHIVE_LIST) { : ../../config/test/all//BOOST_NO_STD_WSTREAMBUF ] - [ test-bsl-run-no-lib test_z ] + #[ test-bsl-run-no-lib test_z ] # should fail compilation [ compile-fail test_not_serializable.cpp ] diff --git a/test/test_codecvt_null.cpp b/test/test_codecvt_null.cpp index 40abd888..bd20f1b4 100644 --- a/test/test_codecvt_null.cpp +++ b/test/test_codecvt_null.cpp @@ -83,13 +83,7 @@ int test_main( int /* argc */, char* /* argv */[] ) { ofs.open(testfile, std::ios::binary); std::copy( td::wchar_encoding, - #if ! defined(__BORLANDC__) - // borland 5.60 complains about this - td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t), - #else - // so use this instead - td::wchar_encoding + 6, - #endif + td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t), boost::archive::iterators::ostream_iterator(ofs) ); } @@ -100,13 +94,7 @@ int test_main( int /* argc */, char* /* argv */[] ) { ifs.open(testfile, std::ios::binary); ok = std::equal( td::wchar_encoding, - #if ! defined(__BORLANDC__) - // borland 5.60 complains about this - td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t), - #else - // so use this instead - td::wchar_encoding + 6, - #endif + td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t), boost::archive::iterators::istream_iterator(ifs) ); } diff --git a/test/test_iterators.cpp b/test/test_iterators.cpp index ef0ac424..b2f3df78 100644 --- a/test/test_iterators.cpp +++ b/test/test_iterators.cpp @@ -42,8 +42,8 @@ void test_wchar_from_mb(const wchar_t *la, const char * a, const unsigned int si typedef boost::archive::iterators::wchar_from_mb translator; BOOST_CHECK(( std::equal( - translator(BOOST_MAKE_PFTO_WRAPPER(a)), - translator(BOOST_MAKE_PFTO_WRAPPER(a + size)), + translator(a), + translator(a + size), la ) )); @@ -53,8 +53,8 @@ void test_mb_from_wchar(const char * a, const wchar_t *la, const unsigned int si typedef boost::archive::iterators::mb_from_wchar translator; BOOST_CHECK( std::equal( - translator(BOOST_MAKE_PFTO_WRAPPER(la)), - translator(BOOST_MAKE_PFTO_WRAPPER(la + size)), + translator(la), + translator(la + size), a ) ); @@ -72,8 +72,8 @@ void test_xml_escape( BOOST_CHECK( std::equal( - translator(BOOST_MAKE_PFTO_WRAPPER(xml)), - translator(BOOST_MAKE_PFTO_WRAPPER(xml + size)), + translator(xml), + translator(xml + size), xml_escaped ) ); @@ -91,8 +91,8 @@ void test_xml_unescape( BOOST_CHECK( std::equal( - translator(BOOST_MAKE_PFTO_WRAPPER(xml_escaped)), - translator(BOOST_MAKE_PFTO_WRAPPER(xml_escaped + size)), + translator(xml_escaped), + translator(xml_escaped + size), xml ) ); @@ -115,8 +115,8 @@ void test_transform_width(unsigned int size){ std::vector vout; std::copy( - translator1(BOOST_MAKE_PFTO_WRAPPER(static_cast(rawdata))), - translator1(BOOST_MAKE_PFTO_WRAPPER(rawdata + size)), + translator1(static_cast(rawdata)), + translator1(rawdata + size), std::back_inserter(vout) ); @@ -132,8 +132,8 @@ void test_transform_width(unsigned int size){ std::vector vin; std::copy( - translator2(BOOST_MAKE_PFTO_WRAPPER(vout.begin())), - translator2(BOOST_MAKE_PFTO_WRAPPER(vout.end())), + translator2(vout.begin()), + translator2(vout.end()), std::back_inserter(vin) ); diff --git a/test/test_iterators_base64.cpp b/test/test_iterators_base64.cpp index ebddf85d..cdfeabce 100644 --- a/test/test_iterators_base64.cpp +++ b/test/test_iterators_base64.cpp @@ -24,8 +24,6 @@ namespace std{ } #endif -#include - #include #include #include @@ -61,8 +59,8 @@ void test_base64(unsigned int size){ translate_out; std::copy( - translate_out(BOOST_MAKE_PFTO_WRAPPER(static_cast(rawdata))), - translate_out(BOOST_MAKE_PFTO_WRAPPER(rawdata + size)), + translate_out(static_cast(rawdata)), + translate_out(rawdata + size), std::back_inserter(text_base64) ); @@ -82,7 +80,7 @@ void test_base64(unsigned int size){ std::equal( rawdata, rawdata + size, - translate_in(BOOST_MAKE_PFTO_WRAPPER(text_base64.begin())) + translate_in(text_base64.begin()) ) ); diff --git a/test/test_non_default_ctor.cpp b/test/test_non_default_ctor.cpp index 76b16c2c..9a656f18 100644 --- a/test/test_non_default_ctor.cpp +++ b/test/test_non_default_ctor.cpp @@ -128,7 +128,7 @@ template inline void save_construct_data( Archive & ar, const A * a, - const BOOST_PFTO unsigned int /* file_version */ + const unsigned int /* file_version */ ){ // variable used for construction ar << boost::serialization::make_nvp("i", a->get_i()); diff --git a/test/test_non_default_ctor2.cpp b/test/test_non_default_ctor2.cpp index ed718382..392bb52a 100644 --- a/test/test_non_default_ctor2.cpp +++ b/test/test_non_default_ctor2.cpp @@ -99,7 +99,7 @@ template void save_construct_data( ArchiveT& archive, const A* p, - const BOOST_PFTO unsigned int /*version*/ + const unsigned int /*version*/ ){ archive & boost::serialization::make_nvp("initialValue", p->value); } diff --git a/test/test_polymorphic.cpp b/test/test_polymorphic.cpp index 1e501c68..33957e1c 100644 --- a/test/test_polymorphic.cpp +++ b/test/test_polymorphic.cpp @@ -73,7 +73,7 @@ int test_main(int /* argc */, char * /* argv */ []) BOOST_CHECK(d == d1); std::remove(testfile); - // test using using polymorphic implementation. + // test using using polymorphic interface. { test_ostream os(testfile, TEST_STREAM_FLAGS); boost::archive::polymorphic_oarchive * oa_implementation diff --git a/test/test_polymorphic_helper.cpp b/test/test_polymorphic_helper.cpp new file mode 100644 index 00000000..0d68588e --- /dev/null +++ b/test/test_polymorphic_helper.cpp @@ -0,0 +1,160 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_polymorphic.cpp + +// (C) Copyright 2002 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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +// the following is to ensure that when one of the libraries changes +// BJAM rebuilds and relinks the test. +/* +#include "polymorphic_text_archive.hpp" +#include "polymorphic_text_warchive.hpp" +#include "polymorphic_binary_archive.hpp" +#include "polymorphic_xml_archive.hpp" +#include "polymorphic_xml_warchive.hpp" +*/ + +#include +#include + +#include "test_tools.hpp" +#include +#include +#include +#include +// this test uses a special string (my_string) whose contents are shared +// and hence saved in the archive only once. We need a helper in order +// to convert my_string into a serializable type + +class my_string:public std::string +{ + typedef std::string super; + +public: + my_string(){} + my_string(const super & str): super(str){} + my_string & operator=(const super& rhs) { + super::operator=(rhs); + return *this; + } +}; + +struct my_string_helper +{ + typedef std::vector table; + table m_t; +}; + +BOOST_SERIALIZATION_SPLIT_FREE(my_string) + +namespace boost { +namespace serialization { + +template +void save(Archive & ar, const my_string & str, const unsigned int /* version */) +{ + void (* const idx)(Archive &, const my_string &, const unsigned int) = & save; + void * const id = reinterpret_cast(idx); + my_string_helper & msh = ar.template get_helper(id); + + my_string_helper::table t = msh.m_t; + my_string_helper::table::iterator it = std::find(t.begin(), t.end(), str); + if(it == t.end()){ + my_string_helper::table::size_type s = t.size(); + ar << make_nvp("index", s); + t.push_back(str); + ar << make_nvp("string", static_cast(str)); + } + else{ + my_string_helper::table::size_type s = it - t.begin(); + ar << make_nvp("index", s); + } +} + +template +void load(Archive & ar, my_string & str, const unsigned int /* version */) +{ + void (* const idx)(Archive &, my_string &, const unsigned int) = & load; + void * const id = reinterpret_cast(idx); + my_string_helper & msh = ar.template get_helper(id); + + my_string_helper::table t = msh.m_t; + + my_string_helper::table::size_type s; + ar >> make_nvp("index", s); + t.reserve(s); + if(s >= t.size()){ + std::string tmp; + ar >> make_nvp("string", tmp); + str = tmp; + t.push_back(str); + } + else{ + str = t[s]; + } +} + +} // namespace serialization +} // namespace boost +#include +#include + +int test_main(int /* argc */, char * /* argv */ []) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + std::vector v1; + for(int i=0; i<1000; ++i){ + v1.push_back(my_string(boost::lexical_cast(i % 100))); + } + + // test using using polymorphic implementation. + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa_implementation(os, TEST_ARCHIVE_FLAGS); + oa_implementation << boost::serialization::make_nvp("vector", v1); + } + { + std::vector v2; + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia_implementation(is, TEST_ARCHIVE_FLAGS); + ia_implementation >> boost::serialization::make_nvp("vector", v2); + BOOST_CHECK(v1 == v2); + } + std::remove(testfile); + + // test using using polymorphic interface. + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa_implementation(os, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_oarchive & oa_interface = oa_implementation; + oa_interface << boost::serialization::make_nvp("vector", v1); + } + { + std::vector v2; + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia_implementation(is, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_iarchive & ia_interface = ia_implementation; + ia_interface >> boost::serialization::make_nvp("vector", v2); + BOOST_CHECK(v1 == v2); + } + std::remove(testfile); + std::remove(testfile); + return EXIT_SUCCESS; +} diff --git a/test/test_private_ctor.cpp b/test/test_private_ctor.cpp index 72b3904f..f07658ec 100644 --- a/test/test_private_ctor.cpp +++ b/test/test_private_ctor.cpp @@ -16,6 +16,7 @@ #include class V { +private: friend int test_main(int /* argc */, char * /* argv */[]); friend class boost::serialization::access; int m_i; @@ -28,6 +29,7 @@ class V { { ar & m_i; } +public: bool operator==(const V & v) const { return m_i == v.m_i; } @@ -47,5 +49,18 @@ int test_main(int /* argc */, char * /* argv */[]) ia >> v1; } BOOST_CHECK(v == v1); + + const V *vptr = & v; + { + boost::archive::text_oarchive oa(ss); + oa << vptr; + } + V *vptr1; + { + boost::archive::text_iarchive ia(ss); + ia >> vptr1; + } + BOOST_CHECK(*vptr == *vptr1); + return EXIT_SUCCESS; } diff --git a/test/test_utf8_codecvt.cpp b/test/test_utf8_codecvt.cpp index 3d35b5e1..36a8e8e7 100644 --- a/test/test_utf8_codecvt.cpp +++ b/test/test_utf8_codecvt.cpp @@ -142,13 +142,7 @@ test_main(int /* argc */, char * /* argv */[]) { ofs.open("test.dat"); std::copy( td::utf8_encoding, - #if ! defined(__BORLANDC__) - // borland 5.60 complains about this - td::utf8_encoding + sizeof(td::utf8_encoding) / sizeof(unsigned char), - #else - // so use this instead - td::utf8_encoding + 12, - #endif + td::utf8_encoding + sizeof(td::utf8_encoding) / sizeof(unsigned char), std::ostream_iterator(ofs) ); } @@ -174,15 +168,6 @@ test_main(int /* argc */, char * /* argv */[]) { } } - // compare the data read back in with the orginal - #if ! defined(__BORLANDC__) - // borland 5.60 complains about this - BOOST_CHECK(from_file.size() == sizeof(td::wchar_encoding)/sizeof(wchar_t)); - #else - // so use this instead - BOOST_CHECK(from_file.size() == 6); - #endif - BOOST_CHECK(std::equal(from_file.begin(), from_file.end(), td::wchar_encoding)); // Send the UCS4_data back out, converting to UTF-8 diff --git a/test/test_vector.cpp b/test/test_vector.cpp index b5f72a84..3d602550 100644 --- a/test/test_vector.cpp +++ b/test/test_vector.cpp @@ -18,25 +18,23 @@ namespace std{ using ::remove; } #endif - +#include #include "test_tools.hpp" #include +// normal class with default constructor #include "A.hpp" #include "A.ipp" template -int test_vector() +int test_vector_detail(const std::vector & avector) { const char * testfile = boost::archive::tmpnam(NULL); BOOST_REQUIRE(NULL != testfile); // test array of objects - std::vector< T > avector; - avector.push_back(T()); - avector.push_back(T()); - { + { test_ostream os(testfile, TEST_STREAM_FLAGS); test_oarchive oa(os, TEST_ARCHIVE_FLAGS); oa << boost::serialization::make_nvp("avector", avector); @@ -52,16 +50,79 @@ int test_vector() return EXIT_SUCCESS; } +template +int test_default_constructible() +{ + // test array of objects + std::vector avector; + avector.push_back(T()); + avector.push_back(T()); + return test_vector_detail(avector); +} + +// class without default constructor +struct X { + //BOOST_DELETED_FUNCTION(X()); +public: + int m_i; + X(const X & x) : + m_i(x.m_i) + {} + X(const int & i) : + m_i(i) + {} + bool operator==(const X & rhs) const { + return m_i == rhs.m_i; + } + template + void serialize(Archive & ar, const unsigned int version){ + ar & BOOST_SERIALIZATION_NVP(m_i); + } +}; + +template +inline void save_construct_data( + Archive & ar, + const X * x, + const unsigned int /* file_version */ +){ + // variable used for construction + ar << boost::serialization::make_nvp("i", x->m_i); +} + +template +inline void load_construct_data( + Archive & ar, + X * x, + const unsigned int /* file_version */ +){ + int i; + ar >> boost::serialization::make_nvp("i", i); + ::new(x)X(i); +} + +int test_non_default_constructible() +{ + // test array of objects + std::vector avector; + avector.push_back(X(123)); + avector.push_back(X(456)); + return test_vector_detail(avector); +} + int test_main( int /* argc */, char* /* argv */[] ) { - int res = test_vector(); + int res; + res = test_default_constructible(); // test an int vector for which optimized versions should be available - if (res == EXIT_SUCCESS) - res = test_vector(); + if (res == EXIT_SUCCESS) + res = test_default_constructible(); // test a bool vector - if (res == EXIT_SUCCESS) - res = test_vector(); - return res; + if (res == EXIT_SUCCESS) + res = test_default_constructible(); + if (res == EXIT_SUCCESS) + res = test_non_default_constructible(); + return res; } // EOF diff --git a/test/test_z.cpp b/test/test_z.cpp index d76d7cfc..33c14ce1 100644 --- a/test/test_z.cpp +++ b/test/test_z.cpp @@ -1,45 +1,3 @@ - -/* -#include - -#include -#include - -struct A { - A(); -}; - -struct NA { - NA(int); -}; - -#ifndef BOOST_NO_CXX11_HDR_TYPE_TRAITS - #pragma message("BOOST_NO_CXX11_HDR_TYPE_TRAITS NOT defined") -#else - #pragma message("BOOST_NO_CXX11_HDR_TYPE_TRAITS defined") -#endif - -int main(int argc, char * argv[]){ - static_assert( - std::is_default_constructible::value, - "A is NOT default constructible" - ); - static_assert( - ! std::is_default_constructible::value, - "NA IS default constructible" - ); - - std::cout << std::boolalpha - << "A is default-constructible? " - << std::is_default_constructible::value << '\n' - << "A is trivially default-constructible? " - << std::is_trivially_default_constructible::value << '\n' - << "NA is default-constructible? " - << std::is_default_constructible::value << '\n' - << "NA is trivially default-constructible? " - << std::is_trivially_default_constructible::value << '\n' - ; +int main() { return 0; } -*/ -#include "../../config/test/config_info.cpp"