Merge branch 'feat-refactor' into develop

This commit is contained in:
Bill Somerville 2019-07-04 13:16:03 +01:00
commit 0c49f6f872
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
6098 changed files with 119250 additions and 872434 deletions

4
.gitignore vendored
View File

@ -7,4 +7,6 @@ jnq*
*.exe *.exe
*.o *.o
*.mod *.mod
*.pro.user *.pro.user
cmake-build-debug
cmake-build-release

View File

@ -1,10 +1,10 @@
#include "AudioDevice.hpp" #include "AudioDevice.hpp"
bool AudioDevice::initialize (OpenMode mode, Channel channel) bool AudioDevice::initialize (OpenMode mode, Channel channel)
{ {
m_channel = channel; m_channel = channel;
// open and ensure we are unbuffered if possible // open and ensure we are unbuffered if possible
return QIODevice::open (mode | QIODevice::Unbuffered); return QIODevice::open (mode | QIODevice::Unbuffered);
} }

View File

@ -38,7 +38,7 @@ namespace
{ {
auto end = reinterpret_cast<char const *> (::memchr (id, '\0', 4u)); auto end = reinterpret_cast<char const *> (::memchr (id, '\0', 4u));
auto len = end ? end - id : 4u; auto len = end ? end - id : 4u;
memcpy (id_.data (), id, len); ::memcpy (id_.data (), id, len);
if (len < 4u) if (len < 4u)
{ {
memset (id_.data () + len, ' ', 4u - len); memset (id_.data () + len, ' ', 4u - len);
@ -46,7 +46,7 @@ namespace
} }
else else
{ {
memcpy (id_.data (), "JUNK", 4u); ::memcpy (id_.data (), "JUNK", 4u);
} }
} }
@ -86,12 +86,12 @@ namespace
{ {
// set some sensible defaults for the "bext" fields // set some sensible defaults for the "bext" fields
auto now = QDateTime::currentDateTimeUtc (); auto now = QDateTime::currentDateTimeUtc ();
std::strncpy (origination_date_, ::memcpy (origination_date_,
now.date ().toString ("yyyy-MM-dd").toLocal8Bit ().constData (), now.date ().toString ("yyyy-MM-dd").toLocal8Bit ().constData (),
sizeof origination_date_); sizeof origination_date_);
std::strncpy (origination_time_, ::memcpy (origination_time_,
now.time ().toString ("hh-mm-ss").toLocal8Bit ().constData (), now.time ().toString ("hh-mm-ss").toLocal8Bit ().constData (),
sizeof origination_time_); sizeof origination_time_);
auto uuid = QUuid::createUuid ().toRfc4122 (); auto uuid = QUuid::createUuid ().toRfc4122 ();
std::copy (uuid.cbegin (), uuid.cend (), umid_.data () + 16); std::copy (uuid.cbegin (), uuid.cend (), umid_.data () + 16);
} }
@ -354,6 +354,7 @@ bool BWFFile::impl::update_header ()
{ {
case BextVersion::v_0: case BextVersion::v_0:
data->version_ = qToBigEndian<quint32> (data->version_); data->version_ = qToBigEndian<quint32> (data->version_);
// fall through
default: default:
data->loudness_value_ = qToBigEndian<quint16> (data->loudness_value_); data->loudness_value_ = qToBigEndian<quint16> (data->loudness_value_);
data->loudness_range_ = qToBigEndian<quint16> (data->loudness_range_); data->loudness_range_ = qToBigEndian<quint16> (data->loudness_range_);
@ -370,6 +371,7 @@ bool BWFFile::impl::update_header ()
{ {
case BextVersion::v_0: case BextVersion::v_0:
data->version_ = qToLittleEndian<quint32> (data->version_); data->version_ = qToLittleEndian<quint32> (data->version_);
// fall through
default: default:
data->loudness_value_ = qToLittleEndian<quint16> (data->loudness_value_); data->loudness_value_ = qToLittleEndian<quint16> (data->loudness_value_);
data->loudness_range_ = qToLittleEndian<quint16> (data->loudness_range_); data->loudness_range_ = qToLittleEndian<quint16> (data->loudness_range_);
@ -686,7 +688,7 @@ QByteArray BWFFile::bext_description () const
void BWFFile::bext_description (QByteArray const& description) void BWFFile::bext_description (QByteArray const& description)
{ {
m_->header_dirty_ = true; m_->header_dirty_ = true;
std::strncpy (m_->bext ()->description_, description.constData (), sizeof (BroadcastAudioExtension::description_)); ::memcpy (m_->bext ()->description_, description.constData (), sizeof BroadcastAudioExtension::description_);
} }
QByteArray BWFFile::bext_originator () const QByteArray BWFFile::bext_originator () const
@ -698,7 +700,7 @@ QByteArray BWFFile::bext_originator () const
void BWFFile::bext_originator (QByteArray const& originator) void BWFFile::bext_originator (QByteArray const& originator)
{ {
m_->header_dirty_ = true; m_->header_dirty_ = true;
std::strncpy (m_->bext ()->originator_, originator.constData (), sizeof (BroadcastAudioExtension::originator_)); ::memcpy (m_->bext ()->originator_, originator.constData (), sizeof BroadcastAudioExtension::originator_);
} }
QByteArray BWFFile::bext_originator_reference () const QByteArray BWFFile::bext_originator_reference () const
@ -710,7 +712,7 @@ QByteArray BWFFile::bext_originator_reference () const
void BWFFile::bext_originator_reference (QByteArray const& reference) void BWFFile::bext_originator_reference (QByteArray const& reference)
{ {
m_->header_dirty_ = true; m_->header_dirty_ = true;
std::strncpy (m_->bext ()->originator_reference_, reference.constData (), sizeof (BroadcastAudioExtension::originator_reference_)); ::memcpy (m_->bext ()->originator_reference_, reference.constData (), sizeof BroadcastAudioExtension::originator_reference_);
} }
QDateTime BWFFile::bext_origination_date_time () const QDateTime BWFFile::bext_origination_date_time () const
@ -723,12 +725,12 @@ QDateTime BWFFile::bext_origination_date_time () const
void BWFFile::bext_origination_date_time (QDateTime const& dt) void BWFFile::bext_origination_date_time (QDateTime const& dt)
{ {
m_->header_dirty_ = true; m_->header_dirty_ = true;
std::strncpy (m_->bext ()->origination_date_, ::memcpy (m_->bext ()->origination_date_,
dt.date ().toString ("yyyy-MM-dd").toLocal8Bit ().constData (), dt.date ().toString ("yyyy-MM-dd").toLocal8Bit ().constData (),
sizeof (BroadcastAudioExtension::origination_date_)); sizeof BroadcastAudioExtension::origination_date_);
std::strncpy (m_->bext ()->origination_time_, ::memcpy (m_->bext ()->origination_time_,
dt.time ().toString ("hh-mm-ss").toLocal8Bit ().constData (), dt.time ().toString ("hh-mm-ss").toLocal8Bit ().constData (),
sizeof (BroadcastAudioExtension::origination_time_)); sizeof BroadcastAudioExtension::origination_time_);
} }
quint64 BWFFile::bext_time_reference () const quint64 BWFFile::bext_time_reference () const

View File

@ -9,7 +9,7 @@
#include <QPointer> #include <QPointer>
#include <QAudioInput> #include <QAudioInput>
#include "AudioDevice.hpp" #include "Audio/AudioDevice.hpp"
class QAudioDeviceInfo; class QAudioDeviceInfo;
class QAudioInput; class QAudioInput;

View File

@ -226,7 +226,7 @@ set (wsjt_qt_CXXSRCS
qt_helpers.cpp qt_helpers.cpp
widgets/MessageBox.cpp widgets/MessageBox.cpp
MetaDataRegistry.cpp MetaDataRegistry.cpp
NetworkServerLookup.cpp Network/NetworkServerLookup.cpp
revision_utils.cpp revision_utils.cpp
WFPalette.cpp WFPalette.cpp
Radio.cpp Radio.cpp
@ -243,17 +243,17 @@ set (wsjt_qt_CXXSRCS
validators/LiveFrequencyValidator.cpp validators/LiveFrequencyValidator.cpp
GetUserId.cpp GetUserId.cpp
TraceFile.cpp TraceFile.cpp
AudioDevice.cpp Audio/AudioDevice.cpp
Transceiver.cpp Transceiver/Transceiver.cpp
TransceiverBase.cpp Transceiver/TransceiverBase.cpp
EmulateSplitTransceiver.cpp Transceiver/EmulateSplitTransceiver.cpp
TransceiverFactory.cpp Transceiver/TransceiverFactory.cpp
PollingTransceiver.cpp Transceiver/PollingTransceiver.cpp
HamlibTransceiver.cpp Transceiver/HamlibTransceiver.cpp
HRDTransceiver.cpp Transceiver/HRDTransceiver.cpp
DXLabSuiteCommanderTransceiver.cpp Transceiver/DXLabSuiteCommanderTransceiver.cpp
NetworkMessage.cpp Network/NetworkMessage.cpp
MessageClient.cpp Network/MessageClient.cpp
widgets/LettersSpinBox.cpp widgets/LettersSpinBox.cpp
widgets/HintedSpinBox.cpp widgets/HintedSpinBox.cpp
widgets/RestrictedSpinBox.cpp widgets/RestrictedSpinBox.cpp
@ -271,7 +271,7 @@ set (wsjt_qt_CXXSRCS
EqualizationToolsDialog.cpp EqualizationToolsDialog.cpp
widgets/DoubleClickablePushButton.cpp widgets/DoubleClickablePushButton.cpp
widgets/DoubleClickableRadioButton.cpp widgets/DoubleClickableRadioButton.cpp
LotWUsers.cpp Network/LotWUsers.cpp
models/DecodeHighlightingModel.cpp models/DecodeHighlightingModel.cpp
widgets/DecodeHighlightingListView.cpp widgets/DecodeHighlightingListView.cpp
models/FoxLog.cpp models/FoxLog.cpp
@ -303,15 +303,15 @@ set (jt9_CXXSRCS
set (wsjtx_CXXSRCS set (wsjtx_CXXSRCS
logbook/logbook.cpp logbook/logbook.cpp
psk_reporter.cpp Network/psk_reporter.cpp
Modulator.cpp Modulator/Modulator.cpp
Detector.cpp Detector/Detector.cpp
widgets/logqso.cpp widgets/logqso.cpp
widgets/displaytext.cpp widgets/displaytext.cpp
decodedtext.cpp Decoder/decodedtext.cpp
getfile.cpp getfile.cpp
soundout.cpp Audio/soundout.cpp
soundin.cpp Audio/soundin.cpp
widgets/meterwidget.cpp widgets/meterwidget.cpp
widgets/signalmeter.cpp widgets/signalmeter.cpp
widgets/plotter.cpp widgets/plotter.cpp
@ -324,12 +324,12 @@ set (wsjtx_CXXSRCS
widgets/astro.cpp widgets/astro.cpp
widgets/messageaveraging.cpp widgets/messageaveraging.cpp
widgets/colorhighlighting.cpp widgets/colorhighlighting.cpp
WsprTxScheduler.cpp WSPR/WsprTxScheduler.cpp
widgets/mainwindow.cpp widgets/mainwindow.cpp
Configuration.cpp Configuration.cpp
main.cpp main.cpp
wsprnet.cpp Network/wsprnet.cpp
WSPRBandHopping.cpp WSPR/WSPRBandHopping.cpp
widgets/ExportCabrillo.cpp widgets/ExportCabrillo.cpp
) )
@ -353,7 +353,7 @@ if (WIN32)
set (wsjt_qt_CXXSRCS set (wsjt_qt_CXXSRCS
${wsjt_qt_CXXSRCS} ${wsjt_qt_CXXSRCS}
OmniRigTransceiver.cpp Transceiver/OmniRigTransceiver.cpp
) )
endif (WIN32) endif (WIN32)
@ -682,13 +682,13 @@ set (wsjtx_UISRCS
set (UDP_library_CXXSRCS set (UDP_library_CXXSRCS
Radio.cpp Radio.cpp
RadioMetaType.cpp RadioMetaType.cpp
NetworkMessage.cpp Network/NetworkMessage.cpp
MessageServer.cpp UDPExamples/MessageServer.cpp
) )
set (UDP_library_HEADERS set (UDP_library_HEADERS
Radio.hpp Radio.hpp
MessageServer.hpp UDPExamples/MessageServer.hpp
${PROJECT_BINARY_DIR}/udp_export.h ${PROJECT_BINARY_DIR}/udp_export.h
) )
@ -919,7 +919,7 @@ set (CMAKE_VISIBILITY_INLINES_HIDDEN ON)
# #
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fexceptions -frtti") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -fexceptions -frtti")
if (NOT APPLE) if (NOT APPLE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas")
@ -1099,7 +1099,7 @@ set (LANGUAGES
foreach (lang_ ${LANGUAGES}) foreach (lang_ ${LANGUAGES})
file (TO_NATIVE_PATH translations/wsjtx_${lang_}.ts ts_) file (TO_NATIVE_PATH translations/wsjtx_${lang_}.ts ts_)
list (APPEND TS_FILES ${ts_}) list (APPEND TS_FILES ${ts_})
endforeach () endforeach ()
if (UPDATE_TRANSLATIONS) if (UPDATE_TRANSLATIONS)
message (STATUS "UPDATE_TRANSLATIONS option is set.") message (STATUS "UPDATE_TRANSLATIONS option is set.")
qt5_create_translation ( qt5_create_translation (

View File

@ -172,18 +172,18 @@
#include "item_delegates/ForeignKeyDelegate.hpp" #include "item_delegates/ForeignKeyDelegate.hpp"
#include "item_delegates/FrequencyDelegate.hpp" #include "item_delegates/FrequencyDelegate.hpp"
#include "item_delegates/FrequencyDeltaDelegate.hpp" #include "item_delegates/FrequencyDeltaDelegate.hpp"
#include "TransceiverFactory.hpp" #include "Transceiver/TransceiverFactory.hpp"
#include "Transceiver.hpp" #include "Transceiver/Transceiver.hpp"
#include "models/Bands.hpp" #include "models/Bands.hpp"
#include "models/IARURegions.hpp" #include "models/IARURegions.hpp"
#include "models/Modes.hpp" #include "models/Modes.hpp"
#include "models/FrequencyList.hpp" #include "models/FrequencyList.hpp"
#include "models/StationList.hpp" #include "models/StationList.hpp"
#include "NetworkServerLookup.hpp" #include "Network/NetworkServerLookup.hpp"
#include "widgets/MessageBox.hpp" #include "widgets/MessageBox.hpp"
#include "validators/MaidenheadLocatorValidator.hpp" #include "validators/MaidenheadLocatorValidator.hpp"
#include "validators/CallsignValidator.hpp" #include "validators/CallsignValidator.hpp"
#include "LotWUsers.hpp" #include "Network/LotWUsers.hpp"
#include "models/DecodeHighlightingModel.hpp" #include "models/DecodeHighlightingModel.hpp"
#include "logbook/logbook.h" #include "logbook/logbook.h"

View File

@ -6,8 +6,8 @@
#include "Radio.hpp" #include "Radio.hpp"
#include "models/IARURegions.hpp" #include "models/IARURegions.hpp"
#include "AudioDevice.hpp" #include "Audio/AudioDevice.hpp"
#include "Transceiver.hpp" #include "Transceiver/Transceiver.hpp"
#include "pimpl_h.hpp" #include "pimpl_h.hpp"

View File

@ -77,7 +77,6 @@ private:
QString string_; QString string_;
int padding_; int padding_;
bool contest_mode_;
QString message_; QString message_;
QString message0_; QString message0_;
bool is_standard_; bool is_standard_;

View File

@ -18,7 +18,6 @@ Detector::Detector (unsigned frameRate, double periodLengthInSeconds,
, m_period (periodLengthInSeconds) , m_period (periodLengthInSeconds)
, m_downSampleFactor (downSampleFactor) , m_downSampleFactor (downSampleFactor)
, m_samplesPerFFT {max_buffer_size} , m_samplesPerFFT {max_buffer_size}
, m_ns (999)
, m_buffer ((downSampleFactor > 1) ? , m_buffer ((downSampleFactor > 1) ?
new short [max_buffer_size * downSampleFactor] : nullptr) new short [max_buffer_size * downSampleFactor] : nullptr)
, m_bufferPos (0) , m_bufferPos (0)

View File

@ -1,6 +1,6 @@
#ifndef DETECTOR_HPP__ #ifndef DETECTOR_HPP__
#define DETECTOR_HPP__ #define DETECTOR_HPP__
#include "AudioDevice.hpp" #include "Audio/AudioDevice.hpp"
#include <QScopedArrayPointer> #include <QScopedArrayPointer>
// //
@ -46,7 +46,6 @@ private:
double m_period; double m_period;
unsigned m_downSampleFactor; unsigned m_downSampleFactor;
qint32 m_samplesPerFFT; // after any down sampling qint32 m_samplesPerFFT; // after any down sampling
qint32 m_ns;
static size_t const max_buffer_size {7 * 512}; static size_t const max_buffer_size {7 * 512};
QScopedArrayPointer<short> m_buffer; // de-interleaved sample buffer QScopedArrayPointer<short> m_buffer; // de-interleaved sample buffer
// big enough for all the // big enough for all the

View File

@ -6,11 +6,11 @@
#include "Radio.hpp" #include "Radio.hpp"
#include "models/FrequencyList.hpp" #include "models/FrequencyList.hpp"
#include "AudioDevice.hpp" #include "Audio/AudioDevice.hpp"
#include "Configuration.hpp" #include "Configuration.hpp"
#include "models/StationList.hpp" #include "models/StationList.hpp"
#include "Transceiver.hpp" #include "Transceiver/Transceiver.hpp"
#include "TransceiverFactory.hpp" #include "Transceiver/TransceiverFactory.hpp"
#include "WFPalette.hpp" #include "WFPalette.hpp"
#include "models/IARURegions.hpp" #include "models/IARURegions.hpp"
#include "models/DecodeHighlightingModel.hpp" #include "models/DecodeHighlightingModel.hpp"

View File

@ -4,7 +4,7 @@
#include <QDateTime> #include <QDateTime>
#include <QDebug> #include <QDebug>
#include "widgets/mainwindow.h" // TODO: G4WJS - break this dependency #include "widgets/mainwindow.h" // TODO: G4WJS - break this dependency
#include "soundout.h" #include "Audio/soundout.h"
#include "commons.h" #include "commons.h"
#include "moc_Modulator.cpp" #include "moc_Modulator.cpp"

View File

@ -4,7 +4,7 @@
#include <QAudio> #include <QAudio>
#include <QPointer> #include <QPointer>
#include "AudioDevice.hpp" #include "Audio/AudioDevice.hpp"
class SoundOutput; class SoundOutput;

View File

@ -66,8 +66,7 @@ network_server_lookup (QString query
{ {
break; break;
} }
// drop through // fall through
case QAbstractSocket::AnyIPProtocol: case QAbstractSocket::AnyIPProtocol:
found = true; found = true;
break; break;

View File

@ -8,7 +8,7 @@
#include <QHostInfo> #include <QHostInfo>
#include <QTimer> #include <QTimer>
#include "MessageClient.hpp" #include "Network/MessageClient.hpp"
#include "moc_psk_reporter.cpp" #include "moc_psk_reporter.cpp"

View File

@ -54,7 +54,7 @@ Directory::Directory (Configuration const * configuration
connect (network_manager_, &QNetworkAccessManager::authenticationRequired connect (network_manager_, &QNetworkAccessManager::authenticationRequired
, this, &Directory::authentication); , this, &Directory::authentication);
connect (this, &Directory::itemChanged, [this] (QTreeWidgetItem * item) { connect (this, &Directory::itemChanged, [] (QTreeWidgetItem * item) {
switch (item->type ()) switch (item->type ())
{ {
case FileNode::Type: case FileNode::Type:

View File

@ -6,7 +6,7 @@
#include <QThread> #include <QThread>
#include <QDateTime> #include <QDateTime>
#include "NetworkServerLookup.hpp" #include "Network/NetworkServerLookup.hpp"
#include "moc_DXLabSuiteCommanderTransceiver.cpp" #include "moc_DXLabSuiteCommanderTransceiver.cpp"

View File

@ -8,7 +8,7 @@
#include <QStandardPaths> #include <QStandardPaths>
#include <QDir> #include <QDir>
#include "NetworkServerLookup.hpp" #include "Network/NetworkServerLookup.hpp"
namespace namespace
{ {
@ -1023,7 +1023,7 @@ QString HRDTransceiver::send_command (QString const& cmd, bool no_debug, bool pr
if (!recurse && prepend_context) if (!recurse && prepend_context)
{ {
auto radio_name = send_command ("get radio", true, current_radio_, true); auto radio_name = send_command ("get radio", true, current_radio_, true);
auto radio_iter = std::find_if (radios_.begin (), radios_.end (), [this, &radio_name] (RadioMap::value_type const& radio) auto radio_iter = std::find_if (radios_.begin (), radios_.end (), [&radio_name] (RadioMap::value_type const& radio)
{ {
return std::get<1> (radio) == radio_name; return std::get<1> (radio) == radio_name;
}); });

View File

@ -6,7 +6,7 @@
#include <QThread> #include <QThread>
#include <QEventLoop> #include <QEventLoop>
#include "qt_helpers.hpP" #include "qt_helpers.hpp"
#include "moc_OmniRigTransceiver.cpp" #include "moc_OmniRigTransceiver.cpp"

View File

@ -3,7 +3,7 @@
#include <QObject> #include <QObject>
#include "TransceiverBase.hpp" #include "Transceiver/TransceiverBase.hpp"
class QTimer; class QTimer;

View File

@ -10,7 +10,7 @@
#include <QHash> #include <QHash>
#include "Radio.hpp" #include "Radio.hpp"
#include "NetworkMessage.hpp" #include "Network/NetworkMessage.hpp"
#include "qt_helpers.hpp" #include "qt_helpers.hpp"
#include "pimpl_impl.hpp" #include "pimpl_impl.hpp"

View File

@ -147,7 +147,7 @@ public:
: server_ {new MessageServer {this}} : server_ {new MessageServer {this}}
{ {
// connect up server // connect up server
connect (server_, &MessageServer::error, [this] (QString const& message) { connect (server_, &MessageServer::error, [] (QString const& message) {
std::cerr << tr ("Network Error: %1").arg ( message).toStdString () << std::endl; std::cerr << tr ("Network Error: %1").arg ( message).toStdString () << std::endl;
}); });
connect (server_, &MessageServer::client_opened, this, &Server::add_client); connect (server_, &MessageServer::client_opened, this, &Server::add_client);

View File

@ -1,8 +0,0 @@
See ./index.html for information about this release. The "Getting Started"
section is a useful starting place.
---------------------------
Copyright Beman Dawes, 2008
Distributed under the Boost Software License, Version 1.0.
See ./LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt

View File

@ -1,312 +0,0 @@
# Copyright Vladimir Prus 2002-2006.
# Copyright Dave Abrahams 2005-2006.
# Copyright Rene Rivera 2005-2007.
# Copyright Douglas Gregor 2005.
#
# 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)
# Usage:
#
# b2 [options] [properties] [install|stage]
#
# Builds and installs Boost.
#
# Targets and Related Options:
#
# install Install headers and compiled library files to the
# ======= configured locations (below).
#
# --prefix=<PREFIX> Install architecture independent files here.
# Default; C:\Boost on Win32
# Default; /usr/local on Unix. Linux, etc.
#
# --exec-prefix=<EPREFIX> Install architecture dependent files here.
# Default; <PREFIX>
#
# --libdir=<DIR> Install library files here.
# Default; <EPREFIX>/lib
#
# --includedir=<HDRDIR> Install header files here.
# Default; <PREFIX>/include
#
# stage Build and install only compiled library files to the
# ===== stage directory.
#
# --stagedir=<STAGEDIR> Install library files here
# Default; ./stage
#
# Other Options:
#
# --build-type=<type> Build the specified pre-defined set of variations of
# the libraries. Note, that which variants get built
# depends on what each library supports.
#
# -- minimal -- (default) Builds a minimal set of
# variants. On Windows, these are static
# multithreaded libraries in debug and release
# modes, using shared runtime. On Linux, these are
# static and shared multithreaded libraries in
# release mode.
#
# -- complete -- Build all possible variations.
#
# --build-dir=DIR Build in this location instead of building within
# the distribution tree. Recommended!
#
# --show-libraries Display the list of Boost libraries that require
# build and installation steps, and then exit.
#
# --layout=<layout> Determine whether to choose library names and header
# locations such that multiple versions of Boost or
# multiple compilers can be used on the same system.
#
# -- versioned -- Names of boost binaries include
# the Boost version number, name and version of
# the compiler and encoded build properties. Boost
# headers are installed in a subdirectory of
# <HDRDIR> whose name contains the Boost version
# number.
#
# -- tagged -- Names of boost binaries include the
# encoded build properties such as variant and
# threading, but do not including compiler name
# and version, or Boost version. This option is
# useful if you build several variants of Boost,
# using the same compiler.
#
# -- system -- Binaries names do not include the
# Boost version number or the name and version
# number of the compiler. Boost headers are
# installed directly into <HDRDIR>. This option is
# intended for system integrators building
# distribution packages.
#
# The default value is 'versioned' on Windows, and
# 'system' on Unix.
#
# --buildid=ID Add the specified ID to the name of built libraries.
# The default is to not add anything.
#
# --python-buildid=ID Add the specified ID to the name of built libraries
# that depend on Python. The default is to not add
# anything. This ID is added in addition to --buildid.
#
# --help This message.
#
# --with-<library> Build and install the specified <library>. If this
# option is used, only libraries specified using this
# option will be built.
#
# --without-<library> Do not build, stage, or install the specified
# <library>. By default, all libraries are built.
#
# Properties:
#
# toolset=toolset Indicate the toolset to build with.
#
# variant=debug|release Select the build variant
#
# link=static|shared Whether to build static or shared libraries
#
# threading=single|multi Whether to build single or multithreaded binaries
#
# runtime-link=static|shared
# Whether to link to static or shared C and C++
# runtime.
#
# TODO:
# - handle boost version
# - handle python options such as pydebug
import boostcpp ;
import package ;
import sequence ;
import xsltproc ;
import set ;
import path ;
import link ;
path-constant BOOST_ROOT : . ;
constant BOOST_VERSION : 1.63.0 ;
constant BOOST_JAMROOT_MODULE : $(__name__) ;
boostcpp.set-version $(BOOST_VERSION) ;
use-project /boost/architecture : libs/config/checks/architecture ;
local all-headers =
[ MATCH .*libs/(.*)/include/boost : [ glob libs/*/include/boost libs/*/*/include/boost ] ] ;
for dir in $(all-headers)
{
link-directory $(dir)-headers : libs/$(dir)/include/boost : <location>. ;
explicit $(dir)-headers ;
}
if $(all-headers)
{
constant BOOST_MODULARLAYOUT : $(all-headers) ;
}
project boost
: requirements <include>.
[ boostcpp.architecture ]
[ boostcpp.address-model ]
# Disable auto-linking for all targets here, primarily because it caused
# troubles with V2.
<define>BOOST_ALL_NO_LIB=1
# Used to encode variant in target name. See the 'tag' rule below.
<tag>@$(__name__).tag
<conditional>@handle-static-runtime
# Comeau does not support shared lib
<toolset>como:<link>static
<toolset>como-linux:<define>_GNU_SOURCE=1
# When building docs within Boost, we want the standard Boost style
<xsl:param>boost.defaults=Boost
: usage-requirements <include>.
: build-dir bin.v2
;
# This rule is called by Boost.Build to determine the name of target. We use it
# to encode the build variant, compiler name and boost version in the target
# name.
#
rule tag ( name : type ? : property-set )
{
return [ boostcpp.tag $(name) : $(type) : $(property-set) ] ;
}
rule python-tag ( name : type ? : property-set )
{
return [ boostcpp.python-tag $(name) : $(type) : $(property-set) ] ;
}
rule handle-static-runtime ( properties * )
{
# Using static runtime with shared libraries is impossible on Linux, and
# dangerous on Windows. Therefore, we disallow it. This might be drastic,
# but it was disabled for a while without anybody complaining.
# For CW, static runtime is needed so that std::locale works.
if <link>shared in $(properties) && <runtime-link>static in $(properties) &&
! ( <toolset>cw in $(properties) )
{
ECHO "error: link=shared together with runtime-link=static is not allowed" ;
ECHO "error: such property combination is either impossible " ;
ECHO "error: or too dangerious to be of any use" ;
EXIT ;
}
}
all-libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ]
[ glob libs/*/build/Jamfile ] ] ;
all-libraries = [ sequence.unique $(all-libraries) ] ;
# The function_types library has a Jamfile, but it's used for maintenance
# purposes, there's no library to build and install.
all-libraries = [ set.difference $(all-libraries) : function_types ] ;
# Setup convenient aliases for all libraries.
local rule explicit-alias ( id : targets + )
{
alias $(id) : $(targets) ;
explicit $(id) ;
}
# First, the complicated libraries: where the target name in Jamfile is
# different from its directory name.
explicit-alias prg_exec_monitor : libs/test/build//boost_prg_exec_monitor ;
explicit-alias test_exec_monitor : libs/test/build//boost_test_exec_monitor ;
explicit-alias unit_test_framework : libs/test/build//boost_unit_test_framework ;
explicit-alias bgl-vis : libs/graps/build//bgl-vis ;
explicit-alias serialization : libs/serialization/build//boost_serialization ;
explicit-alias wserialization : libs/serialization/build//boost_wserialization ;
for local l in $(all-libraries)
{
if ! $(l) in test graph serialization
{
explicit-alias $(l) : libs/$(l)/build//boost_$(l) ;
}
}
# Log has an additional target
explicit-alias log_setup : libs/log/build//boost_log_setup ;
alias headers : $(all-headers)-headers : : : <include>. ;
explicit headers ;
# Make project ids of all libraries known.
for local l in $(all-libraries)
{
use-project /boost/$(l) : libs/$(l)/build ;
}
if [ path.exists $(BOOST_ROOT)/tools/inspect ]
{
use-project /boost/tools/inspect : tools/inspect/build ;
}
if [ path.exists $(BOOST_ROOT)/libs/wave/tool ]
{
use-project /boost/libs/wave/tool : libs/wave/tool/build ;
}
# This rule should be called from libraries' Jamfiles and will create two
# targets, "install" and "stage", that will install or stage that library. The
# --prefix option is respected, but --with and --without options, naturally, are
# ignored.
#
# - libraries -- list of library targets to install.
#
rule boost-install ( libraries * )
{
package.install install
: <dependency>/boost//install-proper-headers $(install-requirements)
: # No binaries
: $(libraries)
: # No headers, it is handled by the dependency.
;
install stage : $(libraries) : <location>$(BOOST_STAGE_LOCATE) ;
module [ CALLER_MODULE ]
{
explicit stage ;
explicit install ;
}
}
# Creates a library target, adding autolink support and also creates
# stage and install targets via boost-install, above.
rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * )
{
name = boost_$(name) ;
autolink = <link>shared:<define>BOOST_$(name:U)_DYN_LINK=1 ;
lib $(name)
: $(sources)
: $(requirements) $(autolink)
: $(default-build)
: $(usage-requirements) $(autolink)
;
boost-install $(name) ;
}
headers =
# The .SUNWCCh files are present in tr1 include directory and have to be
# installed (see http://lists.boost.org/Archives/boost/2007/05/121430.php).
[ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc *.SUNWCCh : CVS .svn ]
[ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* : CVS .svn ]
[ path.glob boost/tr1/tr1 : * : bcc32 sun CVS .svn ]
;
# Declare special top-level targets that build and install the desired variants
# of the libraries.
boostcpp.declare-targets $(all-libraries) : $(headers) ;

View File

@ -1,23 +0,0 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -7,11 +7,18 @@ upstream and master. To upgrade the content do the following:
```bash ```bash
git checkout upstream git checkout upstream
mv README.md /tmp
rm -r * rm -r *
# use the bcp tool to populate with the new Boost libraries mv /tmp/README.md .
# use git add to stage any new files and directories # use the bcp tool to populate with the new Boost libraries from a clean boost install.
git commit -a -m "Updated Boost v1.63 libraries including ..." # Something like:
git tag boost_1_63 #
# bcp --boost=../boost_1_70_0 --unix-lines iterator range math numeric crc circular_buffer multi_index intrusive .
#
# Clean out any unwanted files and directories (e.g. libs and docs for a header only subset).
# Use git add to stage any new files and directories.
git commit -a -m "Updated Boost v1.70.0 libraries including ..."
git tag boost_1_70_0
git push origin git push origin
git checkout master git checkout master
git merge upstream git merge upstream
@ -30,4 +37,4 @@ git-subtree-pull to import the changes like this:
```bash ```bash
git remote add -f boost git@bitbucket.org:g4wjs/boost.git # for convienence git remote add -f boost git@bitbucket.org:g4wjs/boost.git # for convienence
git subtree pull --prefix boost boost master --squash git subtree pull --prefix boost boost master --squash
``` ```

View File

@ -1,17 +0,0 @@
# Copyright (C) 2002-2003 David Abrahams.
# Copyright (C) 2002-2003 Vladimir Prus.
# Copyright (C) 2003,2007 Rene Rivera.
# Use, modification and distribution are 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)
# This is the initial file loaded by Boost Jam when run from any Boost library
# folder. It allows us to choose which Boost Build installation to use for
# building Boost libraries. Unless explicitly selected using a command-line
# option, the version included with the Boost library distribution is used (as
# opposed to any other Boost Build version installed on the user's sytem).
BOOST_ROOT = $(.boost-build-file:D) ;
BOOST_BUILD = [ MATCH --boost-build=(.*) : $(ARGV) ] ;
BOOST_BUILD ?= tools/build/src ;
boost-build $(BOOST_BUILD) ;

View File

@ -1,66 +0,0 @@
/*=============================================================================
Copyright 2002 William E. Kempf
Distributed under the Boost Software License, Version 1.0. (See accompany-
ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
H1
{
FONT-SIZE: 200%;
COLOR: #00008B;
}
H2
{
FONT-SIZE: 150%;
}
H3
{
FONT-SIZE: 125%;
}
H4
{
FONT-SIZE: 108%;
}
BODY
{
FONT-SIZE: 100%;
BACKGROUND-COLOR: #ffffff;
COLOR: #000000;
}
PRE
{
MARGIN-LEFT: 2em;
FONT-FAMILY: Courier,
monospace;
}
CODE
{
FONT-FAMILY: Courier,
monospace;
}
CODE.as_pre
{
white-space: pre;
}
.index
{
TEXT-ALIGN: left;
}
.page-index
{
TEXT-ALIGN: left;
}
.definition
{
TEXT-ALIGN: left;
}
.footnote
{
FONT-SIZE: 66%;
VERTICAL-ALIGN: super;
TEXT-DECORATION: none;
}
.function-semantics
{
CLEAR: left;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -27,7 +27,7 @@ namespace boost { namespace algorithm {
/// ///
/// \note This function is part of the C++2011 standard library. /// \note This function is part of the C++2011 standard library.
template<typename InputIterator, typename Predicate> template<typename InputIterator, typename Predicate>
bool all_of ( InputIterator first, InputIterator last, Predicate p ) BOOST_CXX14_CONSTEXPR bool all_of ( InputIterator first, InputIterator last, Predicate p )
{ {
for ( ; first != last; ++first ) for ( ; first != last; ++first )
if ( !p(*first)) if ( !p(*first))
@ -43,7 +43,7 @@ bool all_of ( InputIterator first, InputIterator last, Predicate p )
/// \param p A predicate for testing the elements of the range /// \param p A predicate for testing the elements of the range
/// ///
template<typename Range, typename Predicate> template<typename Range, typename Predicate>
bool all_of ( const Range &r, Predicate p ) BOOST_CXX14_CONSTEXPR bool all_of ( const Range &r, Predicate p )
{ {
return boost::algorithm::all_of ( boost::begin (r), boost::end (r), p ); return boost::algorithm::all_of ( boost::begin (r), boost::end (r), p );
} }
@ -57,7 +57,7 @@ bool all_of ( const Range &r, Predicate p )
/// \param val A value to compare against /// \param val A value to compare against
/// ///
template<typename InputIterator, typename T> template<typename InputIterator, typename T>
bool all_of_equal ( InputIterator first, InputIterator last, const T &val ) BOOST_CXX14_CONSTEXPR bool all_of_equal ( InputIterator first, InputIterator last, const T &val )
{ {
for ( ; first != last; ++first ) for ( ; first != last; ++first )
if ( val != *first ) if ( val != *first )
@ -73,7 +73,7 @@ bool all_of_equal ( InputIterator first, InputIterator last, const T &val )
/// \param val A value to compare against /// \param val A value to compare against
/// ///
template<typename Range, typename T> template<typename Range, typename T>
bool all_of_equal ( const Range &r, const T &val ) BOOST_CXX14_CONSTEXPR bool all_of_equal ( const Range &r, const T &val )
{ {
return boost::algorithm::all_of_equal ( boost::begin (r), boost::end (r), val ); return boost::algorithm::all_of_equal ( boost::begin (r), boost::end (r), val );
} }

View File

@ -0,0 +1,553 @@
// (C) Copyright Herve Bronnimann 2004.
//
// 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)
/*
Revision history:
1 July 2004
Split the code into two headers to lessen dependence on
Boost.tuple. (Herve)
26 June 2004
Added the code for the boost minmax library. (Herve)
*/
#ifndef BOOST_ALGORITHM_MINMAX_ELEMENT_HPP
#define BOOST_ALGORITHM_MINMAX_ELEMENT_HPP
/* PROPOSED STANDARD EXTENSIONS:
*
* minmax_element(first, last)
* Effect: std::make_pair( std::min_element(first, last),
* std::max_element(first, last) );
*
* minmax_element(first, last, comp)
* Effect: std::make_pair( std::min_element(first, last, comp),
* std::max_element(first, last, comp) );
*/
#include <utility> // for std::pair and std::make_pair
namespace boost {
namespace detail { // for obtaining a uniform version of minmax_element
// that compiles with VC++ 6.0 -- avoid the iterator_traits by
// having comparison object over iterator, not over dereferenced value
template <typename Iterator>
struct less_over_iter {
bool operator()(Iterator const& it1,
Iterator const& it2) const { return *it1 < *it2; }
};
template <typename Iterator, class BinaryPredicate>
struct binary_pred_over_iter {
explicit binary_pred_over_iter(BinaryPredicate const& p ) : m_p( p ) {}
bool operator()(Iterator const& it1,
Iterator const& it2) const { return m_p(*it1, *it2); }
private:
BinaryPredicate m_p;
};
// common base for the two minmax_element overloads
template <typename ForwardIter, class Compare >
std::pair<ForwardIter,ForwardIter>
basic_minmax_element(ForwardIter first, ForwardIter last, Compare comp)
{
if (first == last)
return std::make_pair(last,last);
ForwardIter min_result = first;
ForwardIter max_result = first;
// if only one element
ForwardIter second = first; ++second;
if (second == last)
return std::make_pair(min_result, max_result);
// treat first pair separately (only one comparison for first two elements)
ForwardIter potential_min_result = last;
if (comp(first, second))
max_result = second;
else {
min_result = second;
potential_min_result = first;
}
// then each element by pairs, with at most 3 comparisons per pair
first = ++second; if (first != last) ++second;
while (second != last) {
if (comp(first, second)) {
if (comp(first, min_result)) {
min_result = first;
potential_min_result = last;
}
if (comp(max_result, second))
max_result = second;
} else {
if (comp(second, min_result)) {
min_result = second;
potential_min_result = first;
}
if (comp(max_result, first))
max_result = first;
}
first = ++second;
if (first != last) ++second;
}
// if odd number of elements, treat last element
if (first != last) { // odd number of elements
if (comp(first, min_result)) {
min_result = first;
potential_min_result = last;
}
else if (comp(max_result, first))
max_result = first;
}
// resolve min_result being incorrect with one extra comparison
// (in which case potential_min_result is necessarily the correct result)
if (potential_min_result != last
&& !comp(min_result, potential_min_result))
min_result = potential_min_result;
return std::make_pair(min_result,max_result);
}
} // namespace detail
template <typename ForwardIter>
std::pair<ForwardIter,ForwardIter>
minmax_element(ForwardIter first, ForwardIter last)
{
return detail::basic_minmax_element(first, last,
detail::less_over_iter<ForwardIter>() );
}
template <typename ForwardIter, class BinaryPredicate>
std::pair<ForwardIter,ForwardIter>
minmax_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
{
return detail::basic_minmax_element(first, last,
detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
}
}
/* PROPOSED BOOST EXTENSIONS
* In the description below, [rfirst,rlast) denotes the reversed range
* of [first,last). Even though the iterator type of first and last may
* be only a Forward Iterator, it is possible to explain the semantics
* by assuming that it is a Bidirectional Iterator. In the sequel,
* reverse(ForwardIterator&) returns the reverse_iterator adaptor.
* This is not how the functions would be implemented!
*
* first_min_element(first, last)
* Effect: std::min_element(first, last);
*
* first_min_element(first, last, comp)
* Effect: std::min_element(first, last, comp);
*
* last_min_element(first, last)
* Effect: reverse( std::min_element(reverse(last), reverse(first)) );
*
* last_min_element(first, last, comp)
* Effect: reverse( std::min_element(reverse(last), reverse(first), comp) );
*
* first_max_element(first, last)
* Effect: std::max_element(first, last);
*
* first_max_element(first, last, comp)
* Effect: max_element(first, last);
*
* last_max_element(first, last)
* Effect: reverse( std::max_element(reverse(last), reverse(first)) );
*
* last_max_element(first, last, comp)
* Effect: reverse( std::max_element(reverse(last), reverse(first), comp) );
*
* first_min_first_max_element(first, last)
* Effect: std::make_pair( first_min_element(first, last),
* first_max_element(first, last) );
*
* first_min_first_max_element(first, last, comp)
* Effect: std::make_pair( first_min_element(first, last, comp),
* first_max_element(first, last, comp) );
*
* first_min_last_max_element(first, last)
* Effect: std::make_pair( first_min_element(first, last),
* last_max_element(first, last) );
*
* first_min_last_max_element(first, last, comp)
* Effect: std::make_pair( first_min_element(first, last, comp),
* last_max_element(first, last, comp) );
*
* last_min_first_max_element(first, last)
* Effect: std::make_pair( last_min_element(first, last),
* first_max_element(first, last) );
*
* last_min_first_max_element(first, last, comp)
* Effect: std::make_pair( last_min_element(first, last, comp),
* first_max_element(first, last, comp) );
*
* last_min_last_max_element(first, last)
* Effect: std::make_pair( last_min_element(first, last),
* last_max_element(first, last) );
*
* last_min_last_max_element(first, last, comp)
* Effect: std::make_pair( last_min_element(first, last, comp),
* last_max_element(first, last, comp) );
*/
namespace boost {
// Min_element and max_element variants
namespace detail { // common base for the overloads
template <typename ForwardIter, class BinaryPredicate>
ForwardIter
basic_first_min_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
if (first == last) return last;
ForwardIter min_result = first;
while (++first != last)
if (comp(first, min_result))
min_result = first;
return min_result;
}
template <typename ForwardIter, class BinaryPredicate>
ForwardIter
basic_last_min_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
if (first == last) return last;
ForwardIter min_result = first;
while (++first != last)
if (!comp(min_result, first))
min_result = first;
return min_result;
}
template <typename ForwardIter, class BinaryPredicate>
ForwardIter
basic_first_max_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
if (first == last) return last;
ForwardIter max_result = first;
while (++first != last)
if (comp(max_result, first))
max_result = first;
return max_result;
}
template <typename ForwardIter, class BinaryPredicate>
ForwardIter
basic_last_max_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
if (first == last) return last;
ForwardIter max_result = first;
while (++first != last)
if (!comp(first, max_result))
max_result = first;
return max_result;
}
} // namespace detail
template <typename ForwardIter>
ForwardIter
first_min_element(ForwardIter first, ForwardIter last)
{
return detail::basic_first_min_element(first, last,
detail::less_over_iter<ForwardIter>() );
}
template <typename ForwardIter, class BinaryPredicate>
ForwardIter
first_min_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
{
return detail::basic_first_min_element(first, last,
detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
}
template <typename ForwardIter>
ForwardIter
last_min_element(ForwardIter first, ForwardIter last)
{
return detail::basic_last_min_element(first, last,
detail::less_over_iter<ForwardIter>() );
}
template <typename ForwardIter, class BinaryPredicate>
ForwardIter
last_min_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
{
return detail::basic_last_min_element(first, last,
detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
}
template <typename ForwardIter>
ForwardIter
first_max_element(ForwardIter first, ForwardIter last)
{
return detail::basic_first_max_element(first, last,
detail::less_over_iter<ForwardIter>() );
}
template <typename ForwardIter, class BinaryPredicate>
ForwardIter
first_max_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
{
return detail::basic_first_max_element(first, last,
detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
}
template <typename ForwardIter>
ForwardIter
last_max_element(ForwardIter first, ForwardIter last)
{
return detail::basic_last_max_element(first, last,
detail::less_over_iter<ForwardIter>() );
}
template <typename ForwardIter, class BinaryPredicate>
ForwardIter
last_max_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
{
return detail::basic_last_max_element(first, last,
detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
}
// Minmax_element variants -- comments removed
namespace detail {
template <typename ForwardIter, class BinaryPredicate>
std::pair<ForwardIter,ForwardIter>
basic_first_min_last_max_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
if (first == last)
return std::make_pair(last,last);
ForwardIter min_result = first;
ForwardIter max_result = first;
ForwardIter second = ++first;
if (second == last)
return std::make_pair(min_result, max_result);
if (comp(second, min_result))
min_result = second;
else
max_result = second;
first = ++second; if (first != last) ++second;
while (second != last) {
if (!comp(second, first)) {
if (comp(first, min_result))
min_result = first;
if (!comp(second, max_result))
max_result = second;
} else {
if (comp(second, min_result))
min_result = second;
if (!comp(first, max_result))
max_result = first;
}
first = ++second; if (first != last) ++second;
}
if (first != last) {
if (comp(first, min_result))
min_result = first;
else if (!comp(first, max_result))
max_result = first;
}
return std::make_pair(min_result, max_result);
}
template <typename ForwardIter, class BinaryPredicate>
std::pair<ForwardIter,ForwardIter>
basic_last_min_first_max_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
if (first == last) return std::make_pair(last,last);
ForwardIter min_result = first;
ForwardIter max_result = first;
ForwardIter second = ++first;
if (second == last)
return std::make_pair(min_result, max_result);
if (comp(max_result, second))
max_result = second;
else
min_result = second;
first = ++second; if (first != last) ++second;
while (second != last) {
if (comp(first, second)) {
if (!comp(min_result, first))
min_result = first;
if (comp(max_result, second))
max_result = second;
} else {
if (!comp(min_result, second))
min_result = second;
if (comp(max_result, first))
max_result = first;
}
first = ++second; if (first != last) ++second;
}
if (first != last) {
if (!comp(min_result, first))
min_result = first;
else if (comp(max_result, first))
max_result = first;
}
return std::make_pair(min_result, max_result);
}
template <typename ForwardIter, class BinaryPredicate>
std::pair<ForwardIter,ForwardIter>
basic_last_min_last_max_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
if (first == last) return std::make_pair(last,last);
ForwardIter min_result = first;
ForwardIter max_result = first;
ForwardIter second = first; ++second;
if (second == last)
return std::make_pair(min_result,max_result);
ForwardIter potential_max_result = last;
if (comp(first, second))
max_result = second;
else {
min_result = second;
potential_max_result = second;
}
first = ++second; if (first != last) ++second;
while (second != last) {
if (comp(first, second)) {
if (!comp(min_result, first))
min_result = first;
if (!comp(second, max_result)) {
max_result = second;
potential_max_result = last;
}
} else {
if (!comp(min_result, second))
min_result = second;
if (!comp(first, max_result)) {
max_result = first;
potential_max_result = second;
}
}
first = ++second;
if (first != last) ++second;
}
if (first != last) {
if (!comp(min_result, first))
min_result = first;
if (!comp(first, max_result)) {
max_result = first;
potential_max_result = last;
}
}
if (potential_max_result != last
&& !comp(potential_max_result, max_result))
max_result = potential_max_result;
return std::make_pair(min_result,max_result);
}
} // namespace detail
template <typename ForwardIter>
inline std::pair<ForwardIter,ForwardIter>
first_min_first_max_element(ForwardIter first, ForwardIter last)
{
return minmax_element(first, last);
}
template <typename ForwardIter, class BinaryPredicate>
inline std::pair<ForwardIter,ForwardIter>
first_min_first_max_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
return minmax_element(first, last, comp);
}
template <typename ForwardIter>
std::pair<ForwardIter,ForwardIter>
first_min_last_max_element(ForwardIter first, ForwardIter last)
{
return detail::basic_first_min_last_max_element(first, last,
detail::less_over_iter<ForwardIter>() );
}
template <typename ForwardIter, class BinaryPredicate>
inline std::pair<ForwardIter,ForwardIter>
first_min_last_max_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
return detail::basic_first_min_last_max_element(first, last,
detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
}
template <typename ForwardIter>
std::pair<ForwardIter,ForwardIter>
last_min_first_max_element(ForwardIter first, ForwardIter last)
{
return detail::basic_last_min_first_max_element(first, last,
detail::less_over_iter<ForwardIter>() );
}
template <typename ForwardIter, class BinaryPredicate>
inline std::pair<ForwardIter,ForwardIter>
last_min_first_max_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
return detail::basic_last_min_first_max_element(first, last,
detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
}
template <typename ForwardIter>
std::pair<ForwardIter,ForwardIter>
last_min_last_max_element(ForwardIter first, ForwardIter last)
{
return detail::basic_last_min_last_max_element(first, last,
detail::less_over_iter<ForwardIter>() );
}
template <typename ForwardIter, class BinaryPredicate>
inline std::pair<ForwardIter,ForwardIter>
last_min_last_max_element(ForwardIter first, ForwardIter last,
BinaryPredicate comp)
{
return detail::basic_last_min_last_max_element(first, last,
detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
}
} // namespace boost
#endif // BOOST_ALGORITHM_MINMAX_ELEMENT_HPP

View File

@ -30,8 +30,10 @@ namespace boost {
// a tolower functor // a tolower functor
template<typename CharT> template<typename CharT>
struct to_lowerF : public std::unary_function<CharT, CharT> struct to_lowerF
{ {
typedef CharT argument_type;
typedef CharT result_type;
// Constructor // Constructor
to_lowerF( const std::locale& Loc ) : m_Loc( &Loc ) {} to_lowerF( const std::locale& Loc ) : m_Loc( &Loc ) {}
@ -50,8 +52,10 @@ namespace boost {
// a toupper functor // a toupper functor
template<typename CharT> template<typename CharT>
struct to_upperF : public std::unary_function<CharT, CharT> struct to_upperF
{ {
typedef CharT argument_type;
typedef CharT result_type;
// Constructor // Constructor
to_upperF( const std::locale& Loc ) : m_Loc( &Loc ) {} to_upperF( const std::locale& Loc ) : m_Loc( &Loc ) {}

View File

@ -40,7 +40,7 @@ namespace boost {
// Protected construction/destruction // Protected construction/destruction
// Default constructor // Default constructor
find_iterator_base() {}; find_iterator_base() {}
// Copy construction // Copy construction
find_iterator_base( const find_iterator_base& Other ) : find_iterator_base( const find_iterator_base& Other ) :
m_Finder(Other.m_Finder) {} m_Finder(Other.m_Finder) {}

View File

@ -89,9 +89,10 @@ namespace boost {
template< template<
typename SeqT, typename SeqT,
typename IteratorT=BOOST_STRING_TYPENAME SeqT::const_iterator > typename IteratorT=BOOST_STRING_TYPENAME SeqT::const_iterator >
struct copy_iterator_rangeF : struct copy_iterator_rangeF
public std::unary_function< iterator_range<IteratorT>, SeqT >
{ {
typedef iterator_range<IteratorT> argument_type;
typedef SeqT result_type;
SeqT operator()( const iterator_range<IteratorT>& Range ) const SeqT operator()( const iterator_range<IteratorT>& Range ) const
{ {
return copy_range<SeqT>(Range); return copy_range<SeqT>(Range);

View File

@ -43,7 +43,6 @@ namespace boost {
The result is given as an \c iterator_range delimiting the match. The result is given as an \c iterator_range delimiting the match.
\param Search A substring to be searched for. \param Search A substring to be searched for.
\param Comp An element comparison predicate
\return An instance of the \c first_finder object \return An instance of the \c first_finder object
*/ */
template<typename RangeT> template<typename RangeT>
@ -84,7 +83,6 @@ namespace boost {
The result is given as an \c iterator_range delimiting the match. The result is given as an \c iterator_range delimiting the match.
\param Search A substring to be searched for. \param Search A substring to be searched for.
\param Comp An element comparison predicate
\return An instance of the \c last_finder object \return An instance of the \c last_finder object
*/ */
template<typename RangeT> template<typename RangeT>
@ -124,7 +122,6 @@ namespace boost {
\param Search A substring to be searched for. \param Search A substring to be searched for.
\param Nth An index of the match to be find \param Nth An index of the match to be find
\param Comp An element comparison predicate
\return An instance of the \c nth_finder object \return An instance of the \c nth_finder object
*/ */
template<typename RangeT> template<typename RangeT>
@ -230,7 +227,6 @@ namespace boost {
\param Begin Beginning of the range \param Begin Beginning of the range
\param End End of the range \param End End of the range
\param Range The range.
\return An instance of the \c range_finger object \return An instance of the \c range_finger object
*/ */
template< typename ForwardIteratorT > template< typename ForwardIteratorT >

View File

@ -1,20 +0,0 @@
/*
(c) 2014-2015 Glen Joseph Fernandes
<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
http://boost.org/LICENSE_1_0.txt
*/
#ifndef BOOST_ALIGN_ALIGN_HPP
#define BOOST_ALIGN_ALIGN_HPP
#include <boost/config.hpp>
#if !defined(BOOST_NO_CXX11_STD_ALIGN)
#include <boost/align/detail/align_cxx11.hpp>
#else
#include <boost/align/detail/align.hpp>
#endif
#endif

View File

@ -1,38 +0,0 @@
/*
(c) 2014-2016 Glen Joseph Fernandes
<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
http://boost.org/LICENSE_1_0.txt
*/
#ifndef BOOST_ALIGN_DETAIL_ALIGN_HPP
#define BOOST_ALIGN_DETAIL_ALIGN_HPP
#include <boost/align/detail/is_alignment.hpp>
#include <boost/assert.hpp>
namespace boost {
namespace alignment {
inline void* align(std::size_t alignment, std::size_t size,
void*& ptr, std::size_t& space)
{
BOOST_ASSERT(detail::is_alignment(alignment));
if (size <= space) {
char* p = (char*)(((std::size_t)ptr + alignment - 1) &
~(alignment - 1));
std::size_t n = space - (p - static_cast<char*>(ptr));
if (size <= n) {
ptr = p;
space = n;
return p;
}
}
return 0;
}
} /* .alignment */
} /* .boost */
#endif

View File

@ -1,22 +0,0 @@
/*
(c) 2014 Glen Joseph Fernandes
<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
http://boost.org/LICENSE_1_0.txt
*/
#ifndef BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP
#define BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP
#include <memory>
namespace boost {
namespace alignment {
using std::align;
} /* .alignment */
} /* .boost */
#endif

View File

@ -1,29 +0,0 @@
/*
(c) 2014 Glen Joseph Fernandes
<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
http://boost.org/LICENSE_1_0.txt
*/
#ifndef BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP
#define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP
#include <boost/config.hpp>
#include <cstddef>
namespace boost {
namespace alignment {
namespace detail {
BOOST_CONSTEXPR inline bool is_alignment(std::size_t value)
BOOST_NOEXCEPT
{
return (value > 0) && ((value & (value - 1)) == 0);
}
} /* .detail */
} /* .alignment */
} /* .boost */
#endif

View File

@ -12,11 +12,11 @@
// with features contributed and bugs found by // with features contributed and bugs found by
// Antony Polukhin, Ed Brey, Mark Rodgers, // Antony Polukhin, Ed Brey, Mark Rodgers,
// Peter Dimov, and James Curran // Peter Dimov, and James Curran
// when: July 2001, April 2013 - May 2013 // when: July 2001, April 2013 - 2019
#include <algorithm> #include <algorithm>
#include "boost/config.hpp" #include <boost/config.hpp>
#include <boost/type_index.hpp> #include <boost/type_index.hpp>
#include <boost/type_traits/remove_reference.hpp> #include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/decay.hpp> #include <boost/type_traits/decay.hpp>
@ -27,9 +27,10 @@
#include <boost/throw_exception.hpp> #include <boost/throw_exception.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
#include <boost/core/addressof.hpp>
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/mpl/if.hpp> #include <boost/type_traits/conditional.hpp>
namespace boost namespace boost
{ {
@ -108,7 +109,7 @@ namespace boost
return *this; return *this;
} }
// move assignement // move assignment
any & operator=(any&& rhs) BOOST_NOEXCEPT any & operator=(any&& rhs) BOOST_NOEXCEPT
{ {
rhs.swap(*this); rhs.swap(*this);
@ -148,7 +149,7 @@ namespace boost
public: // types (public so any_cast can be non-friend) public: // types (public so any_cast can be non-friend)
#endif #endif
class placeholder class BOOST_SYMBOL_VISIBLE placeholder
{ {
public: // structors public: // structors
@ -244,7 +245,9 @@ namespace boost
ValueType * any_cast(any * operand) BOOST_NOEXCEPT ValueType * any_cast(any * operand) BOOST_NOEXCEPT
{ {
return operand && operand->type() == boost::typeindex::type_id<ValueType>() return operand && operand->type() == boost::typeindex::type_id<ValueType>()
? &static_cast<any::holder<BOOST_DEDUCED_TYPENAME remove_cv<ValueType>::type> *>(operand->content)->held ? boost::addressof(
static_cast<any::holder<BOOST_DEDUCED_TYPENAME remove_cv<ValueType>::type> *>(operand->content)->held
)
: 0; : 0;
} }
@ -260,7 +263,7 @@ namespace boost
typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref; typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;
nonref * result = any_cast<nonref>(&operand); nonref * result = any_cast<nonref>(boost::addressof(operand));
if(!result) if(!result)
boost::throw_exception(bad_any_cast()); boost::throw_exception(bad_any_cast());
@ -268,13 +271,20 @@ namespace boost
// `ValueType` is not a reference. Example: // `ValueType` is not a reference. Example:
// `static_cast<std::string>(*result);` // `static_cast<std::string>(*result);`
// which is equal to `std::string(*result);` // which is equal to `std::string(*result);`
typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< typedef BOOST_DEDUCED_TYPENAME boost::conditional<
boost::is_reference<ValueType>, boost::is_reference<ValueType>::value,
ValueType, ValueType,
BOOST_DEDUCED_TYPENAME boost::add_reference<ValueType>::type BOOST_DEDUCED_TYPENAME boost::add_reference<ValueType>::type
>::type ref_type; >::type ref_type;
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4172) // "returning address of local variable or temporary" but *result is not local!
#endif
return static_cast<ref_type>(*result); return static_cast<ref_type>(*result);
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
} }
template<typename ValueType> template<typename ValueType>
@ -306,7 +316,9 @@ namespace boost
template<typename ValueType> template<typename ValueType>
inline ValueType * unsafe_any_cast(any * operand) BOOST_NOEXCEPT inline ValueType * unsafe_any_cast(any * operand) BOOST_NOEXCEPT
{ {
return &static_cast<any::holder<ValueType> *>(operand->content)->held; return boost::addressof(
static_cast<any::holder<ValueType> *>(operand->content)->held
);
} }
template<typename ValueType> template<typename ValueType>
@ -317,6 +329,7 @@ namespace boost
} }
// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved. // Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
// Copyright Antony Polukhin, 2013-2019.
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at // accompanying file LICENSE_1_0.txt or copy at

View File

@ -127,11 +127,11 @@ public:
} }
// used for text output // used for text output
operator int () const { operator base_type () const {
return t; return t;
} }
// used for text input // used for text input
operator int_least16_t &() { operator base_type &() {
return t; return t;
} }
bool operator==(const class_id_type & rhs) const { bool operator==(const class_id_type & rhs) const {
@ -151,7 +151,10 @@ private:
public: public:
object_id_type(): t(0) {}; object_id_type(): t(0) {};
// note: presumes that size_t >= unsigned int. // note: presumes that size_t >= unsigned int.
explicit object_id_type(const std::size_t & t_) : t(t_){ // use explicit cast to silence useless warning
explicit object_id_type(const std::size_t & t_) : t(static_cast<base_type>(t_)){
// make quadriple sure that we haven't lost any real integer
// precision
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max); BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
} }
object_id_type(const object_id_type & t_) : object_id_type(const object_id_type & t_) :
@ -162,11 +165,11 @@ public:
return *this; return *this;
} }
// used for text output // used for text output
operator uint_least32_t () const { operator base_type () const {
return t; return t;
} }
// used for text input // used for text input
operator uint_least32_t & () { operator base_type & () {
return t; return t;
} }
bool operator==(const object_id_type & rhs) const { bool operator==(const object_id_type & rhs) const {

View File

@ -102,17 +102,29 @@ protected:
} }
void load_override(class_id_type & t){ void load_override(class_id_type & t){
library_version_type lvt = this->get_library_version(); library_version_type lvt = this->get_library_version();
/*
* library versions:
* boost 1.39 -> 5
* boost 1.43 -> 7
* boost 1.47 -> 9
*
*
* 1) in boost 1.43 and inferior, class_id_type is always a 16bit value, with no check on the library version
* --> this means all archives with version v <= 7 are written with a 16bit class_id_type
* 2) in boost 1.44 this load_override has disappeared (and thus boost 1.44 is not backward compatible at all !!)
* 3) recent boosts reintroduced load_override with a test on the version :
* - v > 7 : this->detail_common_iarchive::load_override(t, version)
* - v > 6 : 16bit
* - other : 32bit
* --> which is obviously incorrect, see point 1
*
* the fix here decodes class_id_type on 16bit for all v <= 7, which seems to be the correct behaviour ...
*/
if(boost::archive::library_version_type(7) < lvt){ if(boost::archive::library_version_type(7) < lvt){
this->detail_common_iarchive::load_override(t); this->detail_common_iarchive::load_override(t);
} }
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{ else{
int x=0; int_least16_t x=0;
* this->This() >> x; * this->This() >> x;
t = boost::archive::class_id_type(x); t = boost::archive::class_id_type(x);
} }

View File

@ -50,7 +50,7 @@ namespace std{
//#include <boost/mpl/placeholders.hpp> //#include <boost/mpl/placeholders.hpp>
#include <boost/serialization/is_bitwise_serializable.hpp> #include <boost/serialization/is_bitwise_serializable.hpp>
#include <boost/serialization/array.hpp> #include <boost/serialization/array_wrapper.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp> #include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/codecvt_null.hpp> #include <boost/archive/codecvt_null.hpp>

View File

@ -45,7 +45,7 @@ namespace std{
//#include <boost/mpl/placeholders.hpp> //#include <boost/mpl/placeholders.hpp>
#include <boost/serialization/is_bitwise_serializable.hpp> #include <boost/serialization/is_bitwise_serializable.hpp>
#include <boost/serialization/array.hpp> #include <boost/serialization/array_wrapper.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp> #include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/codecvt_null.hpp> #include <boost/archive/codecvt_null.hpp>

View File

@ -21,7 +21,7 @@
// //
// note the fact that on libraries without wide characters, ostream is // note the fact that on libraries without wide characters, ostream is
// is not a specialization of basic_ostream which in fact is not defined // is not a specialization of basic_ostream which in fact is not defined
// in such cases. So we can't use basic_ostream<IStream::char_type> but rather // in such cases. So we can't use basic_istream<IStream::char_type> but rather
// use two template parameters // use two template parameters
#include <boost/config.hpp> #include <boost/config.hpp>

View File

@ -175,8 +175,6 @@ protected:
template<class T> template<class T>
void save(const T & t){ void save(const T & t){
boost::io::ios_flags_saver fs(os);
boost::io::ios_precision_saver ps(os);
typename is_float<T>::type tf; typename is_float<T>::type tf;
save_impl(t, tf); save_impl(t, tf);
} }

View File

@ -89,8 +89,7 @@ protected:
// leaving the archive in an undetermined state // leaving the archive in an undetermined state
BOOST_ARCHIVE_OR_WARCHIVE_DECL void BOOST_ARCHIVE_OR_WARCHIVE_DECL void
load_override(class_id_type & t); load_override(class_id_type & t);
BOOST_ARCHIVE_OR_WARCHIVE_DECL void void load_override(class_id_optional_type & /* t */){}
load_override(class_id_optional_type & /* t */){}
BOOST_ARCHIVE_OR_WARCHIVE_DECL void BOOST_ARCHIVE_OR_WARCHIVE_DECL void
load_override(object_id_type & t); load_override(object_id_type & t);
BOOST_ARCHIVE_OR_WARCHIVE_DECL void BOOST_ARCHIVE_OR_WARCHIVE_DECL void

View File

@ -18,8 +18,11 @@
#include <locale> #include <locale>
#include <cstddef> // NULL, size_t #include <cstddef> // NULL, size_t
#ifndef BOOST_NO_CWCHAR
#include <cwchar> // for mbstate_t #include <cwchar> // for mbstate_t
#endif
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/serialization/force_include.hpp>
#include <boost/archive/detail/auto_link_archive.hpp> #include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
@ -60,9 +63,10 @@ public:
}; };
template<> template<>
class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> : public std::codecvt<wchar_t, char, std::mbstate_t> class BOOST_WARCHIVE_DECL codecvt_null<wchar_t> :
public std::codecvt<wchar_t, char, std::mbstate_t>
{ {
virtual BOOST_WARCHIVE_DECL std::codecvt_base::result virtual std::codecvt_base::result
do_out( do_out(
std::mbstate_t & state, std::mbstate_t & state,
const wchar_t * first1, const wchar_t * first1,
@ -72,7 +76,7 @@ class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> : public std::codecvt<wchar_t,
char * last2, char * last2,
char * & next2 char * & next2
) const; ) const;
virtual BOOST_WARCHIVE_DECL std::codecvt_base::result virtual std::codecvt_base::result
do_in( do_in(
std::mbstate_t & state, std::mbstate_t & state,
const char * first1, const char * first1,
@ -92,7 +96,7 @@ public:
explicit codecvt_null(std::size_t no_locale_manage = 0) : explicit codecvt_null(std::size_t no_locale_manage = 0) :
std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage) std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
{} {}
virtual ~codecvt_null(){}; //virtual ~codecvt_null(){};
}; };
} // namespace archive } // namespace archive

View File

@ -35,11 +35,12 @@ class extended_type_info;
// note: referred to as Curiously Recurring Template Patter (CRTP) // note: referred to as Curiously Recurring Template Patter (CRTP)
template<class Archive> template<class Archive>
class BOOST_SYMBOL_VISIBLE common_iarchive : class BOOST_SYMBOL_VISIBLE common_iarchive :
public basic_iarchive, public basic_iarchive,
public interface_iarchive<Archive> public interface_iarchive<Archive>
{ {
friend class interface_iarchive<Archive>; friend class interface_iarchive<Archive>;
friend class basic_iarchive;
private: private:
virtual void vload(version_type & t){ virtual void vload(version_type & t){
* this->This() >> t; * this->This() >> t;

View File

@ -38,6 +38,7 @@ class BOOST_SYMBOL_VISIBLE common_oarchive :
public interface_oarchive<Archive> public interface_oarchive<Archive>
{ {
friend class interface_oarchive<Archive>; friend class interface_oarchive<Archive>;
friend class basic_oarchive;
private: private:
virtual void vsave(const version_type t){ virtual void vsave(const version_type t){
* this->This() << t; * this->This() << t;

View File

@ -57,11 +57,10 @@ namespace std{
#include <boost/serialization/assume_abstract.hpp> #include <boost/serialization/assume_abstract.hpp>
#ifndef BOOST_MSVC #if !defined(BOOST_MSVC) && \
#define DONT_USE_HAS_NEW_OPERATOR ( \ (BOOST_WORKAROUND(__IBMCPP__, < 1210) || \
BOOST_WORKAROUND(__IBMCPP__, < 1210) \ defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590))
|| defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \ #define DONT_USE_HAS_NEW_OPERATOR 1
)
#else #else
#define DONT_USE_HAS_NEW_OPERATOR 0 #define DONT_USE_HAS_NEW_OPERATOR 0
#endif #endif
@ -77,10 +76,10 @@ namespace std{
#include <boost/serialization/type_info_implementation.hpp> #include <boost/serialization/type_info_implementation.hpp>
#include <boost/serialization/nvp.hpp> #include <boost/serialization/nvp.hpp>
#include <boost/serialization/void_cast.hpp> #include <boost/serialization/void_cast.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/collection_size_type.hpp> #include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/singleton.hpp> #include <boost/serialization/singleton.hpp>
#include <boost/serialization/wrapper.hpp> #include <boost/serialization/wrapper.hpp>
#include <boost/serialization/array_wrapper.hpp>
// the following is need only for dynamic cast of polymorphic pointers // the following is need only for dynamic cast of polymorphic pointers
#include <boost/archive/archive_exception.hpp> #include <boost/archive/archive_exception.hpp>
@ -90,6 +89,8 @@ namespace std{
#include <boost/archive/detail/archive_serializer_map.hpp> #include <boost/archive/detail/archive_serializer_map.hpp>
#include <boost/archive/detail/check.hpp> #include <boost/archive/detail/check.hpp>
#include <boost/core/addressof.hpp>
namespace boost { namespace boost {
namespace serialization { namespace serialization {
@ -122,8 +123,7 @@ private:
virtual void destroy(/*const*/ void *address) const { virtual void destroy(/*const*/ void *address) const {
boost::serialization::access::destroy(static_cast<T *>(address)); boost::serialization::access::destroy(static_cast<T *>(address));
} }
protected: public:
// protected constructor since it's always created by singleton
explicit iserializer() : explicit iserializer() :
basic_iserializer( basic_iserializer(
boost::serialization::singleton< boost::serialization::singleton<
@ -132,7 +132,6 @@ protected:
>::get_const_instance() >::get_const_instance()
) )
{} {}
public:
virtual BOOST_DLLEXPORT void load_object_data( virtual BOOST_DLLEXPORT void load_object_data(
basic_iarchive & ar, basic_iarchive & ar,
void *x, void *x,
@ -234,7 +233,7 @@ struct heap_allocation {
// that the class might have class specific new with NO // that the class might have class specific new with NO
// class specific delete at all. Patches (compatible with // class specific delete at all. Patches (compatible with
// C++03) welcome! // C++03) welcome!
delete t; (operator delete)(t);
} }
}; };
struct doesnt_have_new_operator { struct doesnt_have_new_operator {
@ -243,7 +242,7 @@ struct heap_allocation {
} }
static void invoke_delete(T * t) { static void invoke_delete(T * t) {
// Note: I'm reliance upon automatic conversion from T * to void * here // Note: I'm reliance upon automatic conversion from T * to void * here
delete t; (operator delete)(t);
} }
}; };
static T * invoke_new() { static T * invoke_new() {
@ -306,7 +305,7 @@ private:
void * x, void * x,
const unsigned int file_version const unsigned int file_version
) const BOOST_USED; ) const BOOST_USED;
protected: public:
// this should alway be a singleton so make the constructor protected // this should alway be a singleton so make the constructor protected
pointer_iserializer(); pointer_iserializer();
~pointer_iserializer(); ~pointer_iserializer();
@ -406,7 +405,7 @@ struct load_non_pointer_type {
struct load_standard { struct load_standard {
template<class T> template<class T>
static void invoke(Archive &ar, const T & t){ static void invoke(Archive &ar, const T & t){
void * x = & const_cast<T &>(t); void * x = boost::addressof(const_cast<T &>(t));
ar.load_object( ar.load_object(
x, x,
boost::serialization::singleton< boost::serialization::singleton<
@ -484,7 +483,7 @@ struct load_pointer_type {
}; };
template<class T> template<class T>
static const basic_pointer_iserializer * register_type(Archive &ar, const T & /*t*/){ static const basic_pointer_iserializer * register_type(Archive &ar, const T* const /*t*/){
// there should never be any need to load an abstract polymorphic // there should never be any need to load an abstract polymorphic
// class pointer. Inhibiting code generation for this // class pointer. Inhibiting code generation for this
// permits abstract base classes to be used - note: exception // permits abstract base classes to be used - note: exception
@ -523,7 +522,7 @@ struct load_pointer_type {
} }
template<class T> template<class T>
static void check_load(T & /* t */){ static void check_load(T * const /* t */){
check_pointer_level< T >(); check_pointer_level< T >();
check_pointer_tracking< T >(); check_pointer_tracking< T >();
} }
@ -537,8 +536,8 @@ struct load_pointer_type {
template<class Tptr> template<class Tptr>
static void invoke(Archive & ar, Tptr & t){ static void invoke(Archive & ar, Tptr & t){
check_load(*t); check_load(t);
const basic_pointer_iserializer * bpis_ptr = register_type(ar, *t); const basic_pointer_iserializer * bpis_ptr = register_type(ar, t);
const basic_pointer_iserializer * newbpis_ptr = ar.load_pointer( const basic_pointer_iserializer * newbpis_ptr = ar.load_pointer(
// note major hack here !!! // note major hack here !!!
// I tried every way to convert Tptr &t (where Tptr might // I tried every way to convert Tptr &t (where Tptr might
@ -588,7 +587,14 @@ struct load_array_type {
boost::archive::archive_exception::array_size_too_short boost::archive::archive_exception::array_size_too_short
) )
); );
ar >> serialization::make_array(static_cast<value_type*>(&t[0]),count); // explict template arguments to pass intel C++ compiler
ar >> serialization::make_array<
value_type,
boost::serialization::collection_size_type
>(
static_cast<value_type *>(&t[0]),
count
);
} }
}; };
@ -598,7 +604,7 @@ template<class Archive, class T>
inline void load(Archive & ar, T &t){ inline void load(Archive & ar, T &t){
// if this assertion trips. It means we're trying to load a // if this assertion trips. It means we're trying to load a
// const object with a compiler that doesn't have correct // const object with a compiler that doesn't have correct
// funtion template ordering. On other compilers, this is // function template ordering. On other compilers, this is
// handled below. // handled below.
detail::check_const_loading< T >(); detail::check_const_loading< T >();
typedef typedef

View File

@ -26,6 +26,7 @@
#include <cstddef> // NULL #include <cstddef> // NULL
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
@ -56,8 +57,9 @@
#include <boost/serialization/type_info_implementation.hpp> #include <boost/serialization/type_info_implementation.hpp>
#include <boost/serialization/nvp.hpp> #include <boost/serialization/nvp.hpp>
#include <boost/serialization/void_cast.hpp> #include <boost/serialization/void_cast.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/collection_size_type.hpp> #include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/array_wrapper.hpp>
#include <boost/serialization/singleton.hpp> #include <boost/serialization/singleton.hpp>
#include <boost/archive/archive_exception.hpp> #include <boost/archive/archive_exception.hpp>
@ -67,6 +69,8 @@
#include <boost/archive/detail/archive_serializer_map.hpp> #include <boost/archive/detail/archive_serializer_map.hpp>
#include <boost/archive/detail/check.hpp> #include <boost/archive/detail/check.hpp>
#include <boost/core/addressof.hpp>
namespace boost { namespace boost {
namespace serialization { namespace serialization {
@ -252,7 +256,7 @@ struct save_non_pointer_type {
template<class T> template<class T>
static void invoke(Archive &ar, const T & t){ static void invoke(Archive &ar, const T & t){
ar.save_object( ar.save_object(
& t, boost::addressof(t),
boost::serialization::singleton< boost::serialization::singleton<
oserializer<Archive, T> oserializer<Archive, T>
>::get_const_instance() >::get_const_instance()
@ -260,6 +264,8 @@ struct save_non_pointer_type {
} }
}; };
// adds class information to the archive. This includes // adds class information to the archive. This includes
// serialization level and class version // serialization level and class version
struct save_conditional { struct save_conditional {
@ -337,7 +343,7 @@ struct save_pointer_type {
}; };
template<class T> template<class T>
static const basic_pointer_oserializer * register_type(Archive &ar, T & /*t*/){ static const basic_pointer_oserializer * register_type(Archive &ar, T* const /*t*/){
// there should never be any need to save an abstract polymorphic // there should never be any need to save an abstract polymorphic
// class pointer. Inhibiting code generation for this // class pointer. Inhibiting code generation for this
// permits abstract base classes to be used - note: exception // permits abstract base classes to be used - note: exception
@ -404,7 +410,7 @@ struct save_pointer_type {
// if its not a pointer to a more derived type // if its not a pointer to a more derived type
const void *vp = static_cast<const void *>(&t); const void *vp = static_cast<const void *>(&t);
if(*this_type == *true_type){ if(*this_type == *true_type){
const basic_pointer_oserializer * bpos = register_type(ar, t); const basic_pointer_oserializer * bpos = register_type(ar, &t);
ar.save_pointer(vp, bpos); ar.save_pointer(vp, bpos);
return; return;
} }
@ -463,7 +469,7 @@ struct save_pointer_type {
template<class TPtr> template<class TPtr>
static void invoke(Archive &ar, const TPtr t){ static void invoke(Archive &ar, const TPtr t){
register_type(ar, * t); register_type(ar, t);
if(NULL == t){ if(NULL == t){
basic_oarchive & boa basic_oarchive & boa
= boost::serialization::smart_cast_reference<basic_oarchive &>(ar); = boost::serialization::smart_cast_reference<basic_oarchive &>(ar);
@ -501,7 +507,14 @@ struct save_array_type
); );
boost::serialization::collection_size_type count(c); boost::serialization::collection_size_type count(c);
ar << BOOST_SERIALIZATION_NVP(count); ar << BOOST_SERIALIZATION_NVP(count);
ar << serialization::make_array(static_cast<value_type const*>(&t[0]),count); // explict template arguments to pass intel C++ compiler
ar << serialization::make_array<
const value_type,
boost::serialization::collection_size_type
>(
static_cast<const value_type *>(&t[0]),
count
);
} }
}; };

View File

@ -0,0 +1,218 @@
#ifndef BOOST_ARCHIVE_DETAIL_POLYMORPHIC_IARCHIVE_ROUTE_HPP
#define BOOST_ARCHIVE_DETAIL_POLYMORPHIC_IARCHIVE_ROUTE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// polymorphic_iarchive_route.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 <string>
#include <ostream>
#include <cstddef>
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
} // namespace std
#endif
#include <boost/cstdint.hpp>
#include <boost/integer_traits.hpp>
#include <boost/archive/polymorphic_iarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
namespace archive {
namespace detail{
class basic_iserializer;
class basic_pointer_iserializer;
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
template<class ArchiveImplementation>
class polymorphic_iarchive_route :
public polymorphic_iarchive,
// note: gcc dynamic cross cast fails if the the derivation below is
// not public. I think this is a mistake.
public /*protected*/ ArchiveImplementation
{
private:
// these are used by the serialization library.
virtual void load_object(
void *t,
const basic_iserializer & bis
){
ArchiveImplementation::load_object(t, bis);
}
virtual 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 & type
)
){
return ArchiveImplementation::load_pointer(t, bpis_ptr, finder);
}
virtual void set_library_version(library_version_type archive_library_version){
ArchiveImplementation::set_library_version(archive_library_version);
}
virtual library_version_type get_library_version() const{
return ArchiveImplementation::get_library_version();
}
virtual unsigned int get_flags() const {
return ArchiveImplementation::get_flags();
}
virtual void delete_created_pointers(){
ArchiveImplementation::delete_created_pointers();
}
virtual void reset_object_address(
const void * new_address,
const void * old_address
){
ArchiveImplementation::reset_object_address(new_address, old_address);
}
virtual void load_binary(void * t, std::size_t size){
ArchiveImplementation::load_binary(t, size);
}
// primitive types the only ones permitted by polymorphic archives
virtual void load(bool & t){
ArchiveImplementation::load(t);
}
virtual void load(char & t){
ArchiveImplementation::load(t);
}
virtual void load(signed char & t){
ArchiveImplementation::load(t);
}
virtual void load(unsigned char & t){
ArchiveImplementation::load(t);
}
#ifndef BOOST_NO_CWCHAR
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
virtual void load(wchar_t & t){
ArchiveImplementation::load(t);
}
#endif
#endif
virtual void load(short & t){
ArchiveImplementation::load(t);
}
virtual void load(unsigned short & t){
ArchiveImplementation::load(t);
}
virtual void load(int & t){
ArchiveImplementation::load(t);
}
virtual void load(unsigned int & t){
ArchiveImplementation::load(t);
}
virtual void load(long & t){
ArchiveImplementation::load(t);
}
virtual void load(unsigned long & t){
ArchiveImplementation::load(t);
}
#if defined(BOOST_HAS_LONG_LONG)
virtual void load(boost::long_long_type & t){
ArchiveImplementation::load(t);
}
virtual void load(boost::ulong_long_type & t){
ArchiveImplementation::load(t);
}
#elif defined(BOOST_HAS_MS_INT64)
virtual void load(__int64 & t){
ArchiveImplementation::load(t);
}
virtual void load(unsigned __int64 & t){
ArchiveImplementation::load(t);
}
#endif
virtual void load(float & t){
ArchiveImplementation::load(t);
}
virtual void load(double & t){
ArchiveImplementation::load(t);
}
virtual void load(std::string & t){
ArchiveImplementation::load(t);
}
#ifndef BOOST_NO_STD_WSTRING
virtual void load(std::wstring & t){
ArchiveImplementation::load(t);
}
#endif
// used for xml and other tagged formats default does nothing
virtual void load_start(const char * name){
ArchiveImplementation::load_start(name);
}
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
typedef mpl::bool_<true> is_loading;
typedef mpl::bool_<false> is_saving;
// the >> operator
template<class T>
polymorphic_iarchive & operator>>(T & t){
return polymorphic_iarchive::operator>>(t);
}
// the & operator
template<class T>
polymorphic_iarchive & operator&(T & t){
return polymorphic_iarchive::operator&(t);
}
// register type function
template<class T>
const basic_pointer_iserializer *
register_type(T * t = NULL){
return ArchiveImplementation::register_type(t);
}
// all current archives take a stream as constructor argument
template <class _Elem, class _Tr>
polymorphic_iarchive_route(
std::basic_istream<_Elem, _Tr> & is,
unsigned int flags = 0
) :
ArchiveImplementation(is, flags)
{}
virtual ~polymorphic_iarchive_route(){};
};
} // namespace detail
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_DETAIL_POLYMORPHIC_IARCHIVE_DISPATCH_HPP

View File

@ -0,0 +1,209 @@
#ifndef BOOST_ARCHIVE_DETAIL_POLYMORPHIC_OARCHIVE_ROUTE_HPP
#define BOOST_ARCHIVE_DETAIL_POLYMORPHIC_OARCHIVE_ROUTE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// polymorphic_oarchive_route.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 <string>
#include <ostream>
#include <cstddef> // size_t
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
} // namespace std
#endif
#include <boost/cstdint.hpp>
#include <boost/integer_traits.hpp>
#include <boost/archive/polymorphic_oarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
namespace archive {
namespace detail{
class basic_oserializer;
class basic_pointer_oserializer;
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
template<class ArchiveImplementation>
class polymorphic_oarchive_route :
public polymorphic_oarchive,
// note: gcc dynamic cross cast fails if the the derivation below is
// not public. I think this is a mistake.
public /*protected*/ ArchiveImplementation
{
private:
// these are used by the serialization library.
virtual void save_object(
const void *x,
const detail::basic_oserializer & bos
){
ArchiveImplementation::save_object(x, bos);
}
virtual void save_pointer(
const void * t,
const detail::basic_pointer_oserializer * bpos_ptr
){
ArchiveImplementation::save_pointer(t, bpos_ptr);
}
virtual void save_null_pointer(){
ArchiveImplementation::save_null_pointer();
}
// primitive types the only ones permitted by polymorphic archives
virtual void save(const bool t){
ArchiveImplementation::save(t);
}
virtual void save(const char t){
ArchiveImplementation::save(t);
}
virtual void save(const signed char t){
ArchiveImplementation::save(t);
}
virtual void save(const unsigned char t){
ArchiveImplementation::save(t);
}
#ifndef BOOST_NO_CWCHAR
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
virtual void save(const wchar_t t){
ArchiveImplementation::save(t);
}
#endif
#endif
virtual void save(const short t){
ArchiveImplementation::save(t);
}
virtual void save(const unsigned short t){
ArchiveImplementation::save(t);
}
virtual void save(const int t){
ArchiveImplementation::save(t);
}
virtual void save(const unsigned int t){
ArchiveImplementation::save(t);
}
virtual void save(const long t){
ArchiveImplementation::save(t);
}
virtual void save(const unsigned long t){
ArchiveImplementation::save(t);
}
#if defined(BOOST_HAS_LONG_LONG)
virtual void save(const boost::long_long_type t){
ArchiveImplementation::save(t);
}
virtual void save(const boost::ulong_long_type t){
ArchiveImplementation::save(t);
}
#elif defined(BOOST_HAS_MS_INT64)
virtual void save(const boost::int64_t t){
ArchiveImplementation::save(t);
}
virtual void save(const boost::uint64_t t){
ArchiveImplementation::save(t);
}
#endif
virtual void save(const float t){
ArchiveImplementation::save(t);
}
virtual void save(const double t){
ArchiveImplementation::save(t);
}
virtual void save(const std::string & t){
ArchiveImplementation::save(t);
}
#ifndef BOOST_NO_STD_WSTRING
virtual void save(const std::wstring & t){
ArchiveImplementation::save(t);
}
#endif
virtual library_version_type get_library_version() const{
return ArchiveImplementation::get_library_version();
}
virtual unsigned int get_flags() const {
return ArchiveImplementation::get_flags();
}
virtual void save_binary(const void * t, std::size_t size){
ArchiveImplementation::save_binary(t, size);
}
// used for xml and other tagged formats default does nothing
virtual void save_start(const char * name){
ArchiveImplementation::save_start(name);
}
virtual void save_end(const char * name){
ArchiveImplementation::save_end(name);
}
virtual void end_preamble(){
ArchiveImplementation::end_preamble();
}
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
typedef mpl::bool_<false> is_loading;
typedef mpl::bool_<true> is_saving;
// the << operator
template<class T>
polymorphic_oarchive & operator<<(T & t){
return polymorphic_oarchive::operator<<(t);
}
// the & operator
template<class T>
polymorphic_oarchive & operator&(T & t){
return polymorphic_oarchive::operator&(t);
}
// register type function
template<class T>
const basic_pointer_oserializer *
register_type(T * t = NULL){
return ArchiveImplementation::register_type(t);
}
// all current archives take a stream as constructor argument
template <class _Elem, class _Tr>
polymorphic_oarchive_route(
std::basic_ostream<_Elem, _Tr> & os,
unsigned int flags = 0
) :
ArchiveImplementation(os, flags)
{}
virtual ~polymorphic_oarchive_route(){};
};
} // namespace detail
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_DETAIL_POLYMORPHIC_OARCHIVE_DISPATCH_HPP

View File

@ -9,26 +9,21 @@
#include <boost/config.hpp> #include <boost/config.hpp>
// std::codecvt_utf8 doesn't seem to work for msvc #ifdef BOOST_NO_STD_WSTREAMBUF
// versions prior to MSVC 14.0 #error "wide char i/o not supported on this platform"
#endif
#if defined(_MSC_VER) && _MSC_VER < 1900 \ // use boost's utf8 codecvt facet
|| defined( BOOST_NO_CXX11_HDR_CODECVT ) #include <boost/archive/detail/decl.hpp>
#include <boost/archive/detail/decl.hpp> #define BOOST_UTF8_BEGIN_NAMESPACE \
#define BOOST_UTF8_BEGIN_NAMESPACE \ namespace boost { namespace archive { namespace detail {
namespace boost { namespace archive { namespace detail { #define BOOST_UTF8_DECL BOOST_ARCHIVE_DECL
#define BOOST_UTF8_DECL BOOST_ARCHIVE_DECL #define BOOST_UTF8_END_NAMESPACE }}}
#define BOOST_UTF8_END_NAMESPACE }}}
#include <boost/detail/utf8_codecvt_facet.hpp> #include <boost/detail/utf8_codecvt_facet.hpp>
#undef BOOST_UTF8_END_NAMESPACE
#undef BOOST_UTF8_DECL
#undef BOOST_UTF8_BEGIN_NAMESPACE
#undef BOOST_UTF8_END_NAMESPACE
#undef BOOST_UTF8_DECL
#undef BOOST_UTF8_BEGIN_NAMESPACE
#else
#include <codecvt>
namespace boost { namespace archive { namespace detail {
typedef std::codecvt_utf8<wchar_t> utf8_codecvt_facet;
} } }
#endif // BOOST_NO_CXX11_HDR_CODECVT
#endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP #endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP

View File

@ -47,6 +47,10 @@ archive_serializer_map<Archive>::insert(const basic_serializer * bs){
template<class Archive> template<class Archive>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void BOOST_ARCHIVE_OR_WARCHIVE_DECL void
archive_serializer_map<Archive>::erase(const basic_serializer * bs){ archive_serializer_map<Archive>::erase(const basic_serializer * bs){
// note: previously this conditional was a runtime assertion with
// BOOST_ASSERT. We've changed it because we've discovered that at
// least one platform is not guaranteed to destroy singletons in
// reverse order of distruction.
if(boost::serialization::singleton< if(boost::serialization::singleton<
extra_detail::map<Archive> extra_detail::map<Archive>
>::is_destroyed()) >::is_destroyed())

View File

@ -84,6 +84,8 @@ basic_binary_iprimitive<Archive, Elem, Tr>::init()
); );
} }
#ifndef BOOST_NO_CWCHAR
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void BOOST_ARCHIVE_OR_WARCHIVE_DECL void
basic_binary_iprimitive<Archive, Elem, Tr>::load(wchar_t * ws) basic_binary_iprimitive<Archive, Elem, Tr>::load(wchar_t * ws)
@ -93,6 +95,8 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(wchar_t * ws)
load_binary(ws, l * sizeof(wchar_t) / sizeof(char)); load_binary(ws, l * sizeof(wchar_t) / sizeof(char));
ws[l] = L'\0'; ws[l] = L'\0';
} }
#endif
#endif
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void BOOST_ARCHIVE_OR_WARCHIVE_DECL void
@ -110,7 +114,6 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(std::string & s)
load_binary(&(*s.begin()), l); load_binary(&(*s.begin()), l);
} }
#ifndef BOOST_NO_CWCHAR
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void BOOST_ARCHIVE_OR_WARCHIVE_DECL void
basic_binary_iprimitive<Archive, Elem, Tr>::load(char * s) basic_binary_iprimitive<Archive, Elem, Tr>::load(char * s)
@ -120,7 +123,6 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(char * s)
load_binary(s, l); load_binary(s, l);
s[l] = '\0'; s[l] = '\0';
} }
#endif
#ifndef BOOST_NO_STD_WSTRING #ifndef BOOST_NO_STD_WSTRING
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>

View File

@ -71,6 +71,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::string &s)
} }
#ifndef BOOST_NO_CWCHAR #ifndef BOOST_NO_CWCHAR
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void BOOST_ARCHIVE_OR_WARCHIVE_DECL void
basic_binary_oprimitive<Archive, Elem, Tr>::save(const wchar_t * ws) basic_binary_oprimitive<Archive, Elem, Tr>::save(const wchar_t * ws)
@ -91,6 +92,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::wstring &ws)
save_binary(ws.data(), l * sizeof(wchar_t) / sizeof(char)); save_binary(ws.data(), l * sizeof(wchar_t) / sizeof(char));
} }
#endif #endif
#endif // BOOST_NO_CWCHAR
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_ARCHIVE_OR_WARCHIVE_DECL

View File

@ -64,7 +64,7 @@ namespace archive {
// XML grammar parsing // XML grammar parsing
template<class CharType> template<class CharType>
class basic_xml_grammar { class BOOST_SYMBOL_VISIBLE basic_xml_grammar {
public: public:
// The following is not necessary according to DR45, but at least // The following is not necessary according to DR45, but at least
// one compiler (Compaq C++ 6.5 in strict_ansi mode) chokes otherwise. // one compiler (Compaq C++ 6.5 in strict_ansi mode) chokes otherwise.

View File

@ -56,7 +56,7 @@ text_wiarchive_impl<Archive>::load(std::string &s)
s.resize(0); s.resize(0);
s.reserve(size); s.reserve(size);
while(size-- > 0){ while(size-- > 0){
int x = is.narrow(is.get(), '\0'); char x = is.narrow(is.get(), '\0');
s += x; s += x;
} }
} }

View File

@ -161,13 +161,13 @@ xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
gimpl(new xml_wgrammar()) gimpl(new xml_wgrammar())
{ {
if(0 == (flags & no_codecvt)){ if(0 == (flags & no_codecvt)){
std::locale l = std::locale( archive_locale = std::locale(
is_.getloc(), is_.getloc(),
new boost::archive::detail::utf8_codecvt_facet new boost::archive::detail::utf8_codecvt_facet
); );
// libstdc++ crashes without this // libstdc++ crashes without this
is_.sync(); is_.sync();
is_.imbue(l); is_.imbue(archive_locale);
} }
if(0 == (flags & no_header)) if(0 == (flags & no_header))
init(); init();

View File

@ -17,7 +17,9 @@
#include <cstring> // strlen #include <cstring> // strlen
#include <cstdlib> // mbtowc #include <cstdlib> // mbtowc
#ifndef BOOST_NO_CWCHAR
#include <cwchar> // wcslen #include <cwchar> // wcslen
#endif
#include <boost/config.hpp> #include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
@ -101,7 +103,6 @@ xml_woarchive_impl<Archive>::save(const char * s){
template<class Archive> template<class Archive>
BOOST_WARCHIVE_DECL void BOOST_WARCHIVE_DECL void
xml_woarchive_impl<Archive>::save(const wchar_t * ws){ xml_woarchive_impl<Archive>::save(const wchar_t * ws){
os << ws;
typedef iterators::xml_escape<const wchar_t *> xmbtows; typedef iterators::xml_escape<const wchar_t *> xmbtows;
std::copy( std::copy(
xmbtows(ws), xmbtows(ws),
@ -124,12 +125,12 @@ xml_woarchive_impl<Archive>::xml_woarchive_impl(
basic_xml_oarchive<Archive>(flags) basic_xml_oarchive<Archive>(flags)
{ {
if(0 == (flags & no_codecvt)){ if(0 == (flags & no_codecvt)){
std::locale l = std::locale( archive_locale = std::locale(
os_.getloc(), os_.getloc(),
new boost::archive::detail::utf8_codecvt_facet new boost::archive::detail::utf8_codecvt_facet
); );
os_.flush(); os_.flush();
os_.imbue(l); os_.imbue(archive_locale);
} }
if(0 == (flags & no_header)) if(0 == (flags & no_header))
this->init(); this->init();
@ -141,7 +142,7 @@ xml_woarchive_impl<Archive>::~xml_woarchive_impl(){
if(std::uncaught_exception()) if(std::uncaught_exception())
return; return;
if(0 == (this->get_flags() & no_header)){ if(0 == (this->get_flags() & no_header)){
save(L"</boost_serialization>\n"); os << L"</boost_serialization>";
} }
} }

View File

@ -41,7 +41,7 @@ template<class CharType>
struct from_6_bit { struct from_6_bit {
typedef CharType result_type; typedef CharType result_type;
CharType operator()(CharType t) const{ CharType operator()(CharType t) const{
const char * lookup_table = static const char * lookup_table =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz"
"0123456789" "0123456789"

View File

@ -37,7 +37,7 @@ template<class CharType>
struct to_6_bit { struct to_6_bit {
typedef CharType result_type; typedef CharType result_type;
CharType operator()(CharType t) const{ CharType operator()(CharType t) const{
const signed char lookup_table[] = { static const signed char lookup_table[] = {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,

View File

@ -102,7 +102,8 @@ public:
super_t(base), super_t(base),
m_bnext(NULL), m_bnext(NULL),
m_bend(NULL), m_bend(NULL),
m_full(false) m_full(false),
m_current_value(0)
{ {
} }
}; };

Some files were not shown because too many files have changed in this diff Show More