Skip to content

Commit

Permalink
Updated boost to 1.45.0; removed spirit, added a lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
taxilian committed Jan 11, 2011
1 parent 055d2f5 commit e3bcb41
Show file tree
Hide file tree
Showing 2,424 changed files with 123,496 additions and 142,419 deletions.
2 changes: 1 addition & 1 deletion boost/algorithm/string/detail/find_format_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace boost {
};

template<typename InputT, typename FindResultT>
bool check_find_result(InputT& Input, FindResultT& FindResult)
bool check_find_result(InputT&, FindResultT& FindResult)
{
typedef BOOST_STRING_TYPENAME
range_const_iterator<InputT>::type input_iterator_type;
Expand Down
23 changes: 19 additions & 4 deletions boost/archive/basic_archive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class library_version_type {
return *this;
}
// used for text output
operator const base_type () const {
operator base_type () const {
return t;
}
// used for text input
Expand Down Expand Up @@ -90,7 +90,7 @@ class version_type {
return *this;
}
// used for text output
operator const base_type () const {
operator base_type () const {
return t;
}
// used for text intput
Expand Down Expand Up @@ -127,7 +127,7 @@ class class_id_type {
}

// used for text output
operator const int () const {
operator int () const {
return t;
}
// used for text input
Expand Down Expand Up @@ -161,7 +161,7 @@ class object_id_type {
return *this;
}
// used for text output
operator const uint_least32_t () const {
operator uint_least32_t () const {
return t;
}
// used for text input
Expand Down Expand Up @@ -282,4 +282,19 @@ BOOST_CLASS_IMPLEMENTATION(boost::archive::object_id_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::object_reference_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type, primitive_type)

#include <boost/serialization/is_bitwise_serializable.hpp>

// set types used internally by the serialization library
// to be bitwise serializable

BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::library_version_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::version_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_reference_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_optional_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_name_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_id_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_reference_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::tracking_type)

#endif //BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
71 changes: 65 additions & 6 deletions boost/archive/basic_binary_iarchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/item_version_type.hpp>
#include <boost/integer_traits.hpp>

#ifdef BOOST_MSVC
# pragma warning(push)
Expand Down Expand Up @@ -71,7 +72,7 @@ class basic_binary_iarchive :

// include these to trap a change in binary format which
// isn't specifically handled
BOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(char));
BOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(bool));
// upto 32K classes
BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t));
BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t));
Expand All @@ -82,28 +83,86 @@ class basic_binary_iarchive :
// binary files don't include the optional information
void load_override(class_id_optional_type & /* t */, int){}

void load_override(boost::serialization::item_version_type & t, int version){
if(library_version_type(6) < this->get_library_version()){
void load_override(class_id_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_type(x);
}
else{
unsigned int x=0;
int x=0;
* this->This() >> x;
t = boost::serialization::item_version_type(x);
t = boost::archive::class_id_type(x);
}
}
void load_override(class_id_reference_type & t, int version){
load_override(static_cast<class_id_type &>(t), version);
}
#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){
if(boost::archive::library_version_type(6) < this->get_library_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){
uint_least16_t x=0;
* this->This() >> x;
t = boost::archive::version_type(x);
}
else{
unsigned int x=0;
* this->This() >> x;
t = boost::archive::version_type(x);
}
}

void load_override(boost::serialization::item_version_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){
uint_least16_t x=0;
* this->This() >> x;
t = boost::serialization::item_version_type(x);
}
else{
unsigned int x=0;
* this->This() >> x;
t = boost::serialization::item_version_type(x);
}
}

void load_override(serialization::collection_size_type & t, int version){
if(boost::archive::library_version_type(5) < this->get_library_version()){
this->detail_common_iarchive::load_override(t, version);
Expand Down
4 changes: 2 additions & 2 deletions boost/archive/basic_binary_iprimitive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ class basic_binary_iprimitive
template <class T>
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
struct apply {
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable<T>::type type;
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type;
};
#else
struct apply : public boost::serialization::is_bitwise_serializable<T> {};
struct apply : public boost::serialization::is_bitwise_serializable< T > {};
#endif
};

Expand Down
53 changes: 49 additions & 4 deletions boost/archive/basic_binary_oarchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <boost/archive/detail/common_oarchive.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/item_version_type.hpp>

#include <boost/archive/detail/abi_prefix.hpp> // must be the last header

Expand Down Expand Up @@ -76,7 +77,7 @@ class basic_binary_oarchive :

// include these to trap a change in binary format which
// isn't specifically handled
BOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(char));
BOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(bool));
// upto 32K classes
BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t));
BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t));
Expand All @@ -87,14 +88,58 @@ class basic_binary_oarchive :
// binary files don't include the optional information
void save_override(const class_id_optional_type & /* t */, int){}

#if 0 // enable this if we decide to support generation of previous versions
// enable this if we decide to support generation of previous versions
#if 0
void save_override(const boost::archive::version_type & t, int version){
if(this->get_library_version() < boost::archive::library_version_type(7)){
* this->This() << static_cast<int_least16_t >(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);
}
else
if(boost::archive::library_version_type(6) < lvt){
const boost::uint_least16_t x = t;
* this->This() << x;
}
else{
const unsigned int x = t;
* this->This() << x;
}
}
void save_override(const boost::serialization::item_version_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_oarchive::save_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
const boost::uint_least16_t x = t;
* this->This() << x;
}
else{
const unsigned int x = t;
* this->This() << x;
}
}

void save_override(class_id_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_oarchive::save_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
const boost::int_least16_t x = t;
* this->This() << x;
}
else{
const int x = t;
* this->This() << x;
}
}
void save_override(class_id_reference_type & t, int version){
save_override(static_cast<class_id_type &>(t), version);
}

#endif

// explicitly convert to char * to avoid compile ambiguities
Expand Down
4 changes: 2 additions & 2 deletions boost/archive/basic_binary_oprimitive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ class basic_binary_oprimitive
template <class T>
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
struct apply {
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable<T>::type type;
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type;
};
#else
struct apply : public boost::serialization::is_bitwise_serializable<T> {};
struct apply : public boost::serialization::is_bitwise_serializable< T > {};
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions boost/archive/basic_xml_iarchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class basic_xml_iarchive :
// 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>));
BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
this->detail_common_iarchive::load_override(t, 0);
}

Expand All @@ -79,7 +79,7 @@ class basic_xml_iarchive :
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
const
#endif
boost::serialization::nvp<T> & t,
boost::serialization::nvp< T > & t,
int
){
this->This()->load_start(t.name());
Expand Down
4 changes: 2 additions & 2 deletions boost/archive/basic_xml_oarchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class basic_xml_oarchive :
// 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>));
BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
this->detail_common_oarchive::save_override(t, 0);
}

Expand All @@ -100,7 +100,7 @@ class basic_xml_oarchive :
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
const
#endif
::boost::serialization::nvp<T> & t,
::boost::serialization::nvp< T > & t,
int
){
this->This()->save_start(t.name());
Expand Down
20 changes: 10 additions & 10 deletions boost/archive/detail/check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ template<class T>
inline void check_object_level(){
typedef
BOOST_DEDUCED_TYPENAME mpl::greater_equal<
serialization::implementation_level<T>,
serialization::implementation_level< T >,
mpl::int_<serialization::primitive_type>
>::type typex;

Expand All @@ -65,11 +65,11 @@ inline void check_object_versioning(){
typedef
BOOST_DEDUCED_TYPENAME mpl::or_<
BOOST_DEDUCED_TYPENAME mpl::greater<
serialization::implementation_level<T>,
serialization::implementation_level< T >,
mpl::int_<serialization::object_serializable>
>,
BOOST_DEDUCED_TYPENAME mpl::equal_to<
serialization::version<T>,
serialization::version< T >,
mpl::int_<0>
>
> typex;
Expand All @@ -82,9 +82,9 @@ template<class T>
inline void check_object_tracking(){
// presume it has already been determined that
// T is not a const
BOOST_STATIC_ASSERT(! boost::is_const<T>::value);
BOOST_STATIC_ASSERT(! boost::is_const< T >::value);
typedef BOOST_DEDUCED_TYPENAME mpl::equal_to<
serialization::tracking_level<T>,
serialization::tracking_level< T >,
mpl::int_<serialization::track_never>
>::type typex;
// saving an non-const object of a type not marked "track_never)
Expand All @@ -107,12 +107,12 @@ inline void check_pointer_level(){
typedef
BOOST_DEDUCED_TYPENAME mpl::or_<
BOOST_DEDUCED_TYPENAME mpl::greater<
serialization::implementation_level<T>,
serialization::implementation_level< T >,
mpl::int_<serialization::object_serializable>
>,
BOOST_DEDUCED_TYPENAME mpl::not_<
BOOST_DEDUCED_TYPENAME mpl::equal_to<
serialization::tracking_level<T>,
serialization::tracking_level< T >,
mpl::int_<serialization::track_selectively>
>
>
Expand Down Expand Up @@ -140,7 +140,7 @@ inline void check_pointer_level(){
template<class T>
void inline check_pointer_tracking(){
typedef BOOST_DEDUCED_TYPENAME mpl::greater<
serialization::tracking_level<T>,
serialization::tracking_level< T >,
mpl::int_<serialization::track_never>
>::type typex;
// serializing an object of a type marked "track_never" through a pointer
Expand All @@ -152,9 +152,9 @@ template<class T>
inline void check_const_loading(){
typedef
BOOST_DEDUCED_TYPENAME mpl::or_<
BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper<T>,
BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper< T >,
BOOST_DEDUCED_TYPENAME mpl::not_<
BOOST_DEDUCED_TYPENAME boost::is_const<T>
BOOST_DEDUCED_TYPENAME boost::is_const< T >
>
>::type typex;
// cannot load data into a "const" object unless it's a
Expand Down
Loading

0 comments on commit e3bcb41

Please sign in to comment.