Add Music Manager's boost 1.40.0 source.

Change-Id: I9705f922931216d923928132f2e464dd0625c4fb
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ff6170f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,31 @@
+/build
+/source/build
+*.mode1v3
+*.pbxuser
+*.pbxindex/
+!user.pbxuser
+/*.log
+*.user
+*.ncb
+*.suo
+*.pdb
+*.pdf
+*.html
+*.idb
+*.o
+*.lo
+*.a
+*.so
+*.so.0
+*.la
+.deps
+.libs
+*.pyc
+.DS_Store
+# Emacs and other editor backup files
+*~
+
+# builds on Windows
+Debug/
+Release/
+release/
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 213d4aa..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-common_SRC_FILES := \
-	libs/thread/src/pthread/thread.cpp \
-	libs/thread/src/pthread/once.cpp
-
-common_CFLAGS := -O3 -fvisibility=hidden -pthread
-common_CPPFLAGS := -fexceptions
-
-common_C_INCLUDES += $(LOCAL_PATH)/boost
-
-include $(CLEAR_VARS)
-
-LOCAL_SDK_VERSION := 9
-LOCAL_NDK_VERSION := 5
-LOCAL_NDK_STL_VARIANT := gnustl_static
-
-LOCAL_C_INCLUDES := $(common_C_INCLUDES)
-LOCAL_SRC_FILES := $(common_SRC_FILES)
-LOCAL_CFLAGS += $(common_CFLAGS)
-LOCAL_CPPFLAGS += $(common_CPPFLAGS)
-
-LOCAL_MODULE:= libboost
-
-include $(BUILD_STATIC_LIBRARY)
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..e4ddc93
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,259 @@
+##########################################################################
+# CMake Build Rules for Boost                                            #
+##########################################################################
+# Copyright (C) 2007, 2008 Douglas Gregor <doug.gregor@gmail.com>        #
+# Copyright (C) 2007, 2009 Troy Straszheim <troy@resophonic.com>         #
+#                                                                        #
+# 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                                 #
+##########################################################################
+# Basic Usage:                                                           #
+#                                                                        #
+#   On Unix variants:                                                    #
+#     ccmake BOOST_DIRECTORY                                             #
+#                                                                        #
+#     (c)onfigure options to your liking, then (g)enerate                #
+#     makefiles. Use "make" to build, "make test" to test, "make         #
+#     install" to install, and "make package" to build binary            #
+#     packages.                                                          #
+#                                                                        #
+#   On Windows:                                                          #
+#     run the CMake GNU, load the Boost directory, and generate          #
+#     project files or makefiles for your environment.                   #
+#                                                                        #
+# For more information about CMake, see http://www.cmake.org             #
+##########################################################################
+cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
+project(Boost)
+
+##########################################################################
+# Version information                                                    #
+##########################################################################
+
+# We parse the version information from the boost/version.hpp header.
+file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/boost/version.hpp BOOST_VERSIONSTR
+  REGEX "#define[ ]+BOOST_VERSION[ ]+[0-9]+")
+string(REGEX MATCH "[0-9]+" BOOST_VERSIONSTR ${BOOST_VERSIONSTR})
+if (BOOST_VERSIONSTR)
+  math(EXPR BOOST_VERSION_MAJOR "${BOOST_VERSIONSTR} / 100000")
+  math(EXPR BOOST_VERSION_MINOR "${BOOST_VERSIONSTR} / 100 % 1000")
+  math(EXPR BOOST_VERSION_SUBMINOR "${BOOST_VERSIONSTR} % 100")
+  set(BOOST_VERSION "${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}.${BOOST_VERSION_SUBMINOR}")
+  message(STATUS "Boost version ${BOOST_VERSION}")
+else()
+  message(FATAL_ERROR 
+    "Unable to parse Boost version from ${CMAKE_CURRENT_SOURCE_DIR}/boost/version.hpp")
+endif()
+
+# Make sure that we reconfigure when boost/version.hpp changes.
+configure_file(boost/version.hpp
+   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/version.stamp)
+##########################################################################
+
+# Put the libaries and binaries that get built into directories at the
+# top of the build tree rather than in hard-to-find leaf
+# directories. This simplifies manual testing and the use of the build
+# tree rather than installed Boost libraries.
+SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+
+##########################################################################
+# Boost CMake modules                                                    #
+##########################################################################
+list(APPEND CMAKE_MODULE_PATH ${Boost_SOURCE_DIR}/tools/build/CMake)
+include(BoostUtils)
+include(BoostConfig)
+include(BoostCore)
+include(BoostDocs)
+include(CTest)
+include(BoostTesting)
+message(STATUS "Build name: ${BUILDNAME}")
+##########################################################################
+
+##########################################################################
+# Build Features and Variants                                            #
+##########################################################################
+
+# Determine default settings for the variable BUILD_feature options
+if (MSVC)
+  set(BUILD_SINGLE_THREADED_DEFAULT OFF)
+else ()
+  set(BUILD_SINGLE_THREADED_DEFAULT OFF)
+endif ()
+
+# User-level options deciding which variants we will build. 
+option(BUILD_STATIC "Whether to build static libraries" ON)
+option(BUILD_SHARED "Whether to build shared libraries" ON)
+option(BUILD_DEBUG "Whether to build debugging libraries" ON)
+option(BUILD_RELEASE "Whether to build release libraries" ON)
+option(BUILD_SINGLE_THREADED "Whether to build single-threaded libraries" 
+       ${BUILD_SINGLE_THREADED_DEFAULT})
+option(BUILD_MULTI_THREADED "Whether to build multi-threaded libraries" ON)
+
+if(UNIX)
+  option(BUILD_VERSIONED "Add versioning information to names of built files" OFF)
+else(UNIX)
+  option(BUILD_VERSIONED "Add versioning information to names of built files" ON)
+endif(UNIX)
+
+# For now, we only actually support static/dynamic run-time variants for 
+# Visual C++. Provide both options for Visual C++ users, but just fix
+# the values of the variables for all other platforms.
+if(MSVC)
+  option(BUILD_STATIC_RUNTIME "Whether to build libraries linking against the static runtime" ON)
+  option(BUILD_DYNAMIC_RUNTIME "Whether to build libraries linking against the dynamic runtime" ON)
+else(MSVC)
+  set(BUILD_STATIC_RUNTIME OFF)
+  set(BUILD_DYNAMIC_RUNTIME ON)
+endif(MSVC)
+
+# The default set of library variants that we will be building
+boost_add_default_variant(RELEASE DEBUG)
+boost_add_default_variant(STATIC SHARED)
+boost_add_default_variant(SINGLE_THREADED MULTI_THREADED)
+boost_add_default_variant(DYNAMIC_RUNTIME STATIC_RUNTIME)
+
+# Extra features used by some libraries
+set(BUILD_PYTHON_NODEBUG ON)
+boost_add_extra_variant(PYTHON_NODEBUG PYTHON_DEBUG)
+##########################################################################
+
+##########################################################################
+# Installation                                                           #
+##########################################################################
+if(BUILD_VERSIONED)
+  if(BOOST_VERSION_SUBMINOR GREATER 0)
+    set(BOOST_HEADER_DIR 
+      "include/boost-${BOOST_VERSION_MAJOR}_${BOOST_VERSION_MINOR}_${BOOST_VERSION_SUBMINOR}")
+  else(BOOST_VERSION_SUBMINOR GREATER 0)
+    set(BOOST_HEADER_DIR 
+      "include/boost-${BOOST_VERSION_MAJOR}_${BOOST_VERSION_MINOR}")  
+  endif(BOOST_VERSION_SUBMINOR GREATER 0)
+else(BUILD_VERSIONED)
+  set(BOOST_HEADER_DIR "include/")
+endif(BUILD_VERSIONED)
+install(DIRECTORY boost 
+  DESTINATION ${BOOST_HEADER_DIR}
+  PATTERN "CVS" EXCLUDE
+  PATTERN ".svn" EXCLUDE)
+#
+# TDS 20080526:  Getting a segfault here even with the ifs.   At r45780, with these lines 
+# uncommented:
+# 1. cmake the workspace
+# 2. run ccmake and turn OFF BUILD_MULTI_THREADED and BUILD_SHARED
+# 3. 'c' to configure
+# 4. 'g' to generate.... segfault.
+# 5. run rebuild_cache at the command line:  no segfault this time.
+#
+# With these lines commented out, step 4 above does not segfault.
+#
+#if (NOT TEST_INSTALLED_TREE)
+  # If I don't have if around this, I get a seg fault
+#  install(EXPORT boost-targets DESTINATION "lib/Boost${BOOST_VERSION}")
+#endif (NOT TEST_INSTALLED_TREE)
+##########################################################################
+
+##########################################################################
+# Binary packages                                                        #
+##########################################################################
+set(CPACK_PACKAGE_NAME "Boost")
+set(CPACK_PACKAGE_VENDOR "Boost.org")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Boost ${BOOST_VERSION}")
+
+if (EXISTS "${Boost_SOURCE_DIR}/README.txt")
+  message(STATUS "Using generic cpack package description file.")
+  set(CPACK_PACKAGE_DESCRIPTION_FILE "${Boost_SOURCE_DIR}/README.txt")
+  set(CPACK_RESOURCE_FILE_README "${Boost_SOURCE_DIR}/README.txt")
+endif ()
+
+set(CPACK_RESOURCE_FILE_LICENSE "${Boost_SOURCE_DIR}/LICENSE_1_0.txt")
+if (EXISTS "${Boost_SOURCE_DIR}/Welcome.txt")
+  message(STATUS "Using generic cpack welcome file.")
+  set(CPACK_RESOURCE_FILE_WELCOME "${Boost_SOURCE_DIR}/Welcome.txt")
+endif()
+
+set(CPACK_PACKAGE_VERSION "${BOOST_VERSION}")
+set(CPACK_PACKAGE_VERSION_MAJOR "${BOOST_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${BOOST_VERSION_MINOR}")
+set(CPACK_PACKAGE_VERSION_PATCH "${BOOST_VERSION_SUBMINOR}")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "Boost")
+
+if(WIN32 AND NOT UNIX)
+  # There is a bug in NSI that does not handle full unix paths properly. Make
+  # sure there is at least one set of four (4) backlasshes.
+  # NOTE: No Boost icon yet
+#  set(CPACK_PACKAGE_ICON "${Boost_SOURCE_DIR}/tools/build/CMake\\\\InstallIcon.bmp")
+#  set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
+  set(CPACK_NSIS_DISPLAY_NAME "Boost ${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}.${BOOST_VERSION_SUBMINOR}")
+  set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.boost.org")
+  set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.boost.org")
+  set(CPACK_NSIS_CONTACT "boost-users@lists.boost.org")
+  set(CPACK_NSIS_MODIFY_PATH ON)
+  
+  # Encode the compiler name in the package 
+  if (MSVC60)
+    set(CPACK_PACKAGE_FILE_NAME "Boost-${BOOST_VERSION}-vc6")
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_DISPLAY_NAME} for Microsoft Visual C++ 6")
+  elseif (MSVC70)
+    set(CPACK_PACKAGE_FILE_NAME "Boost-${BOOST_VERSION}-vc7")
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_DISPLAY_NAME} for Microsoft Visual Studio 2002")
+  elseif (MSVC71)
+    set(CPACK_PACKAGE_FILE_NAME "Boost-${BOOST_VERSION}-vc71")
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_DISPLAY_NAME} for Microsoft Visual Studio 2003")
+  elseif (MSVC80)
+    set(CPACK_PACKAGE_FILE_NAME "Boost-${BOOST_VERSION}-vc8")
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_DISPLAY_NAME} for Microsoft Visual Studio 2005")    
+  elseif (MSVC90)
+    set(CPACK_PACKAGE_FILE_NAME "Boost-${BOOST_VERSION}-vc9")
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_DISPLAY_NAME} for Microsoft Visual Studio 2008")
+  elseif (BORLAND)
+    set(CPACK_PACKAGE_FILE_NAME "Boost-${BOOST_VERSION}-borland")  
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_DISPLAY_NAME} for Borland C++ Builder")    
+  endif (MSVC60)
+  set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_NSIS_DISPLAY_NAME}")
+endif(WIN32 AND NOT UNIX)
+include(CPack)
+
+option(BOOST_INSTALLER_ON_THE_FLY
+       "Whether to build installers that download components on-the-fly" OFF)
+
+if (BOOST_INSTALLER_ON_THE_FLY)
+  if(COMMAND cpack_configure_downloads)
+    cpack_configure_downloads(
+    "http://www.osl.iu.edu/~dgregor/Boost-CMake/${BOOST_VERSION}/"
+      ALL ADD_REMOVE)
+  endif()
+endif()
+
+##########################################################################
+
+##########################################################################
+# Building Boost libraries                                               #
+##########################################################################
+# Always include the directory where Boost's include files will be.
+if (TEST_INSTALLED_TREE)
+  # Use the headers from the installation directory
+  include_directories("${CMAKE_INSTALL_PREFIX}/${BOOST_HEADER_DIR}")
+else (TEST_INSTALLED_TREE)
+  # Use the headers directly from the Boost source tree (in boost/)
+  include_directories(${Boost_SOURCE_DIR})
+endif (TEST_INSTALLED_TREE)
+
+# Boost.Build version 2 does this due to trouble with autolinking
+# during building and testing.  
+# TODO: See if we can actually use auto-linking in our regression tests.
+add_definitions(-DBOOST_ALL_NO_LIB=1)
+
+# Add build rules for documentation
+add_subdirectory(doc)
+
+# Add build rules for all of the Boost libraries
+add_subdirectory(libs)
+
+# Add build rules for all of the Boost tools
+# TODO: On hold while I work on the modularity code
+add_subdirectory(tools)
+##########################################################################
+
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
new file mode 100644
index 0000000..567d7b8
--- /dev/null
+++ b/CTestConfig.cmake
@@ -0,0 +1,13 @@
+## This file should be placed in the root directory of your project.
+## Then modify the CMakeLists.txt file in the root directory of your
+## project to incorporate the testing dashboard.
+## # The following are required to uses Dart and the Cdash dashboard
+##   ENABLE_TESTING()
+##   INCLUDE(CTest)
+set(CTEST_PROJECT_NAME "Boost")
+set(CTEST_NIGHTLY_START_TIME "03:00:00 EST")
+
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDashPublic/submit.php?project=Boost")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Jamroot b/Jamroot
index c5557b8..eb1d840 100644
--- a/Jamroot
+++ b/Jamroot
@@ -63,7 +63,7 @@
 #                           versions of Boost or multiple compilers can
 #                           be used on the same system.
 #
-#                               versioned - Names of boost binaries
+#                               versioned (default) - 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
@@ -84,18 +84,9 @@
 #                               is intended for system integrators who are
 #                               building distribution packages.
 #
-#                           The default value is 'versioned' on Windows, and
-#                           'system' on Unix.
-#
 #   --buildid=ID            Adds the specified ID to the name of built
 #                           libraries.  The default is to not add anything.
 #
-#   --python-buildid=ID     Adds 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>
@@ -123,49 +114,46 @@
 #  - handle boost version
 #  - handle python options such as pydebug
 
-import boostcpp ;
-import package ;
-
-import sequence ;
-import xsltproc ;
+import generate ;
+import modules ;
 import set ;
+import stage ;
+import package ;
 import path ;
+import common ;
+import os ;
+import regex ;
+import errors ;
+import "class" : new ;
+import common ;
+import sequence ;
+import symlink ;
+import targets ;
+import project ;
+import option ;
 
 path-constant BOOST_ROOT : . ;
-constant BOOST_VERSION : 1.47.0 ;
+constant BOOST_VERSION : 1.40.0 ;
 constant BOOST_JAMROOT_MODULE : $(__name__) ;
 
-boostcpp.set-version $(BOOST_VERSION) ;
-
-project boost
-    : requirements <include>.
-      # 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
-      # The standard library Sun compilers use by default has no chance
-      # of working with Boost. Override it.
-      <toolset>sun:<stdlib>sun-stlport
-      # 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
+local version-tag = [ MATCH "^([^.]+)[.]([^.]+)[.]([^.]+)" : $(BOOST_VERSION) ]
     ;
-
-# 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 )
+if $(version-tag[3]) = 0
 {
-    return [ boostcpp.tag $(name) : $(type) : $(property-set) ] ;
+    version-tag = $(version-tag[1-2]) ;
 }
-   
+
+constant BOOST_VERSION_TAG : $(version-tag:J="_") ;
+
+# Option to choose how many variants to build. The default is "minimal".
+local build-type = [ MATCH "^--build-type=(.*)" : [ modules.peek : ARGV ] ] ;
+build-type ?= minimal ;
+if ! ( $(build-type) in minimal complete )
+{
+    ECHO "The value of the --build-type option should be either 'complete' or 'minimal'" ;
+    EXIT ;
+}
+
 rule handle-static-runtime ( properties * )
 {
     # Using static runtime with shared libraries is impossible on Linux,
@@ -183,6 +171,25 @@
     }
 }
 
+
+project boost
+    : requirements <include>.
+      # 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
+      # The standard library Sun compilers use by default has no chance
+      # of working with Boost. Override it.
+      <toolset>sun:<stdlib>sun-stlport
+    : usage-requirements <include>.
+    : build-dir bin.v2
+    ;
+
+
+# Setup convenient aliases for all libraries.
+
 all-libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ]
     [ glob libs/*/build/Jamfile ] ]
     ;
@@ -192,7 +199,6 @@
 # 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 + )
 {
@@ -200,6 +206,7 @@
     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 ;
@@ -217,14 +224,448 @@
 }
 
 alias headers : : : : <include>. ;
-explicit headers ;
 
-# Make project ids of all libraries known.
-for local l in $(all-libraries)
+
+# Decides which libraries are to be installed by looking at --with-<library>
+# --without-<library> arguments. Returns the list of directories under "libs"
+# which must be built and installed.
+#
+rule libraries-to-install ( existing-libraries * )
 {
-    use-project /boost/$(l) : libs/$(l)/build ;
+   local argv = [ modules.peek : ARGV ] ;
+   local with-parameter = [ MATCH --with-(.*) : $(argv) ] ;
+   local without-parameter = [ MATCH --without-(.*) : $(argv) ] ;
+   
+   if ! $(with-parameter) && ! $(without-parameter)
+   {
+       # Nothing is specified on command line. See if maybe
+       # project-config.jam has some choices. 
+       local project-config-libs = [ modules.peek project-config : libraries ] ;
+       with-parameter = [ MATCH --with-(.*) : $(project-config-libs) ] ;
+       without-parameter = [ MATCH --without-(.*) : $(project-config-libs) ] ;
+   }
+
+   # Do some checks.
+   if $(with-parameter) && $(without-parameter)
+   {
+       ECHO "error: both --with-<library> and --without-<library> specified" ;
+       EXIT ;
+   }
+
+   local wrong = [ set.difference $(with-parameter) : $(existing-libraries) ] ;
+   if $(wrong)
+   {
+       ECHO "error: wrong library name '$(wrong[1])' in the --with-<library> option." ;
+       EXIT ;
+   }
+   local wrong = [ set.difference $(without-parameter) : $(existing-libraries) ] ;
+   if $(wrong)
+   {
+       ECHO "error: wrong library name '$(wrong[1])' in the --without-<library> option." ;
+       EXIT ;
+   }
+
+   if $(with-parameter)
+   {
+       return [ set.intersection $(existing-libraries) : $(with-parameter) ] ;
+   }
+   else
+   {
+       return [ set.difference $(existing-libraries) : $(without-parameter) ] ;
+   }
 }
 
+
+# What kind of layout are we doing?
+layout = [ option.get layout : "" ] ;
+# On Windows, we used versioned layout by default in order to
+# be compatible with autolink. On other systems, we use system
+# layout which is what every other program uses. Note that windows
+# check is static, and won't 
+if ! $(layout)
+{
+    if [ modules.peek : NT ]
+    {
+        layout = versioned ;
+    }
+    else
+    {
+        layout = system ;
+    }
+}
+layout-$(layout) = true ;
+
+if $(layout) = system && $(build-type) = complete
+{
+    ECHO "error: Cannot use --layout=system with --build-type complete." ;
+    ECHO "error: Please used either --layout=versioned or --layout=tagged " ;
+    ECHO "error: if you wish to build multiple variants." ;
+    if ! [ modules.peek : NT ] 
+    {        
+        ECHO "error: Note that --layout=system is default on Unix starting with Boost 1.40." ;
+    }    
+    EXIT ;
+}
+
+# Possible stage only location.
+local stage-locate = [ MATCH "^--stagedir=(.*)" : [ modules.peek : ARGV ] ] ;
+stage-locate ?= stage ;
+path-constant BOOST_STAGE_LOCATE : $(stage-locate) ;
+
+
+# Python location.
+local python-root = [ MATCH "^--with-python-root=(.*)" : [ modules.peek : ARGV ]
+    ] ;
+PYTHON_ROOT ?= $(python-root) ;
+
+
+# Select the libraries to install.
+libraries = [ libraries-to-install $(all-libraries) ] ;
+
+if --show-libraries in [ modules.peek : ARGV ]
+{
+    ECHO "The following libraries require building:" ;
+    for local l in $(libraries)
+    {
+        ECHO "    - $(l)" ;
+    }
+    EXIT ;
+}
+
+# Custom build ID.
+local build-id = [ MATCH "^--buildid=(.*)" : [ modules.peek : ARGV ] ] ;
+if $(build-id)
+{
+    constant BUILD_ID : [ regex.replace $(build-id) "[*\\/:.\"\' ]" "_" ] ;
+}
+
+
+# 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 )
+{
+    if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
+    {
+        local result ;
+        if $(layout) = versioned
+        {
+            result = [ common.format-name
+                <base> <toolset> <threading> <runtime> -$(BOOST_VERSION_TAG)
+                -$(BUILD_ID)
+                : $(name) : $(type) : $(property-set) ] ;
+        }        
+        else if $(layout) = tagged
+        {
+            result = [ common.format-name
+                <base> <threading> <runtime>
+                -$(BUILD_ID)
+                : $(name) : $(type) : $(property-set) ] ;            
+        }
+        else if $(layout) = system
+        {
+            result = [ common.format-name
+                <base> 
+                -$(BUILD_ID)
+                : $(name) : $(type) : $(property-set) ] ;
+        }
+        else
+        {
+            ECHO "error: invalid layout '$(layout)'" ;
+            EXIT ;               
+        }
+                
+        # Optionally add version suffix. On NT, library with version suffix
+        # will not be recognized by linkers. On CYGWIN, we get strage
+        # duplicate symbol errors when library is generated with version
+        # suffix. On OSX, version suffix is not needed -- the linker expects
+        # the libFoo.1.2.3.dylib format. AIX linkers do not accept version
+        # suffixes either. Pgi compilers can not accept library with version
+        # suffix.
+        if $(type) = SHARED_LIB &&
+          ( ! ( [ $(property-set).get <target-os> ] in windows cygwin darwin aix ) &&
+            ! ( [ $(property-set).get <toolset> ] in pgi ) )
+        {
+            result = $(result).$(BOOST_VERSION)  ;
+        }
+            
+        return $(result) ;
+    }    
+}
+
+
+# Install to system location.
+
+install-requirements = <install-source-root>$(BOOST_ROOT)/boost ;
+
+if $(layout-versioned)
+{
+    install-requirements += <install-header-subdir>boost-$(BOOST_VERSION_TAG)/boost ;
+}
+else
+{
+    install-requirements += <install-header-subdir>boost ;
+}
+if [ modules.peek : NT ]
+{
+    install-requirements += <install-default-prefix>C:/Boost ;
+}
+else if [ modules.peek : UNIX ]
+{
+    install-requirements += <install-default-prefix>/usr/local ;
+}
+
+local 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 ]
+          ;
+
+# Complete install.
+package.install install-proper
+    : $(install-requirements) <install-no-version-symlinks>on
+    :
+    : libs/$(libraries)/build
+    : $(headers)
+    ;
+explicit install-proper ;
+
+# Install just library.
+install stage-proper
+    : libs/$(libraries)/build
+    : <location>$(stage-locate)/lib
+      <install-dependencies>on <install-type>LIB
+      <install-no-version-symlinks>on
+    ;
+explicit stage-proper ;
+
+
+if $(layout-versioned) && ( [ modules.peek : NT ] || [ modules.peek : UNIX ] )
+{
+    rule make-unversioned-links ( project name ? : property-set : sources * )
+    {
+        local result ;
+        local filtered ;
+        local pattern ;
+        local nt = [ modules.peek : NT ] ;
+
+        # Collect the libraries that have the version number in 'filtered'.
+        for local s in $(sources)
+        {
+            local m ;
+            if $(nt)
+            {
+                m = [ MATCH "(.*[.]lib)" : [ $(s).name ] ] ;
+            }
+            else
+            {
+                m = [ MATCH "(.*[.]so[.0-9]+)" "(.*[.]dylib)" "(.*[.]a)" :
+                    [ $(s).name ] ] ;
+            }
+            if $(m)
+            {
+                filtered += $(s) ;
+            }
+        }
+
+        # Create links without version.
+        for local s in $(filtered)
+        {
+            local name = [ $(s).name ] ;
+            local ea = [ $(s).action ] ;
+            local ep = [ $(ea).properties ] ;
+            local a  = [ new non-scanning-action $(s) : symlink.ln : $(ep) ] ;
+
+            local noversion-file ;
+            if $(nt)
+            {
+                noversion-file = [ MATCH "(.*)-[0-9_]+(.*[.]lib)" : $(name) ] ;
+            }
+            else
+            {
+                noversion-file =
+                  [ MATCH "(.*)-[0-9_]+(.*[.]so)[.0-9]*" : $(name) ]
+                  [ MATCH "(.*)-[0-9_]+(.*[.]dylib)" : $(name) ]
+                  [ MATCH "(.*)-[0-9_]+(.*[.]a)" : $(name) ]
+                  [ MATCH "(.*)-[0-9_]+(.*[.]dll[.]a)" : $(name) ] ;
+            }
+
+            local new-name =
+               $(noversion-file[1])$(noversion-file[2]) ;
+            result += [ new file-target $(new-name) exact : [ $(s).type ] : $(project)
+                    : $(a) ] ;
+
+        }
+        return $(result) ;
+    }
+
+    generate stage-unversioned : stage-proper :
+        <generating-rule>@make-unversioned-links ;
+    explicit stage-unversioned ;
+
+    generate install-unversioned : install-proper :
+        <generating-rule>@make-unversioned-links ;
+    explicit install-unversioned ;
+}
+else
+{
+    # Create do-nothing aliases.
+    alias stage-unversioned ;
+    explicit stage-unversioned ;
+    alias install-unversioned ;
+    explicit install-unversioned ;
+}
+
+# This is a special metatarget class that handles the --build-type=complete
+# option.
+class top-level-target : alias-target-class
+{
+    import modules ;
+    import errors ; 
+    
+    rule __init__ ( name : project : sources * : requirements *
+        : default-build * : usage-requirements * )
+    {
+        alias-target-class.__init__ $(name) : $(project) : $(sources) :
+            $(requirements) : $(default-build) : $(usage-requirements) ;
+        
+        local m = [ $(project).project-module ] ;
+        self.build-type = [ modules.peek $(m) : build-type ] ;
+        # On Linux, we build release variant by default, since few users will
+        # ever want to debug C++ Boost libraries, and there's no ABI
+        # incompatibility between debug and release variants. We build
+        # shared and static libraries since that's what most packages
+        # seem to provide (.so in libfoo and .a in libfoo-dev).
+        self.minimal-properties = [ property-set.create 
+            <variant>release <threading>multi <link>shared <link>static <runtime-link>shared ] ;
+        # On Windows, new IDE projects use:
+        #
+        #   runtime-link=dynamic, threading=multi, variant=(debug|release)
+        #
+        # and in addition, C++ Boost's autolink defaults to static linking.
+        self.minimal-properties-win = [ property-set.create 
+            <variant>debug <variant>release <threading>multi <link>static <runtime-link>shared ] ;
+
+        self.complete-properties = [ property-set.create
+            <variant>debug <variant>release
+            <threading>single <threading>multi
+            <link>shared <link>static
+            <runtime-link>shared <runtime-link>static ] ;
+    }
+    
+    rule generate ( property-set )
+    {
+        if $(self.build-type) = minimal
+        {
+            local expanded ;
+            
+            local os = [ $(property-set).get <target-os> ] ;
+            # Because we completely override parent's 'generate'
+            # we need to check for default value of feature ourself.
+            if ! $(os)
+            {
+                os = [ feature.defaults <target-os> ] ;
+                os = $(os:G=) ;
+            }
+            
+            if $(os) = windows
+            {                
+                expanded = [ targets.apply-default-build $(property-set)
+                  : $(self.minimal-properties-win) ] ;
+            }
+            else
+            {
+                expanded = [ targets.apply-default-build $(property-set)
+                  : $(self.minimal-properties) ] ;
+            }            
+            return [ build-multiple $(expanded) ] ;
+        }
+        else if $(self.build-type) = complete
+        {                                    
+            local expanded = [ targets.apply-default-build $(property-set)
+              : $(self.complete-properties) ] ;
+            
+            # Filter inappopriate combinations
+            local filtered ;
+            for local p in $(expanded)
+            {
+                # See comment in handle-static-runtime regarding this logic.
+                if [ $(p).get <link> ] = shared && [ $(p).get <runtime-link> ] = static
+                   && [ $(p).get <toolset> ] != cw
+                {
+                    # Skip this
+                }
+                else
+                {
+                    filtered += $(p) ;
+                }
+            }            
+            return [ build-multiple $(filtered) ] ;            
+        }
+        else
+        {
+            errors.error "Unknown build type" ; 
+        }               
+    }
+    
+    rule build-multiple ( property-sets * )
+    {
+        local usage-requirements = [ property-set.empty ] ;
+        local result ;
+        for local p in $(property-sets)
+        {
+            local r = [ alias-target-class.generate $(p) ] ;
+            if $(r)
+            {
+                usage-requirements = [ $(usage-requirements).add $(r[1]) ] ;
+                result += $(r[2-]) ;
+            }
+        }
+        return $(usage-requirements) [ sequence.unique $(result) ] ;
+    }
+    
+}
+
+targets.create-metatarget top-level-target : [ project.current ]
+  : install
+  : install-proper install-unversioned 
+  ;
+targets.create-metatarget top-level-target : [ project.current ]
+  : stage
+  : stage-proper stage-unversioned 
+  ;
+
+explicit install ;
+explicit stage ;
+
+stage-abs = [ path.native [ path.root $(stage-locate)/lib [ path.pwd ] ] ] ;
+
+# This target is built by default, and will forward to 'stage'
+# after producing some explanations.
+targets.create-metatarget top-level-target : [ project.current ]
+  : forward
+  : explain stage
+  ;
+
+
+message explain :
+"\nBuilding the Boost C++ Libraries.
+
+After the build, the headers will be located at
+  
+    $(BOOST_ROOT)
+    
+The libraries will be located at  
+    
+    $(stage-abs)
+     
+Use 'bjam install --prefix=<path>' if you wish to install headers and 
+libraries to a different location and remove the source tree.\n\n"
+  ;
+
 # 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
@@ -243,21 +684,18 @@
 
     install stage : $(libraries) : <location>$(BOOST_STAGE_LOCATE) ;
 
-    module [ CALLER_MODULE ]
+    local c = [ project.current ] ;
+    local project-module = [ $(c).project-module ] ;
+    module $(project-module)
     {
         explicit stage ;
         explicit install ;
     }
 }
 
-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) ;
+# Make project ids of all libraries known.
+for local l in $(all-libraries)
+{
+    use-project /boost/$(l) : libs/$(l)/build ;
+}
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..3f64437
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,117 @@
+
+Version 1.40.0
+
+Updated Libraries
+
+     * Accumulators:
+          + Works on GCC 4.4.
+     * Circular Buffer:
+          + Fixed bugs #2785, #3285.
+     * Foreach:
+          + Workaround for conflict with Python headers (#3000).
+     * Function:
+          + Optimize the use of small target objects.
+          + Make Boost.Function compile under BOOST_NO_EXCEPTIONS (#2499, #2494, #2469, #2466, #2900)
+          + Various minor fixes (#2642, #2847, #2929 #3012)
+     * Fusion:
+          + Improved compile times for fusion::vector.
+     * Hash:
+          + Automatically configure the float functions using template metaprogramming instead of trying to configure every possibility manually.
+     * Interprocess:
+          + Windows shared memory is created in Shared Documents folder so that it can be shared between services and processes
+          + Fixed bugs #2967, #2973, #2992, #3138, #3166, #3205.
+     * Intrusive:
+          + Code cleanup in tree_algorithms.hpp and avl_tree_algorithms.hpp
+          + Fixed bug #3164.
+     * MPL:
+          + Added mpl::char_ and mpl::string for compile-time string manipulation, based on multichar literals (#2905).
+          + Updated MPL Reference Manual.
+          + Bug fixes.
+     * Program.Options:
+          + Support for building with disabled exceptions (#2096).
+          + Unicode parser no longer drops original tokens (#2425).
+          + Fixed crash on user-inserted items in variables_map (#2782).
+     * Proto:
+          + PrimitiveTransforms have stricter conformance to ResultOf protocol. (Warning: some invalid code may break.)
+          + Add a sensible default for proto::_default's template parameter.
+          + Improved default evaluation strategy for pointers to members.
+          + GCC 3.4 portability fixes (#3021).
+          + Work around Visual C++'s non-std-compliant ciso646 macros.
+     * Serialization:
+          + Removed deprecated headers: boost/static_warning.hpp, boost/state_saver.hpp, boost/smart_cast.hpp, boost/pfto.hpp. Use the the equivalent headers in the boost/serialization/ directory instead (#3062).
+     * Unordered:
+          + Implement emplace for all compilers, not just ones with rvalue references and variadic templates (#1978).
+          + Create less buckets by default.
+          + Some minor tweaks for better compiler support (#2908, #3096, #3082).
+     * Xpressive:
+          + Works on Visual C++ 10.0 (#3124).
+
+Build System
+
+   The default naming of libraries in Unix-like environment now matches system conventions, and does not include various decorations. Naming of libraries on Cygwin was also fixed. Support for beta versions of Microsoft Visual Studio 10 was added. With gcc, 64-bit compilation no longer requires that target architecture be specified.
+
+Updated Tools
+
+     * Boostbook:
+          + Hide INTERNAL ONLY enums in doxygen documentation (#3242).
+          + Tweaked appearance of member classes/structs/unions in a class synopsis.
+     * Quickbook:
+          + Support python code snippets (#3029).
+          + Add teletype source mode (#1202)
+
+Compilers Tested
+
+   Boost's primary test compilers are:
+     * OS X:
+          + GCC 4.0.1 on Intel Tiger and Leopard
+          + GCC 4.0.1 on PowerPC Tiger
+     * Linux:
+          + GCC 4.3.3 on Ubuntu Linux.
+     * Windows:
+          + Visual C++ 7.1 SP1, 8.0 SP1 and 9.0 SP1 on Windows XP.
+
+   Boost's additional test compilers include:
+     * Linux:
+          + Intel 9.0 on Red Hat Enterprise Linux.
+          + Intel 10.0 on Red Hat Enterprise Linux.
+          + Intel 10.1 on 64-bit Linux Redhat 5.1 Server.
+          + Intel 10.1 on Suse Linux on 64 bit Itanium.
+          + Intel 11.0 on Red Hat Enterprise Linux.
+          + Intel 11.1 on Red Hat Enterprise Linux.
+          + GCC 3.4.3, GCC 4.0.1, GCC 4.2.4, GCC 4.3.3 and GCC 4.4.0 on Red Hat Enterprise Linux.
+          + GCC 4.3.3 and GCC 4.4.0 with C++0x extensions on Red Hat Enterprise Linux.
+          + GCC 4.1.1, 4.2.1 on 64-bit Red Hat Enterprise Linux.
+          + GCC 4.1.2 on Suse Linux on 64 bit Itanium.
+          + GCC 4.1.2 on 64-bit Redhat Server 5.1.
+          + GCC Open64 4.2.2 on Red Hat Enterprise Linux.
+          + GCC 4.3.4 on Debian unstable.
+          + QLogic PathScale(TM) Compiler Suite: Version 3.1 on Red Hat Enterprise Linux.
+          + GCC version 4.2.0 (PathScale 3.2 driver) on 64-bit Red Hat Enterprise Linux.
+          + Sun 5.9 on Red Hat Enterprise Linux.
+     * OS X:
+          + Intel 10.1, 11.0 on Intel Leopard.
+          + Intel 10.1, 11.0 on Intel Tiger.
+          + GCC 4.0.1, 4.2.1 on Intel Leopard.
+          + GCC 4.0.1 on Intel Tiger.
+          + GCC 4.0.1 on PowerPC Tiger.
+     * Windows:
+          + Visual C++ 7.1 on XP.
+          + Visual C++ 9.0 on XP.
+          + Visual C++ 9.0 on Vista.
+          + Visual C++ 9.0 on Vista 64-bit.
+          + Visual C++ 9.0, using STLport 5.2, on XP and Windows Mobile 5.0.
+          + Visual C++ 10.0 beta.
+          + Borland 5.9.3, 6.1.0, 6.1.3.
+          + Borland C++ Builder 2007 and 2009.
+          + Intel C++ 11.1, with a Visual C++ 9.0 backend, on Vista 32-bit.
+          + Intel C++ 11.1, with a Visual C++ 9.0 backend, on Vista 64-bit.
+          + GCC 4.3.3 and 4.4.0, on Mingw with C++0x features.
+     * AIX:
+          + IBM XL C/C++ Enterprise Edition for AIX, V10.1.0.0, on AIX Version 5.3.0.40.
+     * Solaris:
+          + Sun C++ 5.7, 5.8, 5.9 on Solaris 5.10.
+          + GCC 3.4.6 on Solaris 5.10.
+
+Acknowledgements
+
+   Beman Dawes, Eric Niebler, Rene Rivera, and Daniel James managed this release.
diff --git a/boost-build.jam b/boost-build.jam
index 8b87754..1ba9dd2 100644
--- a/boost-build.jam
+++ b/boost-build.jam
@@ -10,7 +10,6 @@
 # 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/v2 ;
diff --git a/boost/accumulators/accumulators_fwd.hpp b/boost/accumulators/accumulators_fwd.hpp
index 9986a53..d5ca5c2 100644
--- a/boost/accumulators/accumulators_fwd.hpp
+++ b/boost/accumulators/accumulators_fwd.hpp
@@ -48,9 +48,6 @@
 # define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)
 #endif
 
-#define BOOST_ACCUMULATORS_GCC_VERSION                                                              \
-  (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-
 namespace boost { namespace accumulators
 {
 
diff --git a/boost/accumulators/numeric/functional/valarray.hpp b/boost/accumulators/numeric/functional/valarray.hpp
index 41766a0..13fc1db 100644
--- a/boost/accumulators/numeric/functional/valarray.hpp
+++ b/boost/accumulators/numeric/functional/valarray.hpp
@@ -29,21 +29,12 @@
 {
     namespace operators
     {
-        namespace acc_detail
-        {
-            template<typename Fun>
-            struct make_valarray
-            {
-                typedef std::valarray<typename Fun::result_type> type;
-            };
-        }
-
         ///////////////////////////////////////////////////////////////////////////////
         // Handle valarray<Left> / Right where Right is a scalar and Right != Left.
         template<typename Left, typename Right>
-        typename lazy_enable_if<
+        typename enable_if<
             mpl::and_<is_scalar<Right>, mpl::not_<is_same<Left, Right> > >
-          , acc_detail::make_valarray<functional::divides<Left, Right> >
+          , std::valarray<typename functional::divides<Left, Right>::result_type>
         >::type
         operator /(std::valarray<Left> const &left, Right const &right)
         {
@@ -59,9 +50,9 @@
         ///////////////////////////////////////////////////////////////////////////////
         // Handle valarray<Left> * Right where Right is a scalar and Right != Left.
         template<typename Left, typename Right>
-        typename lazy_enable_if<
+        typename enable_if<
             mpl::and_<is_scalar<Right>, mpl::not_<is_same<Left, Right> > >
-          , acc_detail::make_valarray<functional::multiplies<Left, Right> >
+          , std::valarray<typename functional::multiplies<Left, Right>::result_type>
         >::type
         operator *(std::valarray<Left> const &left, Right const &right)
         {
@@ -77,9 +68,9 @@
         ///////////////////////////////////////////////////////////////////////////////
         // Handle valarray<Left> + valarray<Right> where Right != Left.
         template<typename Left, typename Right>
-        typename lazy_disable_if<
+        typename disable_if<
             is_same<Left, Right>
-          , acc_detail::make_valarray<functional::plus<Left, Right> >
+          , std::valarray<typename functional::plus<Left, Right>::result_type>
         >::type
         operator +(std::valarray<Left> const &left, std::valarray<Right> const &right)
         {
diff --git a/boost/accumulators/numeric/functional/vector.hpp b/boost/accumulators/numeric/functional/vector.hpp
index cdb2342..0c015ff 100644
--- a/boost/accumulators/numeric/functional/vector.hpp
+++ b/boost/accumulators/numeric/functional/vector.hpp
@@ -28,21 +28,12 @@
 {
     namespace operators
     {
-        namespace acc_detail
-        {
-            template<typename Fun>
-            struct make_vector
-            {
-                typedef std::vector<typename Fun::result_type> type;
-            };
-        }
-
         ///////////////////////////////////////////////////////////////////////////////
         // Handle vector<Left> / Right where Right is a scalar.
         template<typename Left, typename Right>
-        typename lazy_enable_if<
+        typename enable_if<
             is_scalar<Right>
-          , acc_detail::make_vector<functional::divides<Left, Right> >
+          , std::vector<typename functional::divides<Left, Right>::result_type>
         >::type
         operator /(std::vector<Left> const &left, Right const &right)
         {
@@ -73,9 +64,9 @@
         ///////////////////////////////////////////////////////////////////////////////
         // Handle vector<Left> * Right where Right is a scalar.
         template<typename Left, typename Right>
-        typename lazy_enable_if<
+        typename enable_if<
             is_scalar<Right>
-          , acc_detail::make_vector<functional::multiplies<Left, Right> >
+          , std::vector<typename functional::multiplies<Left, Right>::result_type>
         >::type
         operator *(std::vector<Left> const &left, Right const &right)
         {
@@ -91,9 +82,9 @@
         ///////////////////////////////////////////////////////////////////////////////
         // Handle Left * vector<Right> where Left is a scalar.
         template<typename Left, typename Right>
-        typename lazy_enable_if<
+        typename enable_if<
             is_scalar<Left>
-          , acc_detail::make_vector<functional::multiplies<Left, Right> >
+          , std::vector<typename functional::multiplies<Left, Right>::result_type>
         >::type
         operator *(Left const &left, std::vector<Right> const &right)
         {
diff --git a/boost/accumulators/statistics.hpp b/boost/accumulators/statistics.hpp
index 1d136e5..6f505c8 100644
--- a/boost/accumulators/statistics.hpp
+++ b/boost/accumulators/statistics.hpp
@@ -30,7 +30,6 @@
 #include <boost/accumulators/statistics/skewness.hpp>
 #include <boost/accumulators/statistics/stats.hpp>
 #include <boost/accumulators/statistics/sum.hpp>
-#include <boost/accumulators/statistics/sum_kahan.hpp>
 #include <boost/accumulators/statistics/tail.hpp>
 #include <boost/accumulators/statistics/tail_quantile.hpp>
 #include <boost/accumulators/statistics/tail_mean.hpp>
@@ -49,7 +48,6 @@
 #include <boost/accumulators/statistics/weighted_p_square_quantile.hpp>
 #include <boost/accumulators/statistics/weighted_skewness.hpp>
 #include <boost/accumulators/statistics/weighted_sum.hpp>
-#include <boost/accumulators/statistics/weighted_sum_kahan.hpp>
 #include <boost/accumulators/statistics/weighted_tail_quantile.hpp>
 #include <boost/accumulators/statistics/weighted_tail_mean.hpp>
 #include <boost/accumulators/statistics/weighted_tail_variate_means.hpp>
diff --git a/boost/accumulators/statistics/sum_kahan.hpp b/boost/accumulators/statistics/sum_kahan.hpp
deleted file mode 100644
index b5b9958..0000000
--- a/boost/accumulators/statistics/sum_kahan.hpp
+++ /dev/null
@@ -1,188 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// sum_kahan.hpp
-//
-//  Copyright 2010 Gaetano Mendola, 2011 Simon West. 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)
-
-#ifndef BOOST_ACCUMULATORS_STATISTICS_SUM_KAHAN_HPP_EAN_26_07_2010
-#define BOOST_ACCUMULATORS_STATISTICS_SUM_KAHAN_HPP_EAN_26_07_2010
-
-#include <boost/accumulators/framework/accumulator_base.hpp>
-#include <boost/accumulators/framework/parameters/sample.hpp>
-#include <boost/accumulators/statistics_fwd.hpp>
-#include <boost/accumulators/statistics/sum.hpp>
-#include <boost/accumulators/statistics/weighted_sum_kahan.hpp>
-#include <boost/numeric/conversion/cast.hpp>
-
-namespace boost { namespace accumulators
-{
-
-namespace impl
-{
-
-#if _MSC_VER > 1400
-# pragma float_control(push)
-# pragma float_control(precise, on)
-#endif
-
-template<typename Sample, typename Tag>
-struct sum_kahan_impl
-  : accumulator_base
-{
-    typedef Sample result_type;
-
-    ////////////////////////////////////////////////////////////////////////////
-    // sum_kahan_impl
-    /**
-        @brief Kahan summation algorithm
-
-        The Kahan summation algorithm reduces the numerical error obtained with standard
-        sequential sum.
-
-    */
-    template<typename Args>
-    sum_kahan_impl(Args const & args)
-      : sum(args[parameter::keyword<Tag>::get() | Sample()]),
-        compensation(boost::numeric_cast<Sample>(0.0))
-    {
-    }
-
-    template<typename Args>
-    void 
-#if BOOST_ACCUMULATORS_GCC_VERSION > 40305
-    __attribute__((optimize("no-associative-math")))
-#endif
-    operator ()(Args const & args)
-    {
-        const Sample myTmp1 = args[parameter::keyword<Tag>::get()] - this->compensation;
-        const Sample myTmp2 = this->sum + myTmp1;
-        this->compensation = (myTmp2 - this->sum) - myTmp1;
-        this->sum = myTmp2;
-    }
-
-    result_type result(dont_care) const
-    {
-      return this->sum;
-    }
-
-private:
-    Sample sum;
-    Sample compensation;
-};
-
-#if _MSC_VER > 1400
-# pragma float_control(pop)
-#endif
-
-} // namespace impl
-
-///////////////////////////////////////////////////////////////////////////////
-// tag::sum_kahan
-// tag::sum_of_weights_kahan
-// tag::sum_of_variates_kahan
-//
-namespace tag
-{
-
-    struct sum_kahan
-      : depends_on<>
-    {
-        /// INTERNAL ONLY
-        ///
-        typedef impl::sum_kahan_impl< mpl::_1, tag::sample > impl;
-    };
-
-    struct sum_of_weights_kahan
-      : depends_on<>
-    {
-        typedef mpl::true_ is_weight_accumulator;
-        /// INTERNAL ONLY
-        ///
-        typedef accumulators::impl::sum_kahan_impl<mpl::_2, tag::weight> impl;
-    };
-
-    template<typename VariateType, typename VariateTag>
-    struct sum_of_variates_kahan
-      : depends_on<>
-    {
-        /// INTERNAL ONLY
-        ///
-        typedef mpl::always<accumulators::impl::sum_kahan_impl<VariateType, VariateTag> > impl;
-    };
-
-} // namespace tag
-
-///////////////////////////////////////////////////////////////////////////////
-// extract::sum_kahan
-// extract::sum_of_weights_kahan
-// extract::sum_of_variates_kahan
-//
-namespace extract
-{
-    extractor<tag::sum_kahan> const sum_kahan = {};
-    extractor<tag::sum_of_weights_kahan> const sum_of_weights_kahan = {};
-    extractor<tag::abstract_sum_of_variates> const sum_of_variates_kahan = {};
-
-    BOOST_ACCUMULATORS_IGNORE_GLOBAL(sum_kahan)
-    BOOST_ACCUMULATORS_IGNORE_GLOBAL(sum_of_weights_kahan)
-    BOOST_ACCUMULATORS_IGNORE_GLOBAL(sum_of_variates_kahan)
-} // namespace extract
-
-using extract::sum_kahan;
-using extract::sum_of_weights_kahan;
-using extract::sum_of_variates_kahan;
-
-// sum(kahan) -> sum_kahan
-template<>
-struct as_feature<tag::sum(kahan)>
-{
-    typedef tag::sum_kahan type;
-};
-
-// sum_of_weights(kahan) -> sum_of_weights_kahan
-template<>
-struct as_feature<tag::sum_of_weights(kahan)>
-{
-    typedef tag::sum_of_weights_kahan type;
-};
-
-// So that sum_kahan can be automatically substituted with
-// weighted_sum_kahan when the weight parameter is non-void.
-template<>
-struct as_weighted_feature<tag::sum_kahan>
-{
-    typedef tag::weighted_sum_kahan type;
-};
-
-template<>
-struct feature_of<tag::weighted_sum_kahan>
-  : feature_of<tag::sum>
-{};
-
-// for the purposes of feature-based dependency resolution,
-// sum_kahan provides the same feature as sum
-template<>
-struct feature_of<tag::sum_kahan>
-  : feature_of<tag::sum>
-{
-};
-
-// for the purposes of feature-based dependency resolution,
-// sum_of_weights_kahan provides the same feature as sum_of_weights
-template<>
-struct feature_of<tag::sum_of_weights_kahan>
-  : feature_of<tag::sum_of_weights>
-{
-};
-
-template<typename VariateType, typename VariateTag>
-struct feature_of<tag::sum_of_variates_kahan<VariateType, VariateTag> >
-  : feature_of<tag::abstract_sum_of_variates>
-{
-};
-
-}} // namespace boost::accumulators
-
-#endif
-
diff --git a/boost/accumulators/statistics/weighted_sum_kahan.hpp b/boost/accumulators/statistics/weighted_sum_kahan.hpp
deleted file mode 100644
index ad9b83d..0000000
--- a/boost/accumulators/statistics/weighted_sum_kahan.hpp
+++ /dev/null
@@ -1,138 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// weighted_sum_kahan.hpp
-//
-//  Copyright 2011 Simon West. 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)
-
-#ifndef BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_SUM_KAHAN_HPP_EAN_11_05_2011
-#define BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_SUM_KAHAN_HPP_EAN_11_05_2011
-
-#include <boost/mpl/placeholders.hpp>
-#include <boost/accumulators/framework/accumulator_base.hpp>
-#include <boost/accumulators/framework/extractor.hpp>
-#include <boost/accumulators/numeric/functional.hpp>
-#include <boost/accumulators/framework/parameters/sample.hpp>
-#include <boost/accumulators/framework/parameters/weight.hpp>
-#include <boost/accumulators/framework/accumulators/external_accumulator.hpp>
-#include <boost/accumulators/framework/depends_on.hpp>
-#include <boost/accumulators/statistics_fwd.hpp>
-#include <boost/accumulators/statistics/weighted_sum.hpp>
-#include <boost/numeric/conversion/cast.hpp>
-
-namespace boost { namespace accumulators
-{
-
-namespace impl
-{
-#if _MSC_VER > 1400
-# pragma float_control(push)
-# pragma float_control(precise, on)
-#endif
-
-    ///////////////////////////////////////////////////////////////////////////////
-    // weighted_sum_kahan_impl
-    template<typename Sample, typename Weight, typename Tag>
-    struct weighted_sum_kahan_impl
-      : accumulator_base
-    {
-        typedef typename numeric::functional::multiplies<Sample, Weight>::result_type weighted_sample;
-
-        // for boost::result_of
-        typedef weighted_sample result_type;
-
-        template<typename Args>
-        weighted_sum_kahan_impl(Args const &args)
-          : weighted_sum_(
-                args[parameter::keyword<Tag>::get() | Sample()] * numeric::one<Weight>::value),
-                compensation(boost::numeric_cast<weighted_sample>(0.0))
-        {
-        }
-
-        template<typename Args>
-        void 
-#if BOOST_ACCUMULATORS_GCC_VERSION > 40305
-        __attribute__((optimize("no-associative-math")))
-#endif
-        operator ()(Args const &args)
-        {
-            const weighted_sample myTmp1 = args[parameter::keyword<Tag>::get()] * args[weight] - this->compensation;
-            const weighted_sample myTmp2 = this->weighted_sum_ + myTmp1;
-            this->compensation = (myTmp2 - this->weighted_sum_) - myTmp1;
-            this->weighted_sum_ = myTmp2;
-
-        }
-
-        result_type result(dont_care) const
-        {
-            return this->weighted_sum_;
-        }
-
-    private:
-        weighted_sample weighted_sum_;
-        weighted_sample compensation;
-    };
-
-#if _MSC_VER > 1400
-# pragma float_control(pop)
-#endif
-
-} // namespace impl
-
-///////////////////////////////////////////////////////////////////////////////
-// tag::weighted_sum_kahan
-// tag::weighted_sum_of_variates_kahan
-//
-namespace tag
-{
-    struct weighted_sum_kahan
-      : depends_on<>
-    {
-        /// INTERNAL ONLY
-        ///
-        typedef accumulators::impl::weighted_sum_kahan_impl<mpl::_1, mpl::_2, tag::sample> impl;
-    };
-
-    template<typename VariateType, typename VariateTag>
-    struct weighted_sum_of_variates_kahan
-      : depends_on<>
-    {
-        /// INTERNAL ONLY
-        ///
-        typedef accumulators::impl::weighted_sum_kahan_impl<VariateType, mpl::_2, VariateTag> impl;
-    };
-
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// extract::weighted_sum_kahan
-// extract::weighted_sum_of_variates_kahan
-//
-namespace extract
-{
-    extractor<tag::weighted_sum_kahan> const weighted_sum_kahan = {};
-    extractor<tag::abstract_weighted_sum_of_variates> const weighted_sum_of_variates_kahan = {};
-
-    BOOST_ACCUMULATORS_IGNORE_GLOBAL(weighted_sum_kahan)
-    BOOST_ACCUMULATORS_IGNORE_GLOBAL(weighted_sum_of_variates_kahan)
-}
-
-using extract::weighted_sum_kahan;
-using extract::weighted_sum_of_variates_kahan;
-
-// weighted_sum(kahan) -> weighted_sum_kahan
-template<>
-struct as_feature<tag::weighted_sum(kahan)>
-{
-    typedef tag::weighted_sum_kahan type;
-};
-
-template<typename VariateType, typename VariateTag>
-struct feature_of<tag::weighted_sum_of_variates_kahan<VariateType, VariateTag> >
-  : feature_of<tag::abstract_weighted_sum_of_variates>
-{
-};
-
-}} // namespace boost::accumulators
-
-#endif
diff --git a/boost/accumulators/statistics_fwd.hpp b/boost/accumulators/statistics_fwd.hpp
index 61904f3..196814b 100644
--- a/boost/accumulators/statistics_fwd.hpp
+++ b/boost/accumulators/statistics_fwd.hpp
@@ -109,10 +109,6 @@
     struct sum_of_weights;
     template<typename VariateType, typename VariateTag>
     struct sum_of_variates;
-    struct sum_kahan;
-    struct sum_of_weights_kahan;
-    template<typename VariateType, typename VariateTag>
-    struct sum_of_variates_kahan;
     template<typename LeftRight>
     struct tail;
     template<typename LeftRight>
@@ -267,9 +263,6 @@
     template<typename Sample, typename Tag = tag::sample>
     struct sum_impl;
 
-    template<typename Sample, typename Tag>
-    struct sum_kahan_impl;
-
     template<typename Sample, typename LeftRight>
     struct tail_impl;
 
@@ -345,9 +338,6 @@
     template<typename Sample, typename Weight, typename Tag>
     struct weighted_sum_impl;
 
-    template<typename Sample, typename Weight, typename Tag>
-    struct weighted_sum_kahan_impl;
-
     template<typename Sample, typename Weight, typename LeftRight>
     struct non_coherent_weighted_tail_mean_impl;
 
@@ -424,9 +414,6 @@
 struct regular {};
 struct for_median {};
 
-// modifier for sum_kahan, sum_of_weights_kahan, sum_of_variates_kahan, weighted_sum_kahan
-struct kahan {};
-
 }} // namespace boost::accumulators
 
 #endif
diff --git a/boost/algorithm/string/case_conv.hpp b/boost/algorithm/string/case_conv.hpp
index 683340b..536c022 100644
--- a/boost/algorithm/string/case_conv.hpp
+++ b/boost/algorithm/string/case_conv.hpp
@@ -59,7 +59,7 @@
         {
             return ::boost::algorithm::detail::transform_range_copy( 
                Output,
-               ::boost::as_literal(Input),
+               as_literal(Input),
                ::boost::algorithm::detail::to_lowerF<
                     typename range_value<RangeT>::type >(Loc));
         }
@@ -93,7 +93,7 @@
             const std::locale& Loc=std::locale())
         {
             ::boost::algorithm::detail::transform_range(
-                ::boost::as_literal(Input),
+                as_literal(Input),
                 ::boost::algorithm::detail::to_lowerF<
                     typename range_value<WritableRangeT>::type >(Loc));
         }
@@ -124,7 +124,7 @@
         {
             return ::boost::algorithm::detail::transform_range_copy( 
                Output,
-               ::boost::as_literal(Input),
+               as_literal(Input),
                ::boost::algorithm::detail::to_upperF<
                     typename range_value<RangeT>::type >(Loc));
         }
@@ -158,7 +158,7 @@
             const std::locale& Loc=std::locale())
         {
             ::boost::algorithm::detail::transform_range(
-                ::boost::as_literal(Input),
+                as_literal(Input),
                 ::boost::algorithm::detail::to_upperF<
                     typename range_value<WritableRangeT>::type >(Loc));
         }
diff --git a/boost/algorithm/string/classification.hpp b/boost/algorithm/string/classification.hpp
index ca43602..33ff9be 100644
--- a/boost/algorithm/string/classification.hpp
+++ b/boost/algorithm/string/classification.hpp
@@ -202,7 +202,7 @@
             BOOST_STRING_TYPENAME range_value<RangeT>::type> 
         is_any_of( const RangeT& Set )
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_set(boost::as_literal(Set));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_set(as_literal(Set));
             return detail::is_any_ofF<BOOST_STRING_TYPENAME range_value<RangeT>::type>(lit_set); 
         }
 
diff --git a/boost/algorithm/string/config.hpp b/boost/algorithm/string/config.hpp
old mode 100644
new mode 100755
diff --git a/boost/algorithm/string/detail/case_conv.hpp b/boost/algorithm/string/detail/case_conv.hpp
index 5b0064f..5253454 100644
--- a/boost/algorithm/string/detail/case_conv.hpp
+++ b/boost/algorithm/string/detail/case_conv.hpp
@@ -31,7 +31,7 @@
             struct to_lowerF : public std::unary_function<CharT, CharT>
             {
                 // Constructor
-                to_lowerF( const std::locale& Loc ) : m_Loc( &Loc ) {}
+                to_lowerF( const std::locale& Loc ) : m_Loc( Loc ) {}
 
                 // Operation
                 CharT operator ()( CharT Ch ) const
@@ -39,11 +39,11 @@
                     #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
                         return std::tolower( Ch);
                     #else
-                        return std::tolower<CharT>( Ch, *m_Loc );
+                        return std::tolower<CharT>( Ch, m_Loc );
                     #endif
                 }
             private:
-                const std::locale* m_Loc;
+                const std::locale& m_Loc;
             };
 
             // a toupper functor
@@ -51,7 +51,7 @@
             struct to_upperF : public std::unary_function<CharT, CharT>
             {
                 // Constructor
-                to_upperF( const std::locale& Loc ) : m_Loc( &Loc ) {}
+                to_upperF( const std::locale& Loc ) : m_Loc( Loc ) {}
 
                 // Operation
                 CharT operator ()( CharT Ch ) const
@@ -59,11 +59,11 @@
                     #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
                         return std::toupper( Ch);
                     #else
-                        return std::toupper<CharT>( Ch, *m_Loc );
+                        return std::toupper<CharT>( Ch, m_Loc );
                     #endif
                 }
             private:
-                const std::locale* m_Loc;
+                const std::locale& m_Loc;
             };
 
 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
@@ -105,10 +105,10 @@
                 FunctorT Functor)
             {
                 return SequenceT(
-                    ::boost::make_transform_iterator(
+                    make_transform_iterator(
                         ::boost::begin(Input),
                         Functor),
-                    ::boost::make_transform_iterator(
+                    make_transform_iterator(
                         ::boost::end(Input), 
                         Functor));
             }
diff --git a/boost/algorithm/string/detail/classification.hpp b/boost/algorithm/string/detail/classification.hpp
index fb43955..9a34bf0 100644
--- a/boost/algorithm/string/detail/classification.hpp
+++ b/boost/algorithm/string/detail/classification.hpp
@@ -32,8 +32,8 @@
             struct is_classifiedF :
                 public predicate_facade<is_classifiedF>
             {
-                // Boost.ResultOf support
-                typedef bool result_type;
+                // Boost.Lambda support
+                template <class Args> struct sig { typedef bool type; };
 
                 // Constructor from a locale
                 is_classifiedF(std::ctype_base::mask Type, std::locale const & Loc = std::locale()) :
@@ -72,8 +72,8 @@
                 typedef typename ::boost::remove_const<CharT>::type set_value_type;
 
             public:     
-                // Boost.ResultOf support
-                typedef bool result_type;
+                // Boost.Lambda support
+                template <class Args> struct sig { typedef bool type; };
 
                 // Constructor
                 template<typename RangeT>
@@ -253,8 +253,8 @@
             struct is_from_rangeF :
                 public predicate_facade< is_from_rangeF<CharT> >
             {
-                // Boost.ResultOf support
-                typedef bool result_type;
+                // Boost.Lambda support
+                template <class Args> struct sig { typedef bool type; };
 
                 // Constructor
                 is_from_rangeF( CharT From, CharT To ) : m_From(From), m_To(To) {}
@@ -278,8 +278,8 @@
             {
             public:
 
-                // Boost.ResultOf support
-                typedef bool result_type;
+                // Boost.Lambda support
+                template <class Args> struct sig { typedef bool type; };
 
                 // Constructor
                 pred_andF( Pred1T Pred1, Pred2T Pred2 ) :
@@ -303,8 +303,8 @@
                 public predicate_facade< pred_orF<Pred1T,Pred2T> >
             {
             public:
-                // Boost.ResultOf support
-                typedef bool result_type;
+                // Boost.Lambda support
+                template <class Args> struct sig { typedef bool type; };
 
                 // Constructor
                 pred_orF( Pred1T Pred1, Pred2T Pred2 ) :
@@ -328,8 +328,8 @@
                 public predicate_facade< pred_notF<PredT> >
             {
             public:
-                // Boost.ResultOf support
-                typedef bool result_type;
+                // Boost.Lambda support
+                template <class Args> struct sig { typedef bool type; };
 
                 // Constructor
                 pred_notF( PredT Pred ) : m_Pred(Pred) {}
diff --git a/boost/algorithm/string/detail/find_format.hpp b/boost/algorithm/string/detail/find_format.hpp
index 8b9ad42..8fb625e 100644
--- a/boost/algorithm/string/detail/find_format.hpp
+++ b/boost/algorithm/string/detail/find_format.hpp
@@ -24,7 +24,26 @@
 
 // find_format_copy (iterator variant) implementation -------------------------------//
 
-           template< 
+            template< 
+                typename OutputIteratorT,
+                typename InputT,
+                typename FormatterT,
+                typename FindResultT >
+            inline OutputIteratorT find_format_copy_impl(
+                OutputIteratorT Output,
+                const InputT& Input,
+                FormatterT Formatter,
+                const FindResultT& FindResult )
+            {       
+                return find_format_copy_impl2( 
+                    Output,
+                    Input,
+                    Formatter,
+                    FindResult,
+                    Formatter(FindResult) );
+            }
+
+            template< 
                 typename OutputIteratorT,
                 typename InputT,
                 typename FormatterT,
@@ -49,48 +68,40 @@
                 if ( !M )
                 {
                     // Match not found - return original sequence
-                    Output = std::copy( ::boost::begin(Input), ::boost::end(Input), Output );
+                    std::copy( ::boost::begin(Input), ::boost::end(Input), Output );
                     return Output;
                 }
 
                 // Copy the beginning of the sequence
-                Output = std::copy( ::boost::begin(Input), ::boost::begin(M), Output );
+                std::copy( ::boost::begin(Input), ::boost::begin(M), Output );
                 // Format find result
                 // Copy formated result
-                Output = std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output );
+                std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output );
                 // Copy the rest of the sequence
-                Output = std::copy( M.end(), ::boost::end(Input), Output );
+                std::copy( M.end(), ::boost::end(Input), Output );
 
                 return Output;
             }
 
-            template< 
-                typename OutputIteratorT,
-                typename InputT,
-                typename FormatterT,
-                typename FindResultT >
-            inline OutputIteratorT find_format_copy_impl(
-                OutputIteratorT Output,
-                const InputT& Input,
-                FormatterT Formatter,
-                const FindResultT& FindResult )
-            {   
-                if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
-                    return ::boost::algorithm::detail::find_format_copy_impl2( 
-                        Output,
-                        Input,
-                        Formatter,
-                        FindResult,
-                        Formatter(FindResult) );
-                } else {
-                    return std::copy( ::boost::begin(Input), ::boost::end(Input), Output );
-                }
-            }
-
- 
 // find_format_copy implementation --------------------------------------------------//
 
-           template< 
+            template< 
+                typename InputT, 
+                typename FormatterT,
+                typename FindResultT >
+            inline InputT find_format_copy_impl(
+                const InputT& Input,
+                FormatterT Formatter,
+                const FindResultT& FindResult)
+            {
+                return find_format_copy_impl2(
+                    Input,
+                    Formatter,
+                    FindResult,
+                    Formatter(FindResult) );
+            }
+
+            template< 
                 typename InputT, 
                 typename FormatterT,
                 typename FindResultT,
@@ -127,28 +138,24 @@
                 return Output;
             }
 
-            template< 
-                typename InputT, 
+// replace implementation ----------------------------------------------------//
+        
+            template<
+                typename InputT,
                 typename FormatterT,
                 typename FindResultT >
-            inline InputT find_format_copy_impl(
-                const InputT& Input,
+            inline void find_format_impl( 
+                InputT& Input,
                 FormatterT Formatter,
                 const FindResultT& FindResult)
             {
-                if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
-                    return ::boost::algorithm::detail::find_format_copy_impl2(
-                        Input,
-                        Formatter,
-                        FindResult,
-                        Formatter(FindResult) );
-                } else {
-                    return Input;
-                }
+                find_format_impl2(
+                    Input,
+                    Formatter,
+                    FindResult,
+                    Formatter(FindResult) );
             }
 
- // replace implementation ----------------------------------------------------//
-        
             template<
                 typename InputT,
                 typename FormatterT,
@@ -176,25 +183,7 @@
                 }
 
                 // Replace match
-                ::boost::algorithm::detail::replace( Input, M.begin(), M.end(), M.format_result() );
-            }
-
-            template<
-                typename InputT,
-                typename FormatterT,
-                typename FindResultT >
-            inline void find_format_impl( 
-                InputT& Input,
-                FormatterT Formatter,
-                const FindResultT& FindResult)
-            {
-                if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
-                    ::boost::algorithm::detail::find_format_impl2(
-                        Input,
-                        Formatter,
-                        FindResult,
-                        Formatter(FindResult) );
-                }
+                replace( Input, M.begin(), M.end(), M.format_result() );
             }
 
         } // namespace detail
diff --git a/boost/algorithm/string/detail/find_format_all.hpp b/boost/algorithm/string/detail/find_format_all.hpp
index 978710c..9533be6 100644
--- a/boost/algorithm/string/detail/find_format_all.hpp
+++ b/boost/algorithm/string/detail/find_format_all.hpp
@@ -24,7 +24,29 @@
 
 // find_format_all_copy (iterator variant) implementation ---------------------------//
 
-           template< 
+            template< 
+                typename OutputIteratorT,
+                typename InputT,
+                typename FinderT,
+                typename FormatterT,
+                typename FindResultT >
+            inline OutputIteratorT find_format_all_copy_impl(
+                OutputIteratorT Output,
+                const InputT& Input,
+                FinderT Finder,
+                FormatterT Formatter,
+                const FindResultT& FindResult )
+            {       
+                return find_format_all_copy_impl2( 
+                    Output,
+                    Input,
+                    Finder,
+                    Formatter,
+                    FindResult,
+                    Formatter(FindResult) );
+            }
+
+            template< 
                 typename OutputIteratorT,
                 typename InputT,
                 typename FinderT,
@@ -57,9 +79,9 @@
                 while( M )
                 {
                     // Copy the beginning of the sequence
-                    Output = std::copy( LastMatch, M.begin(), Output );
+                    std::copy( LastMatch, M.begin(), Output );
                     // Copy formated result
-                    Output = std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output );
+                    std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output );
 
                     // Proceed to the next match
                     LastMatch=M.end();
@@ -67,40 +89,33 @@
                 }
 
                 // Copy the rest of the sequence
-                Output = std::copy( LastMatch, ::boost::end(Input), Output );
+                std::copy( LastMatch, ::boost::end(Input), Output );
 
                 return Output;
             }
 
+// find_format_all_copy implementation ----------------------------------------------//
+
             template< 
-                typename OutputIteratorT,
-                typename InputT,
+                typename InputT, 
                 typename FinderT,
                 typename FormatterT,
                 typename FindResultT >
-            inline OutputIteratorT find_format_all_copy_impl(
-                OutputIteratorT Output,
+            inline InputT find_format_all_copy_impl(
                 const InputT& Input,
                 FinderT Finder,
                 FormatterT Formatter,
-                const FindResultT& FindResult )
-            {   
-                if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
-                    return ::boost::algorithm::detail::find_format_all_copy_impl2( 
-                        Output,
-                        Input,
-                        Finder,
-                        Formatter,
-                        FindResult,
-                        Formatter(FindResult) );
-                } else {
-                    return std::copy( ::boost::begin(Input), ::boost::end(Input), Output );
-                }
+                const FindResultT& FindResult)
+            {
+                return find_format_all_copy_impl2(
+                    Input,
+                    Finder,
+                    Formatter,
+                    FindResult,
+                    Formatter(FindResult) );
             }
 
- // find_format_all_copy implementation ----------------------------------------------//
-
-           template< 
+            template< 
                 typename InputT, 
                 typename FinderT,
                 typename FormatterT,
@@ -144,36 +159,32 @@
                 }
 
                 // Copy the rest of the sequence
-                ::boost::algorithm::detail::insert( Output, ::boost::end(Output), LastMatch, ::boost::end(Input) );
+                insert( Output, ::boost::end(Output), LastMatch, ::boost::end(Input) );
 
                 return Output;
             }
 
-            template< 
-                typename InputT, 
+// find_format_all implementation ------------------------------------------------//
+        
+            template<
+                typename InputT,
                 typename FinderT,
                 typename FormatterT,
                 typename FindResultT >
-            inline InputT find_format_all_copy_impl(
-                const InputT& Input,
+            inline void find_format_all_impl( 
+                InputT& Input,
                 FinderT Finder,
                 FormatterT Formatter,
-                const FindResultT& FindResult)
+                FindResultT FindResult)
             {
-                if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
-                    return ::boost::algorithm::detail::find_format_all_copy_impl2(
-                        Input,
-                        Finder,
-                        Formatter,
-                        FindResult,
-                        Formatter(FindResult) );
-                } else {
-                    return Input;
-                }
+                find_format_all_impl2(
+                    Input,
+                    Finder,
+                    Formatter,
+                    FindResult,
+                    Formatter(FindResult) );
             }
 
- // find_format_all implementation ------------------------------------------------//
-        
             template<
                 typename InputT,
                 typename FinderT,
@@ -219,14 +230,14 @@
                     SearchIt=M.end();
 
                     // Copy formated replace to the storage
-                    ::boost::algorithm::detail::copy_to_storage( Storage, M.format_result() );
+                    copy_to_storage( Storage, M.format_result() );
 
                     // Find range for a next match
                     M=Finder( SearchIt, ::boost::end(Input) );
                 }
 
                 // process the last segment
-                InsertIt=::boost::algorithm::detail::process_segment( 
+                InsertIt=process_segment( 
                     Storage,
                     Input,
                     InsertIt,
@@ -236,33 +247,12 @@
                 if ( Storage.empty() )
                 {
                     // Truncate input
-                    ::boost::algorithm::detail::erase( Input, InsertIt, ::boost::end(Input) );
+                    erase( Input, InsertIt, ::boost::end(Input) );
                 }
                 else
                 {
                     // Copy remaining data to the end of input
-                    ::boost::algorithm::detail::insert( Input, ::boost::end(Input), Storage.begin(), Storage.end() );
-                }
-            }
-
-            template<
-                typename InputT,
-                typename FinderT,
-                typename FormatterT,
-                typename FindResultT >
-            inline void find_format_all_impl( 
-                InputT& Input,
-                FinderT Finder,
-                FormatterT Formatter,
-                FindResultT FindResult)
-            {
-                if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
-                    ::boost::algorithm::detail::find_format_all_impl2(
-                        Input,
-                        Finder,
-                        Formatter,
-                        FindResult,
-                        Formatter(FindResult) );
+                    insert( Input, ::boost::end(Input), Storage.begin(), Storage.end() );
                 }
             }
 
diff --git a/boost/algorithm/string/detail/find_format_store.hpp b/boost/algorithm/string/detail/find_format_store.hpp
index e8bd84a..2260fc2 100644
--- a/boost/algorithm/string/detail/find_format_store.hpp
+++ b/boost/algorithm/string/detail/find_format_store.hpp
@@ -52,9 +52,7 @@
                 find_format_store& operator=( FindResultT FindResult )
                 {
                     iterator_range<ForwardIteratorT>::operator=(FindResult);
-                    if( !this->empty() ) {
-                        m_FormatResult=m_Formatter(FindResult);
-                    }
+                    m_FormatResult=m_Formatter(FindResult);
                     
                     return *this;
                 }
@@ -70,15 +68,6 @@
                 const formatter_type& m_Formatter;
             };
 
-            template<typename InputT, typename FindResultT>
-            bool check_find_result(InputT&, FindResultT& FindResult)
-            {
-                typedef BOOST_STRING_TYPENAME 
-                    range_const_iterator<InputT>::type input_iterator_type; 
-                iterator_range<input_iterator_type> ResultRange(FindResult);
-                return !ResultRange.empty();
-            }
-
 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
 #pragma warning(pop)
 #endif
diff --git a/boost/algorithm/string/detail/finder.hpp b/boost/algorithm/string/detail/finder.hpp
index 45bcb7d..c6d0752 100644
--- a/boost/algorithm/string/detail/finder.hpp
+++ b/boost/algorithm/string/detail/finder.hpp
@@ -382,7 +382,7 @@
                 typedef BOOST_STRING_TYPENAME boost::detail::
                     iterator_traits<ForwardIteratorT>::iterator_category category;
 
-                return ::boost::algorithm::detail::find_head_impl( Begin, End, N, category() );
+                return find_head_impl( Begin, End, N, category() );
             }
 
             template< typename ForwardIteratorT >
@@ -456,7 +456,7 @@
                 typedef BOOST_STRING_TYPENAME boost::detail::
                     iterator_traits<ForwardIteratorT>::iterator_category category;
 
-                return ::boost::algorithm::detail::find_tail_impl( Begin, End, N, category() );
+                return find_tail_impl( Begin, End, N, category() );
             }
 
 
@@ -484,14 +484,14 @@
                 {
                     if(m_N>=0)
                     {
-                        return ::boost::algorithm::detail::find_head_impl( Begin, End, m_N );
+                        return find_head_impl( Begin, End, m_N );
                     }
                     else
                     {
                         iterator_range<ForwardIteratorT> Res=
-                            ::boost::algorithm::detail::find_tail_impl( Begin, End, -m_N );
+                            find_tail_impl( Begin, End, -m_N );
 
-                        return ::boost::make_iterator_range(Begin, Res.begin());
+                        return make_iterator_range(Begin, Res.begin());
                     }
                 }
 
@@ -522,14 +522,14 @@
                 {
                     if(m_N>=0)
                     {
-                        return ::boost::algorithm::detail::find_tail_impl( Begin, End, m_N );
+                        return find_tail_impl( Begin, End, m_N );
                     }
                     else
                     {
                         iterator_range<ForwardIteratorT> Res=
-                            ::boost::algorithm::detail::find_head_impl( Begin, End, -m_N );
+                            find_head_impl( Begin, End, -m_N );
 
-                        return ::boost::make_iterator_range(Res.end(), End);
+                        return make_iterator_range(Res.end(), End);
                     }
                 }
 
diff --git a/boost/algorithm/string/detail/finder_regex.hpp b/boost/algorithm/string/detail/finder_regex.hpp
index 673d93a..1eeda01 100644
--- a/boost/algorithm/string/detail/finder_regex.hpp
+++ b/boost/algorithm/string/detail/finder_regex.hpp
@@ -98,7 +98,7 @@
                     // instantiate match result
                     match_results<input_iterator_type> result;
                     // search for a match
-                    if ( ::boost::regex_search( Begin, End, result, m_Rx, m_MatchFlags ) )
+                    if ( regex_search( Begin, End, result, m_Rx, m_MatchFlags ) )
                     {
                         // construct a result
                         return result_type( result );
diff --git a/boost/algorithm/string/detail/formatter.hpp b/boost/algorithm/string/detail/formatter.hpp
index 8e7b727..bd6a780 100644
--- a/boost/algorithm/string/detail/formatter.hpp
+++ b/boost/algorithm/string/detail/formatter.hpp
@@ -87,31 +87,6 @@
                 }
             };
 
-//  dissect format functor ----------------------------------------------------//
-
-            // dissect format functor
-            template<typename FinderT>
-            struct dissect_formatF
-            {
-            public:
-                // Construction
-                dissect_formatF(FinderT Finder) :
-                  m_Finder(Finder) {}
-
-                  // Operation
-                  template<typename RangeT>
-                  inline iterator_range< 
-                      BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
-                  operator()(const RangeT& Replace) const
-                  {
-                      return m_Finder(::boost::begin(Replace), ::boost::end(Replace));
-                  }
-
-            private:
-                FinderT m_Finder;
-            };
-
-
         } // namespace detail
     } // namespace algorithm
 } // namespace boost
diff --git a/boost/algorithm/string/detail/predicate.hpp b/boost/algorithm/string/detail/predicate.hpp
index 5acf3cc..a04b5b1 100644
--- a/boost/algorithm/string/detail/predicate.hpp
+++ b/boost/algorithm/string/detail/predicate.hpp
@@ -63,7 +63,7 @@
 
                 iterator_range<ForwardIterator1T> Result
                     =last_finder( 
-                        ::boost::make_iterator_range(SubBegin, SubEnd),
+                        make_iterator_range(SubBegin, SubEnd),
                         Comp)(Begin, End);
 
                 return !Result.empty() && Result.end()==End;
diff --git a/boost/algorithm/string/detail/replace_storage.hpp b/boost/algorithm/string/detail/replace_storage.hpp
index db35e4c..7aff247 100644
--- a/boost/algorithm/string/detail/replace_storage.hpp
+++ b/boost/algorithm/string/detail/replace_storage.hpp
@@ -68,7 +68,7 @@
                     ForwardIteratorT SegmentEnd )
                 {
                     // Copy data from the storage until the beginning of the segment
-                    ForwardIteratorT It=::boost::algorithm::detail::move_from_storage( Storage, InsertIt, SegmentBegin );
+                    ForwardIteratorT It=move_from_storage( Storage, InsertIt, SegmentBegin );
 
                     // 3 cases are possible :
                     //   a) Storage is empty, It==SegmentBegin
@@ -125,7 +125,7 @@
 
                 {
                     // Call replace to do the job
-                    ::boost::algorithm::detail::replace( Input, InsertIt, SegmentBegin, Storage );
+                    replace( Input, InsertIt, SegmentBegin, Storage );
                     // Empty the storage
                     Storage.clear();
                     // Iterators were not changed, simply return the end of segment
diff --git a/boost/algorithm/string/detail/sequence.hpp b/boost/algorithm/string/detail/sequence.hpp
index dc47409..de01350 100644
--- a/boost/algorithm/string/detail/sequence.hpp
+++ b/boost/algorithm/string/detail/sequence.hpp
@@ -41,7 +41,7 @@
                 BOOST_STRING_TYPENAME InputT::iterator At,
                 const InsertT& Insert )
             {
-                ::boost::algorithm::detail::insert( Input, At, ::boost::begin(Insert), ::boost::end(Insert) );
+                insert( Input, At, ::boost::begin(Insert), ::boost::end(Insert) );
             }
            
 //  erase helper  ---------------------------------------------------//
@@ -184,11 +184,11 @@
             {
                 if(From!=To)
                 {
-                    ::boost::algorithm::detail::replace( Input, From, To, ::boost::begin(Insert), ::boost::end(Insert) );
+                    replace( Input, From, To, ::boost::begin(Insert), ::boost::end(Insert) );
                 }
                 else
                 {
-                    ::boost::algorithm::detail::insert( Input, From, ::boost::begin(Insert), ::boost::end(Insert) );
+                    insert( Input, From, ::boost::begin(Insert), ::boost::end(Insert) );
                 }
             }
 
diff --git a/boost/algorithm/string/detail/trim.hpp b/boost/algorithm/string/detail/trim.hpp
index 1233e49..8e5c0fb 100644
--- a/boost/algorithm/string/detail/trim.hpp
+++ b/boost/algorithm/string/detail/trim.hpp
@@ -20,6 +20,36 @@
 
 //  trim iterator helper -----------------------------------------------//
 
+            // Search for first non matching character from the beginning of the sequence
+            template< typename ForwardIteratorT, typename PredicateT >
+            inline ForwardIteratorT trim_begin( 
+                ForwardIteratorT InBegin, 
+                ForwardIteratorT InEnd, 
+                PredicateT IsSpace )
+            {
+                ForwardIteratorT It=InBegin;
+                for(; It!=InEnd; ++It )
+                {
+                    if (!IsSpace(*It))
+                        return It;
+                }
+
+                return It;
+            }
+
+            // Search for first non matching character from the end of the sequence
+            template< typename ForwardIteratorT, typename PredicateT >
+            inline ForwardIteratorT trim_end( 
+                ForwardIteratorT InBegin, 
+                ForwardIteratorT InEnd, 
+                PredicateT IsSpace )
+            {
+                typedef BOOST_STRING_TYPENAME boost::detail::
+                    iterator_traits<ForwardIteratorT>::iterator_category category;
+
+                return trim_end_iter_select( InBegin, InEnd, IsSpace, category() );
+            }
+
             template< typename ForwardIteratorT, typename PredicateT >
             inline ForwardIteratorT trim_end_iter_select( 
                 ForwardIteratorT InBegin, 
@@ -56,36 +86,6 @@
 
                 return InBegin;
             }
-   // Search for first non matching character from the beginning of the sequence
-            template< typename ForwardIteratorT, typename PredicateT >
-            inline ForwardIteratorT trim_begin( 
-                ForwardIteratorT InBegin, 
-                ForwardIteratorT InEnd, 
-                PredicateT IsSpace )
-            {
-                ForwardIteratorT It=InBegin;
-                for(; It!=InEnd; ++It )
-                {
-                    if (!IsSpace(*It))
-                        return It;
-                }
-
-                return It;
-            }
-
-            // Search for first non matching character from the end of the sequence
-            template< typename ForwardIteratorT, typename PredicateT >
-            inline ForwardIteratorT trim_end( 
-                ForwardIteratorT InBegin, 
-                ForwardIteratorT InEnd, 
-                PredicateT IsSpace )
-            {
-                typedef BOOST_STRING_TYPENAME boost::detail::
-                    iterator_traits<ForwardIteratorT>::iterator_category category;
-
-                return ::boost::algorithm::detail::trim_end_iter_select( InBegin, InEnd, IsSpace, category() );
-            }
-
 
         } // namespace detail
     } // namespace algorithm
diff --git a/boost/algorithm/string/erase.hpp b/boost/algorithm/string/erase.hpp
index e738b86..b50323b 100644
--- a/boost/algorithm/string/erase.hpp
+++ b/boost/algorithm/string/erase.hpp
@@ -54,11 +54,11 @@
                 BOOST_STRING_TYPENAME 
                     range_const_iterator<RangeT>::type>& SearchRange )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::range_finder(SearchRange),
-                ::boost::algorithm::empty_formatter(Input) );
+                range_finder(SearchRange),
+                empty_formatter(Input) );
         }
 
         //! Erase range algorithm
@@ -72,10 +72,10 @@
                 BOOST_STRING_TYPENAME 
                     range_const_iterator<SequenceT>::type>& SearchRange )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::range_finder(SearchRange),
-                ::boost::algorithm::empty_formatter(Input) );
+                range_finder(SearchRange),
+                empty_formatter(Input) );
         }
 
         //! Erase range algorithm
@@ -93,10 +93,10 @@
                 BOOST_STRING_TYPENAME 
                     range_iterator<SequenceT>::type>& SearchRange )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::range_finder(SearchRange),
-                ::boost::algorithm::empty_formatter(Input) );
+                range_finder(SearchRange),
+                empty_formatter(Input) );
         }
 
 //  erase_first  --------------------------------------------------------//
@@ -124,11 +124,11 @@
             const Range1T& Input,
             const Range2T& Search )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search),
+                empty_formatter(Input) );
         }
 
         //! Erase first algorithm
@@ -140,10 +140,10 @@
             const SequenceT& Input,
             const RangeT& Search )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input, 
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search),
+                empty_formatter(Input) );
         }
 
         //! Erase first algorithm
@@ -159,10 +159,10 @@
             SequenceT& Input,
             const RangeT& Search )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search),
+                empty_formatter(Input) );
         }
 
 //  erase_first ( case insensitive ) ------------------------------------//
@@ -193,11 +193,11 @@
             const Range2T& Search,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
         //! Erase first algorithm ( case insensitive )
@@ -210,10 +210,10 @@
             const RangeT& Search,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input, 
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
         //! Erase first algorithm ( case insensitive )
@@ -231,10 +231,10 @@
             const RangeT& Search,
             const std::locale& Loc=std::locale() )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
 //  erase_last  --------------------------------------------------------//
@@ -262,11 +262,11 @@
             const Range1T& Input,
             const Range2T& Search )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::last_finder(Search),
-                ::boost::algorithm::empty_formatter(Input) );
+                last_finder(Search),
+                empty_formatter(Input) );
         }
 
         //! Erase last algorithm
@@ -278,10 +278,10 @@
             const SequenceT& Input,
             const RangeT& Search )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input, 
-                ::boost::algorithm::last_finder(Search),
-                ::boost::algorithm::empty_formatter(Input) );
+                last_finder(Search),
+                empty_formatter(Input) );
         }
 
         //! Erase last algorithm
@@ -297,10 +297,10 @@
             SequenceT& Input,
             const RangeT& Search )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::last_finder(Search),
-                ::boost::algorithm::empty_formatter(Input) );
+                last_finder(Search),
+                empty_formatter(Input) );
         }
 
 //  erase_last ( case insensitive ) ------------------------------------//
@@ -331,11 +331,11 @@
             const Range2T& Search,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::last_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                last_finder(Search, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
         //! Erase last algorithm ( case insensitive )
@@ -348,10 +348,10 @@
             const RangeT& Search,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input, 
-                ::boost::algorithm::last_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                last_finder(Search, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
         //! Erase last algorithm ( case insensitive )
@@ -369,10 +369,10 @@
             const RangeT& Search,
             const std::locale& Loc=std::locale() )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::last_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                last_finder(Search, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
 //  erase_nth --------------------------------------------------------------------//
@@ -404,11 +404,11 @@
             const Range2T& Search,
             int Nth )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::nth_finder(Search, Nth),
-                ::boost::algorithm::empty_formatter(Input) );
+                nth_finder(Search, Nth),
+                empty_formatter(Input) );
         }
 
         //! Erase nth algorithm
@@ -421,10 +421,10 @@
             const RangeT& Search,
             int Nth )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input, 
-                ::boost::algorithm::nth_finder(Search, Nth),
-                ::boost::algorithm::empty_formatter(Input) );
+                nth_finder(Search, Nth),
+                empty_formatter(Input) );
         }
 
         //! Erase nth algorithm
@@ -443,10 +443,10 @@
             const RangeT& Search,
             int Nth )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::nth_finder(Search, Nth),
-                ::boost::algorithm::empty_formatter(Input) );
+                nth_finder(Search, Nth),
+                empty_formatter(Input) );
         }
 
 //  erase_nth ( case insensitive ) ---------------------------------------------//
@@ -480,11 +480,11 @@
             int Nth,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                nth_finder(Search, Nth, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
         //! Erase nth algorithm
@@ -498,9 +498,9 @@
             int Nth,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input, 
-                ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
+                nth_finder(Search, Nth, is_iequal(Loc)),
                 empty_formatter(Input) );
         }
 
@@ -522,10 +522,10 @@
             int Nth,
             const std::locale& Loc=std::locale() )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                nth_finder(Search, Nth, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
 
@@ -555,11 +555,11 @@
             const Range1T& Input,
             const Range2T& Search )
         {
-            return ::boost::algorithm::find_format_all_copy(
+            return find_format_all_copy(
                 Output,
                 Input,
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search),
+                empty_formatter(Input) );
         }
 
         //! Erase all algorithm
@@ -571,10 +571,10 @@
             const SequenceT& Input,
             const RangeT& Search )
         {
-            return ::boost::algorithm::find_format_all_copy( 
+            return find_format_all_copy( 
                 Input, 
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search),
+                empty_formatter(Input) );
         }
 
         //! Erase all algorithm
@@ -590,10 +590,10 @@
             SequenceT& Input,
             const RangeT& Search )
         {
-            ::boost::algorithm::find_format_all( 
+            find_format_all( 
                 Input, 
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search),
+                empty_formatter(Input) );
         }
 
 //  erase_all ( case insensitive ) ------------------------------------//
@@ -624,11 +624,11 @@
             const Range2T& Search,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_all_copy(
+            return find_format_all_copy(
                 Output,
                 Input,
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
         //! Erase all algorithm ( case insensitive )
@@ -641,10 +641,10 @@
             const RangeT& Search,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_all_copy( 
+            return find_format_all_copy( 
                 Input, 
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
         //! Erase all algorithm ( case insensitive )
@@ -662,10 +662,10 @@
             const RangeT& Search,
             const std::locale& Loc=std::locale() )
         {
-            ::boost::algorithm::find_format_all( 
+            find_format_all( 
                 Input, 
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::empty_formatter(Input) );
+                first_finder(Search, is_iequal(Loc)),
+                empty_formatter(Input) );
         }
 
 //  erase_head --------------------------------------------------------------------//
@@ -696,11 +696,11 @@
             const RangeT& Input,
             int N )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::head_finder(N),
-                ::boost::algorithm::empty_formatter( Input ) );
+                head_finder(N),
+                empty_formatter( Input ) );
         }
 
         //! Erase head algorithm
@@ -712,10 +712,10 @@
             const SequenceT& Input,
             int N )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::head_finder(N),
-                ::boost::algorithm::empty_formatter( Input ) );
+                head_finder(N),
+                empty_formatter( Input ) );
         }
 
         //! Erase head algorithm
@@ -734,10 +734,10 @@
             SequenceT& Input,
             int N )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::head_finder(N),
-                ::boost::algorithm::empty_formatter( Input ) );
+                head_finder(N),
+                empty_formatter( Input ) );
         }
 
 //  erase_tail --------------------------------------------------------------------//
@@ -752,7 +752,7 @@
 
             \param Output An output iterator to which the result will be copied
             \param Input An input string
-            \param N Length of the tail.                 
+            \param N Length of the head.                 
                 For N>=0, at most N characters are extracted.
                 For N<0, size(Input)-|N| characters are extracted.
             \return An output iterator pointing just after the last inserted character or
@@ -768,11 +768,11 @@
             const RangeT& Input,
             int N )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::tail_finder(N),
-                ::boost::algorithm::empty_formatter( Input ) );
+                tail_finder(N),
+                empty_formatter( Input ) );
         }
 
         //! Erase tail algorithm
@@ -784,10 +784,10 @@
             const SequenceT& Input,
             int N )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::tail_finder(N),
-                ::boost::algorithm::empty_formatter( Input ) );
+                tail_finder(N),
+                empty_formatter( Input ) );
         }
 
         //! Erase tail algorithm
@@ -797,7 +797,7 @@
             considered to be the tail. The input sequence is modified in-place.
 
             \param Input An input string
-            \param N Length of the tail
+            \param N Length of the head
                 For N>=0, at most N characters are extracted.
                 For N<0, size(Input)-|N| characters are extracted.
         */
@@ -806,10 +806,10 @@
             SequenceT& Input,
             int N )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::tail_finder(N),
-                ::boost::algorithm::empty_formatter( Input ) );
+                tail_finder(N),
+                empty_formatter( Input ) );
         }
 
     } // namespace algorithm
diff --git a/boost/algorithm/string/find.hpp b/boost/algorithm/string/find.hpp
index 304646d..4196585 100644
--- a/boost/algorithm/string/find.hpp
+++ b/boost/algorithm/string/find.hpp
@@ -53,7 +53,7 @@
             RangeT& Input, 
             const FinderT& Finder)
         {
-            iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(as_literal(Input));
 
             return Finder(::boost::begin(lit_input),::boost::end(lit_input));
         }
@@ -81,7 +81,7 @@
             Range1T& Input, 
             const Range2T& Search)
         {
-            return ::boost::algorithm::find(Input, ::boost::algorithm::first_finder(Search));
+            return find(Input, first_finder(Search));
         }
 
         //! Find first algorithm ( case insensitive )
@@ -108,7 +108,7 @@
             const Range2T& Search,
             const std::locale& Loc=std::locale())
         {
-            return ::boost::algorithm::find(Input, ::boost::algorithm::first_finder(Search,is_iequal(Loc)));
+            return find(Input, first_finder(Search,is_iequal(Loc)));
         }
 
 //  find_last  -----------------------------------------------//
@@ -134,7 +134,7 @@
             Range1T& Input, 
             const Range2T& Search)
         {
-            return ::boost::algorithm::find(Input, ::boost::algorithm::last_finder(Search));
+            return find(Input, last_finder(Search));
         }
 
         //! Find last algorithm ( case insensitive )
@@ -161,7 +161,7 @@
             const Range2T& Search,
             const std::locale& Loc=std::locale())
         {
-            return ::boost::algorithm::find(Input, ::boost::algorithm::last_finder(Search, is_iequal(Loc)));
+            return find(Input, last_finder(Search, is_iequal(Loc)));
         }
 
 //  find_nth ----------------------------------------------------------------------//
@@ -189,7 +189,7 @@
             const Range2T& Search,
             int Nth)
         {
-            return ::boost::algorithm::find(Input, ::boost::algorithm::nth_finder(Search,Nth));
+            return find(Input, nth_finder(Search,Nth));
         }
 
         //! Find n-th algorithm ( case insensitive ).
@@ -220,7 +220,7 @@
             int Nth,
             const std::locale& Loc=std::locale())
         {
-            return ::boost::algorithm::find(Input, ::boost::algorithm::nth_finder(Search,Nth,is_iequal(Loc)));
+            return find(Input, nth_finder(Search,Nth,is_iequal(Loc)));
         }
 
 //  find_head ----------------------------------------------------------------------//
@@ -250,14 +250,14 @@
             RangeT& Input, 
             int N)
         {
-            return ::boost::algorithm::find(Input, ::boost::algorithm::head_finder(N));
+            return find(Input, head_finder(N));
         }
 
 //  find_tail ----------------------------------------------------------------------//
 
         //! Find tail algorithm
         /*!
-            Get the tail of the input. Tail is a suffix of the string of the 
+            Get the head of the input. Head is a suffix of the string of the 
             given size. If the input is shorter then required, whole input if considered 
             to be the tail.
 
@@ -281,7 +281,7 @@
             RangeT& Input, 
             int N)
         {
-            return ::boost::algorithm::find(Input, ::boost::algorithm::tail_finder(N));
+            return find(Input, tail_finder(N));
         }
 
 //  find_token --------------------------------------------------------------------//
@@ -311,7 +311,7 @@
             PredicateT Pred,
             token_compress_mode_type eCompress=token_compress_off)
         {
-            return ::boost::algorithm::find(Input, ::boost::algorithm::token_finder(Pred, eCompress));
+            return find(Input, token_finder(Pred, eCompress));
         }
 
     } // namespace algorithm
diff --git a/boost/algorithm/string/find_format.hpp b/boost/algorithm/string/find_format.hpp
index ef03739..7cbaf34 100644
--- a/boost/algorithm/string/find_format.hpp
+++ b/boost/algorithm/string/find_format.hpp
@@ -62,18 +62,15 @@
             FormatterT Formatter )
         {
             // Concept check
-            BOOST_CONCEPT_ASSERT((
-                FinderConcept<
-                    FinderT,
-                    BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
-                ));
-            BOOST_CONCEPT_ASSERT((
+            function_requires< 
+                FinderConcept<FinderT,
+                BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >();
+            function_requires< 
                 FormatterConcept<
                     FormatterT,
-                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
-                ));
+                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >();
 
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(as_literal(Input));
 
             return detail::find_format_copy_impl(
                 Output,
@@ -96,16 +93,13 @@
             FormatterT Formatter )
         {
             // Concept check
-            BOOST_CONCEPT_ASSERT((
-                FinderConcept<
-                    FinderT,
-                    BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
-                ));
-            BOOST_CONCEPT_ASSERT((
+            function_requires< 
+                FinderConcept<FinderT,
+                BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >();
+            function_requires< 
                 FormatterConcept<
                     FormatterT,
-                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
-                ));
+                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >();
 
             return detail::find_format_copy_impl(
                 Input,
@@ -132,16 +126,13 @@
             FormatterT Formatter)
         {
             // Concept check
-            BOOST_CONCEPT_ASSERT((
-                FinderConcept<
-                    FinderT,
-                    BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
-                ));
-            BOOST_CONCEPT_ASSERT(( 
+            function_requires< 
+                FinderConcept<FinderT,
+                BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >();
+            function_requires< 
                 FormatterConcept<
                     FormatterT,
-                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
-                ));
+                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >();
 
             detail::find_format_impl(
                 Input,
@@ -181,18 +172,15 @@
             FormatterT Formatter)
         {
             // Concept check
-            BOOST_CONCEPT_ASSERT(( 
-                FinderConcept<
-                    FinderT,
-                    BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
-                ));
-            BOOST_CONCEPT_ASSERT(( 
+            function_requires< 
+                FinderConcept<FinderT,
+                BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >();
+            function_requires< 
                 FormatterConcept<
                     FormatterT,
-                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
-                ));
+                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >();
 
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(as_literal(Input));
 
             return detail::find_format_all_copy_impl(
                 Output,
@@ -216,16 +204,13 @@
             FormatterT Formatter )
         {
             // Concept check
-            BOOST_CONCEPT_ASSERT((
-                FinderConcept<
-                    FinderT,
-                    BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
-                ));
-            BOOST_CONCEPT_ASSERT((
+            function_requires< 
+                FinderConcept<FinderT,
+                BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >();
+            function_requires< 
                 FormatterConcept<
                     FormatterT,
-                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
-                ));
+                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >();
 
             return detail::find_format_all_copy_impl(
                 Input,
@@ -254,16 +239,13 @@
             FormatterT Formatter )
         {
             // Concept check
-            BOOST_CONCEPT_ASSERT((
-                FinderConcept<
-                    FinderT,
-                    BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
-                ));
-            BOOST_CONCEPT_ASSERT((
+            function_requires< 
+                FinderConcept<FinderT,
+                BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >();
+            function_requires< 
                 FormatterConcept<
                     FormatterT,
-                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
-                ));
+                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >();
 
             detail::find_format_all_impl(
                 Input,
diff --git a/boost/algorithm/string/find_iterator.hpp b/boost/algorithm/string/find_iterator.hpp
index b72ba7c..211b87c 100644
--- a/boost/algorithm/string/find_iterator.hpp
+++ b/boost/algorithm/string/find_iterator.hpp
@@ -113,8 +113,8 @@
                     FinderT Finder ) :
                 detail::find_iterator_base<IteratorT>(Finder,0)
             {
-                iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_col(::boost::as_literal(Col));
-                m_Match=::boost::make_iterator_range(::boost::begin(lit_col), ::boost::begin(lit_col));
+                iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_col(as_literal(Col));
+                m_Match=make_iterator_range(::boost::begin(lit_col), ::boost::begin(lit_col));
                 m_End=::boost::end(lit_col);
 
                 increment();
@@ -240,7 +240,7 @@
                 m_Match(Other.m_Match),
                 m_Next(Other.m_Next),
                 m_End(Other.m_End),
-                m_bEof(Other.m_bEof)
+                m_bEof(false)
             {}
 
             //! Constructor
@@ -259,11 +259,7 @@
                 m_End(End),
                 m_bEof(false)
             {
-                // force the correct behavior for empty sequences and yield at least one token
-                if(Begin!=End)
-                {
-                    increment();
-                }
+                increment();
             }
             //! Constructor
             /*!
@@ -277,16 +273,12 @@
                 detail::find_iterator_base<IteratorT>(Finder,0),
                 m_bEof(false)
             {
-                iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_col(::boost::as_literal(Col));
+                iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_col(as_literal(Col));
                 m_Match=make_iterator_range(::boost::begin(lit_col), ::boost::begin(lit_col));
                 m_Next=::boost::begin(lit_col);
                 m_End=::boost::end(lit_col);
 
-                // force the correct behavior for empty sequences and yield at least one token
-                if(m_Next!=m_End)
-                {
-                    increment();
-                }
+                increment();
             }
 
 
diff --git a/boost/algorithm/string/finder.hpp b/boost/algorithm/string/finder.hpp
index 4c7ac38..c936ddb 100644
--- a/boost/algorithm/string/finder.hpp
+++ b/boost/algorithm/string/finder.hpp
@@ -56,7 +56,7 @@
                 detail::first_finderF<
                     BOOST_STRING_TYPENAME 
                         range_const_iterator<RangeT>::type,
-                        is_equal>( ::boost::as_literal(Search), is_equal() ) ;
+                    is_equal>( as_literal(Search), is_equal() ) ;
         }
 
         //! "First" finder
@@ -74,7 +74,7 @@
                 detail::first_finderF<
                     BOOST_STRING_TYPENAME 
                         range_const_iterator<RangeT>::type,
-                    PredicateT>( ::boost::as_literal(Search), Comp );
+                    PredicateT>( as_literal(Search), Comp );
         }
 
         //! "Last" finder
@@ -97,7 +97,7 @@
                 detail::last_finderF<
                     BOOST_STRING_TYPENAME 
                         range_const_iterator<RangeT>::type,
-                    is_equal>( ::boost::as_literal(Search), is_equal() );
+                    is_equal>( as_literal(Search), is_equal() );
         }
         //! "Last" finder
         /*!
@@ -113,7 +113,7 @@
                 detail::last_finderF<
                     BOOST_STRING_TYPENAME 
                         range_const_iterator<RangeT>::type,
-                    PredicateT>( ::boost::as_literal(Search), Comp ) ;
+                    PredicateT>( as_literal(Search), Comp ) ;
         }
 
         //! "Nth" finder
@@ -139,7 +139,7 @@
                 detail::nth_finderF<
                     BOOST_STRING_TYPENAME 
                         range_const_iterator<RangeT>::type,
-                    is_equal>( ::boost::as_literal(Search), Nth, is_equal() ) ;
+                    is_equal>( as_literal(Search), Nth, is_equal() ) ;
         }
         //! "Nth" finder
         /*!
@@ -158,7 +158,7 @@
                 detail::nth_finderF<
                     BOOST_STRING_TYPENAME 
                         range_const_iterator<RangeT>::type,
-                    PredicateT>( ::boost::as_literal(Search), Nth, Comp );
+                    PredicateT>( as_literal(Search), Nth, Comp );
         }
 
         //! "Head" finder
diff --git a/boost/algorithm/string/formatter.hpp b/boost/algorithm/string/formatter.hpp
index ab5921e..e04a50f 100644
--- a/boost/algorithm/string/formatter.hpp
+++ b/boost/algorithm/string/formatter.hpp
@@ -36,7 +36,7 @@
 
         //! Constant formatter
         /*!
-            Constructs a \c const_formatter. Const formatter always returns
+            Construct the \c const_formatter. Const formatter always returns
             the same value, regardless of the parameter.
 
             \param Format A predefined value used as a result for formating
@@ -50,12 +50,12 @@
         {
             return detail::const_formatF<
                 iterator_range<
-                    BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(::boost::as_literal(Format));
+                    BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(as_literal(Format));
         }
 
         //! Identity formatter
         /*!
-            Constructs an \c identity_formatter. Identity formatter always returns
+            Construct the \c identity_formatter. Identity formatter always returns
             the parameter.
 
             \return An instance of the \c identity_formatter object.
@@ -73,7 +73,7 @@
 
         //! Empty formatter
         /*!
-            Constructs an \c empty_formatter. Empty formatter always returns an empty
+            Construct the \c empty_formatter. Empty formatter always returns an empty
             sequence. 
 
             \param Input container used to select a correct value_type for the
@@ -89,22 +89,6 @@
                 BOOST_STRING_TYPENAME range_value<RangeT>::type>();
         }
 
-        //! Empty formatter
-        /*!
-            Constructs a \c dissect_formatter. Dissect formatter uses a specified finder
-            to extract a portion of the formatted sequence. The first finder's match is returned 
-            as a result
-
-            \param Finder a finder used to select a portion of the formated sequence
-            \return An instance of the \c dissect_formatter object.
-        */
-        template<typename FinderT>
-        inline detail::dissect_formatF< FinderT >
-        dissect_formatter(const FinderT& Finder)
-        {
-            return detail::dissect_formatF<FinderT>(Finder);
-        }
-
 
     } // namespace algorithm
 
@@ -112,7 +96,6 @@
     using algorithm::const_formatter;
     using algorithm::identity_formatter;
     using algorithm::empty_formatter;
-    using algorithm::dissect_formatter;
 
 } // namespace boost
 
diff --git a/boost/algorithm/string/iter_find.hpp b/boost/algorithm/string/iter_find.hpp
index 9e0245f..525109b 100644
--- a/boost/algorithm/string/iter_find.hpp
+++ b/boost/algorithm/string/iter_find.hpp
@@ -74,13 +74,11 @@
             RangeT& Input,
             FinderT Finder )
         {
-            BOOST_CONCEPT_ASSERT((
-                FinderConcept<
-                    FinderT,
-                    BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
-                ));
+            function_requires< 
+                FinderConcept<FinderT,
+                BOOST_STRING_TYPENAME range_iterator<RangeT>::type> >();
 
-            iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(as_literal(Input));
 
             typedef BOOST_STRING_TYPENAME 
                 range_iterator<RangeT>::type input_iterator_type;
@@ -96,12 +94,12 @@
                 transform_iter_type;
     
             transform_iter_type itBegin=
-                ::boost::make_transform_iterator( 
+                make_transform_iterator( 
                     find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ),
                     copy_range_type());
             
             transform_iter_type itEnd=
-                ::boost::make_transform_iterator( 
+                make_transform_iterator( 
                     find_iterator_type(),
                     copy_range_type());
 
@@ -145,12 +143,11 @@
             RangeT& Input,
             FinderT Finder )
         {
-            BOOST_CONCEPT_ASSERT((
+            function_requires< 
                 FinderConcept<FinderT,
-                BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
-                ));
+                BOOST_STRING_TYPENAME range_iterator<RangeT>::type> >();
 
-            iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(as_literal(Input));
 
             typedef BOOST_STRING_TYPENAME 
                 range_iterator<RangeT>::type input_iterator_type;
@@ -166,12 +163,12 @@
                 transform_iter_type;
     
             transform_iter_type itBegin=
-                ::boost::make_transform_iterator( 
+                make_transform_iterator( 
                     find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ),
                     copy_range_type() );
 
             transform_iter_type itEnd=
-                ::boost::make_transform_iterator( 
+                make_transform_iterator( 
                     find_iterator_type(),
                     copy_range_type() );
             
diff --git a/boost/algorithm/string/join.hpp b/boost/algorithm/string/join.hpp
index b871eb4..b215598 100644
--- a/boost/algorithm/string/join.hpp
+++ b/boost/algorithm/string/join.hpp
@@ -68,7 +68,7 @@
             for(;itBegin!=itEnd; ++itBegin)
             {
                 // Add separator
-                detail::insert(Result, ::boost::end(Result), ::boost::as_literal(Separator));
+                detail::insert(Result, ::boost::end(Result), as_literal(Separator));
                 // Add element
                 detail::insert(Result, ::boost::end(Result), *itBegin);
             }
@@ -123,7 +123,7 @@
                 if(Pred(*itBegin))
                 {
                     // Add separator
-                    detail::insert(Result, ::boost::end(Result), ::boost::as_literal(Separator));
+                    detail::insert(Result, ::boost::end(Result), as_literal(Separator));
                     // Add element
                     detail::insert(Result, ::boost::end(Result), *itBegin);
                 }
diff --git a/boost/algorithm/string/predicate.hpp b/boost/algorithm/string/predicate.hpp
index 6642f42..8b62086 100644
--- a/boost/algorithm/string/predicate.hpp
+++ b/boost/algorithm/string/predicate.hpp
@@ -59,8 +59,8 @@
             const Range2T& Test,
             PredicateT Comp)
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(as_literal(Test));
 
             typedef BOOST_STRING_TYPENAME 
                 range_const_iterator<Range1T>::type Iterator1T;
@@ -92,7 +92,7 @@
             const Range1T& Input, 
             const Range2T& Test)
         {
-            return ::boost::algorithm::starts_with(Input, Test, is_equal());
+            return starts_with(Input, Test, is_equal());
         }
 
         //! 'Starts with' predicate ( case insensitive )
@@ -114,7 +114,7 @@
             const Range2T& Test,
             const std::locale& Loc=std::locale())
         {
-            return ::boost::algorithm::starts_with(Input, Test, is_iequal(Loc));
+            return starts_with(Input, Test, is_iequal(Loc));
         }
 
 
@@ -141,8 +141,8 @@
             const Range2T& Test,
             PredicateT Comp)
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(as_literal(Test));
 
             typedef BOOST_STRING_TYPENAME 
                 range_const_iterator<Range1T>::type Iterator1T;
@@ -169,7 +169,7 @@
             const Range1T& Input, 
             const Range2T& Test)
         {
-            return ::boost::algorithm::ends_with(Input, Test, is_equal());
+            return ends_with(Input, Test, is_equal());
         }
 
         //! 'Ends with' predicate ( case insensitive )
@@ -191,7 +191,7 @@
             const Range2T& Test,
             const std::locale& Loc=std::locale())
         {
-            return ::boost::algorithm::ends_with(Input, Test, is_iequal(Loc));
+            return ends_with(Input, Test, is_iequal(Loc));
         }
 
 //  contains predicate  -----------------------------------------------//
@@ -215,17 +215,17 @@
             const Range2T& Test,
             PredicateT Comp)
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(as_literal(Test));
 
-            if (::boost::empty(lit_test))
+            if (empty(lit_test))
             {
                 // Empty range is contained always
                 return true;
             }
             
             // Use the temporary variable to make VACPP happy
-            bool bResult=(::boost::algorithm::first_finder(lit_test,Comp)(::boost::begin(lit_input), ::boost::end(lit_input)));
+            bool bResult=(first_finder(lit_test,Comp)(::boost::begin(lit_input), ::boost::end(lit_input)));
             return bResult;
         }
 
@@ -238,7 +238,7 @@
             const Range1T& Input, 
             const Range2T& Test)
         {
-            return ::boost::algorithm::contains(Input, Test, is_equal());
+            return contains(Input, Test, is_equal());
         }
 
         //! 'Contains' predicate ( case insensitive )
@@ -259,7 +259,7 @@
             const Range2T& Test, 
             const std::locale& Loc=std::locale())
         {
-            return ::boost::algorithm::contains(Input, Test, is_iequal(Loc));
+            return contains(Input, Test, is_iequal(Loc));
         }
 
 //  equals predicate  -----------------------------------------------//
@@ -286,8 +286,8 @@
             const Range2T& Test,
             PredicateT Comp)
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(as_literal(Test));
 
             typedef BOOST_STRING_TYPENAME 
                 range_const_iterator<Range1T>::type Iterator1T;
@@ -319,7 +319,7 @@
             const Range1T& Input, 
             const Range2T& Test)
         {
-            return ::boost::algorithm::equals(Input, Test, is_equal());
+            return equals(Input, Test, is_equal());
         }
 
         //! 'Equals' predicate ( case insensitive )
@@ -343,7 +343,7 @@
             const Range2T& Test,
             const std::locale& Loc=std::locale())
         {
-            return ::boost::algorithm::equals(Input, Test, is_iequal(Loc));
+            return equals(Input, Test, is_iequal(Loc));
         }
 
 // lexicographical_compare predicate -----------------------------//
@@ -372,8 +372,8 @@
             const Range2T& Arg2,
             PredicateT Pred)
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_arg1(::boost::as_literal(Arg1));
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_arg2(::boost::as_literal(Arg2));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_arg1(as_literal(Arg1));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_arg2(as_literal(Arg2));
 
             return std::lexicographical_compare(
                 ::boost::begin(lit_arg1),
@@ -392,7 +392,7 @@
             const Range1T& Arg1,
             const Range2T& Arg2)
         {
-            return ::boost::algorithm::lexicographical_compare(Arg1, Arg2, is_less());
+            return lexicographical_compare(Arg1, Arg2, is_less());
         }
 
         //! Lexicographical compare predicate (case-insensitive)
@@ -417,7 +417,7 @@
             const Range2T& Arg2,
             const std::locale& Loc=std::locale())
         {
-            return ::boost::algorithm::lexicographical_compare(Arg1, Arg2, is_iless(Loc));
+            return lexicographical_compare(Arg1, Arg2, is_iless(Loc));
         }
         
 
@@ -439,7 +439,7 @@
             const RangeT& Input, 
             PredicateT Pred)
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(as_literal(Input));
 
             typedef BOOST_STRING_TYPENAME 
                 range_const_iterator<RangeT>::type Iterator1T;
diff --git a/boost/algorithm/string/regex.hpp b/boost/algorithm/string/regex.hpp
index 0a4c38b..b723204 100644
--- a/boost/algorithm/string/regex.hpp
+++ b/boost/algorithm/string/regex.hpp
@@ -60,9 +60,9 @@
             const basic_regex<CharT, RegexTraitsT>& Rx,
             match_flag_type Flags=match_default )
         {
-            iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(as_literal(Input));
 
-            return ::boost::algorithm::regex_finder(Rx,Flags)(
+            return regex_finder(Rx,Flags)(
                 ::boost::begin(lit_input), ::boost::end(lit_input) );
         }
 
@@ -98,11 +98,11 @@
             const std::basic_string<CharT, FormatStringTraitsT, FormatStringAllocatorT>& Format,
             match_flag_type Flags=match_default | format_default )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Output,
                 Input,
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::regex_formatter( Format, Flags ) );
+                regex_finder( Rx, Flags ),
+                regex_formatter( Format, Flags ) );
         }
 
         //! Replace regex algorithm
@@ -120,10 +120,10 @@
             const std::basic_string<CharT, FormatStringTraitsT, FormatStringAllocatorT>& Format,
             match_flag_type Flags=match_default | format_default )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::regex_formatter( Format, Flags ) );
+                regex_finder( Rx, Flags ),
+                regex_formatter( Format, Flags ) );
         }
 
         //! Replace regex algorithm
@@ -147,10 +147,10 @@
             const std::basic_string<CharT, FormatStringTraitsT, FormatStringAllocatorT>& Format,
             match_flag_type Flags=match_default | format_default )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input,
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::regex_formatter( Format, Flags ) );
+                regex_finder( Rx, Flags ),
+                regex_formatter( Format, Flags ) );
         }
 
 //  replace_all_regex --------------------------------------------------------------------//
@@ -184,11 +184,11 @@
             const std::basic_string<CharT, FormatStringTraitsT, FormatStringAllocatorT>& Format,
             match_flag_type Flags=match_default | format_default )
         {
-            return ::boost::algorithm::find_format_all_copy( 
+            return find_format_all_copy( 
                 Output,
                 Input,
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::regex_formatter( Format, Flags ) );
+                regex_finder( Rx, Flags ),
+                regex_formatter( Format, Flags ) );
         }
 
         //! Replace all regex algorithm
@@ -206,10 +206,10 @@
             const std::basic_string<CharT, FormatStringTraitsT, FormatStringAllocatorT>& Format,
             match_flag_type Flags=match_default | format_default )
         {
-            return ::boost::algorithm::find_format_all_copy( 
+            return find_format_all_copy( 
                 Input,
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::regex_formatter( Format, Flags ) );
+                regex_finder( Rx, Flags ),
+                regex_formatter( Format, Flags ) );
         }
 
         //! Replace all regex algorithm
@@ -233,10 +233,10 @@
             const std::basic_string<CharT, FormatStringTraitsT, FormatStringAllocatorT>& Format,
             match_flag_type Flags=match_default | format_default )
         {
-            ::boost::algorithm::find_format_all( 
+            find_format_all( 
                 Input,
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::regex_formatter( Format, Flags ) );
+                regex_finder( Rx, Flags ),
+                regex_formatter( Format, Flags ) );
         }
 
 //  erase_regex --------------------------------------------------------------------//
@@ -267,11 +267,11 @@
             const basic_regex<CharT, RegexTraitsT>& Rx,
             match_flag_type Flags=match_default )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::empty_formatter( Input ) );
+                regex_finder( Rx, Flags ),
+                empty_formatter( Input ) );
         }
 
         //! Erase regex algorithm
@@ -287,10 +287,10 @@
             const basic_regex<CharT, RegexTraitsT>& Rx,
             match_flag_type Flags=match_default )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input, 
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::empty_formatter( Input ) );
+                regex_finder( Rx, Flags ),
+                empty_formatter( Input ) );
         }
 
         //! Erase regex algorithm
@@ -311,10 +311,10 @@
             const basic_regex<CharT, RegexTraitsT>& Rx,
             match_flag_type Flags=match_default )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::empty_formatter( Input ) );
+                regex_finder( Rx, Flags ),
+                empty_formatter( Input ) );
         }
 
 //  erase_all_regex --------------------------------------------------------------------//
@@ -346,11 +346,11 @@
             const basic_regex<CharT, RegexTraitsT>& Rx,
             match_flag_type Flags=match_default )
         {
-            return ::boost::algorithm::find_format_all_copy(
+            return find_format_all_copy(
                 Output,
                 Input,
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::empty_formatter( Input ) );
+                regex_finder( Rx, Flags ),
+                empty_formatter( Input ) );
         }
 
         //! Erase all regex algorithm
@@ -366,10 +366,10 @@
             const basic_regex<CharT, RegexTraitsT>& Rx,
             match_flag_type Flags=match_default )
         {
-            return ::boost::algorithm::find_format_all_copy( 
+            return find_format_all_copy( 
                 Input, 
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::empty_formatter( Input ) );
+                regex_finder( Rx, Flags ),
+                empty_formatter( Input ) );
         }
 
         //! Erase all regex algorithm
@@ -390,10 +390,10 @@
             const basic_regex<CharT, RegexTraitsT>& Rx,
             match_flag_type Flags=match_default )
         {
-            ::boost::algorithm::find_format_all( 
+            find_format_all( 
                 Input, 
-                ::boost::algorithm::regex_finder( Rx, Flags ),
-                ::boost::algorithm::empty_formatter( Input ) );
+                regex_finder( Rx, Flags ),
+                empty_formatter( Input ) );
         }
 
 //  find_all_regex ------------------------------------------------------------------//
@@ -431,10 +431,10 @@
             const basic_regex<CharT, RegexTraitsT>& Rx,
             match_flag_type Flags=match_default )
         {
-            return ::boost::algorithm::iter_find(
+            return iter_find(
                 Result,
                 Input,
-                ::boost::algorithm::regex_finder(Rx,Flags) );         
+                regex_finder(Rx,Flags) );         
         }
 
 //  split_regex ------------------------------------------------------------------//
@@ -472,10 +472,10 @@
             const basic_regex<CharT, RegexTraitsT>& Rx,
             match_flag_type Flags=match_default )
         {
-            return ::boost::algorithm::iter_split(
+            return iter_split(
                 Result,
                 Input,
-                ::boost::algorithm::regex_finder(Rx,Flags) );         
+                regex_finder(Rx,Flags) );         
         }
 
 //  join_if ------------------------------------------------------------------//
@@ -525,7 +525,7 @@
             // Roll to the first element that will be added
             while(
                 itBegin!=itEnd && 
-                !::boost::regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) ++itBegin;
+                !regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) ++itBegin;
 
             // Add this element
             if(itBegin!=itEnd)
@@ -536,10 +536,10 @@
 
             for(;itBegin!=itEnd; ++itBegin)
             {
-                if(::boost::regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags))
+                if(regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags))
                 {
                     // Add separator
-                    detail::insert(Result, ::boost::end(Result), ::boost::as_literal(Separator));
+                    detail::insert(Result, ::boost::end(Result), as_literal(Separator));
                     // Add element
                     detail::insert(Result, ::boost::end(Result), *itBegin);
                 }
@@ -593,7 +593,7 @@
             // Roll to the first element that will be added
             while(
                 itBegin!=itEnd && 
-                !::boost::regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) ++itBegin;
+                !regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) ++itBegin;
 
             // Add this element
             if(itBegin!=itEnd)
@@ -604,10 +604,10 @@
 
             for(;itBegin!=itEnd; ++itBegin)
             {
-                if(::boost::regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags))
+                if(regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags))
                 {
                     // Add separator
-                    detail::insert(Result, ::boost::end(Result), ::boost::as_literal(Separator));
+                    detail::insert(Result, ::boost::end(Result), as_literal(Separator));
                     // Add element
                     detail::insert(Result, ::boost::end(Result), *itBegin);
                 }
diff --git a/boost/algorithm/string/replace.hpp b/boost/algorithm/string/replace.hpp
index f2d201f..1c59ec7 100644
--- a/boost/algorithm/string/replace.hpp
+++ b/boost/algorithm/string/replace.hpp
@@ -61,11 +61,11 @@
                     range_const_iterator<Range1T>::type>& SearchRange,
             const Range2T& Format)
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::range_finder(SearchRange),
-                ::boost::algorithm::const_formatter(Format));
+                range_finder(SearchRange),
+                const_formatter(Format));
         }
 
         //! Replace range algorithm
@@ -80,10 +80,10 @@
                     range_const_iterator<SequenceT>::type>& SearchRange,
             const RangeT& Format)
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Input,
-                ::boost::algorithm::range_finder(SearchRange),
-                ::boost::algorithm::const_formatter(Format));
+                range_finder(SearchRange),
+                const_formatter(Format));
         }
 
         //! Replace range algorithm
@@ -103,10 +103,10 @@
                     range_iterator<SequenceT>::type>& SearchRange,
             const RangeT& Format)
         {
-            ::boost::algorithm::find_format(
+            find_format(
                 Input,
-                ::boost::algorithm::range_finder(SearchRange),
-                ::boost::algorithm::const_formatter(Format));
+                range_finder(SearchRange),
+                const_formatter(Format));
         }
 
 //  replace_first --------------------------------------------------------------------//
@@ -138,11 +138,11 @@
             const Range2T& Search,
             const Range3T& Format)
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search),
+                const_formatter(Format) );
         }
 
         //! Replace first algorithm
@@ -155,10 +155,10 @@
             const Range1T& Search,
             const Range2T& Format )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search),
+                const_formatter(Format) );
         }
 
         //! Replace first algorithm
@@ -176,10 +176,10 @@
             const Range1T& Search,
             const Range2T& Format )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search),
+                const_formatter(Format) );
         }
 
 //  replace_first ( case insensitive ) ---------------------------------------------//
@@ -214,11 +214,11 @@
             const Range3T& Format,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
         //! Replace first algorithm ( case insensitive )
@@ -232,10 +232,10 @@
             const Range1T& Format,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
         //! Replace first algorithm ( case insensitive )
@@ -256,10 +256,10 @@
             const Range2T& Format,
             const std::locale& Loc=std::locale() )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
 //  replace_last --------------------------------------------------------------------//
@@ -291,11 +291,11 @@
             const Range2T& Search,
             const Range3T& Format )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::last_finder(Search),
-                ::boost::algorithm::const_formatter(Format) );
+                last_finder(Search),
+                const_formatter(Format) );
         }
 
         //! Replace last algorithm
@@ -308,10 +308,10 @@
             const Range1T& Search,
             const Range2T& Format )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::last_finder(Search),
-                ::boost::algorithm::const_formatter(Format) );
+                last_finder(Search),
+                const_formatter(Format) );
         }
 
         //! Replace last algorithm
@@ -329,10 +329,10 @@
             const Range1T& Search,
             const Range2T& Format )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::last_finder(Search),
-                ::boost::algorithm::const_formatter(Format) );
+                last_finder(Search),
+                const_formatter(Format) );
         }
 
 //  replace_last ( case insensitive ) -----------------------------------------------//
@@ -367,11 +367,11 @@
             const Range3T& Format,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::last_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                last_finder(Search, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
         //! Replace last algorithm ( case insensitive )
@@ -385,10 +385,10 @@
             const Range2T& Format,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::last_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                last_finder(Search, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
         //! Replace last algorithm ( case insensitive )
@@ -410,10 +410,10 @@
             const Range2T& Format,
             const std::locale& Loc=std::locale() )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::last_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                last_finder(Search, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
 //  replace_nth --------------------------------------------------------------------//
@@ -448,11 +448,11 @@
             int Nth,
             const Range3T& Format )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::nth_finder(Search, Nth),
-                ::boost::algorithm::const_formatter(Format) );
+                nth_finder(Search, Nth),
+                const_formatter(Format) );
         }
 
         //! Replace nth algorithm
@@ -466,10 +466,10 @@
             int Nth,
             const Range2T& Format )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::nth_finder(Search, Nth),
-                ::boost::algorithm::const_formatter(Format) );
+                nth_finder(Search, Nth),
+                const_formatter(Format) );
         }
 
         //! Replace nth algorithm
@@ -490,10 +490,10 @@
             int Nth,
             const Range2T& Format )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::nth_finder(Search, Nth),
-                ::boost::algorithm::const_formatter(Format) );
+                nth_finder(Search, Nth),
+                const_formatter(Format) );
         }
 
 //  replace_nth ( case insensitive ) -----------------------------------------------//
@@ -531,11 +531,11 @@
             const Range3T& Format,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc) ),
-                ::boost::algorithm::const_formatter(Format) );
+                nth_finder(Search, Nth, is_iequal(Loc) ),
+                const_formatter(Format) );
         }
 
         //! Replace nth algorithm ( case insensitive )
@@ -550,10 +550,10 @@
             const Range2T& Format,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                nth_finder(Search, Nth, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
         //! Replace nth algorithm ( case insensitive )
@@ -577,10 +577,10 @@
             const Range2T& Format,
             const std::locale& Loc=std::locale() )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                nth_finder(Search, Nth, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
 //  replace_all --------------------------------------------------------------------//
@@ -612,11 +612,11 @@
             const Range2T& Search,
             const Range3T& Format )
         {
-            return ::boost::algorithm::find_format_all_copy(
+            return find_format_all_copy(
                 Output,
                 Input,
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search),
+                const_formatter(Format) );
         }
 
         //! Replace all algorithm
@@ -629,10 +629,10 @@
             const Range1T& Search,
             const Range2T& Format )
         {
-            return ::boost::algorithm::find_format_all_copy( 
+            return find_format_all_copy( 
                 Input,
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search),
+                const_formatter(Format) );
         }
 
         //! Replace all algorithm
@@ -651,10 +651,10 @@
             const Range1T& Search,
             const Range2T& Format )
         {
-            ::boost::algorithm::find_format_all( 
+            find_format_all( 
                 Input, 
-                ::boost::algorithm::first_finder(Search),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search),
+                const_formatter(Format) );
         }
         
 //  replace_all ( case insensitive ) -----------------------------------------------//
@@ -689,11 +689,11 @@
             const Range3T& Format,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_all_copy(
+            return find_format_all_copy(
                 Output,
                 Input,
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
         //! Replace all algorithm ( case insensitive )
@@ -707,10 +707,10 @@
             const Range2T& Format,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::find_format_all_copy( 
+            return find_format_all_copy( 
                 Input,
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search, is_iequal(Loc)),
+                const_formatter(Format) );
         }
 
         //! Replace all algorithm ( case insensitive )
@@ -731,10 +731,10 @@
             const Range2T& Format,
             const std::locale& Loc=std::locale() )
         {
-            ::boost::algorithm::find_format_all( 
+            find_format_all( 
                 Input, 
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc)),
-                ::boost::algorithm::const_formatter(Format) );
+                first_finder(Search, is_iequal(Loc)),
+                const_formatter(Format) );
         }
         
 //  replace_head --------------------------------------------------------------------//
@@ -769,11 +769,11 @@
             int N,
             const Range2T& Format )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::head_finder(N),
-                ::boost::algorithm::const_formatter(Format) );
+                head_finder(N),
+                const_formatter(Format) );
         }
 
         //! Replace head algorithm
@@ -786,10 +786,10 @@
             int N,
             const RangeT& Format )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::head_finder(N),
-                ::boost::algorithm::const_formatter(Format) );
+                head_finder(N),
+                const_formatter(Format) );
         }
 
         //! Replace head algorithm
@@ -811,10 +811,10 @@
             int N,
             const RangeT& Format )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::head_finder(N),
-                ::boost::algorithm::const_formatter(Format) );
+                head_finder(N),
+                const_formatter(Format) );
         }
 
 //  replace_tail --------------------------------------------------------------------//
@@ -849,11 +849,11 @@
             int N,
             const Range2T& Format )
         {
-            return ::boost::algorithm::find_format_copy(
+            return find_format_copy(
                 Output,
                 Input,
-                ::boost::algorithm::tail_finder(N),
-                ::boost::algorithm::const_formatter(Format) );
+                tail_finder(N),
+                const_formatter(Format) );
         }
 
         //! Replace tail algorithm
@@ -866,10 +866,10 @@
             int N,
             const RangeT& Format )
         {
-            return ::boost::algorithm::find_format_copy( 
+            return find_format_copy( 
                 Input,
-                ::boost::algorithm::tail_finder(N),
-                ::boost::algorithm::const_formatter(Format) );
+                tail_finder(N),
+                const_formatter(Format) );
         }
 
         //! Replace tail algorithm
@@ -891,10 +891,10 @@
             int N,
             const RangeT& Format )
         {
-            ::boost::algorithm::find_format( 
+            find_format( 
                 Input, 
-                ::boost::algorithm::tail_finder(N),
-                ::boost::algorithm::const_formatter(Format) );
+                tail_finder(N),
+                const_formatter(Format) );
         }
 
     } // namespace algorithm
diff --git a/boost/algorithm/string/split.hpp b/boost/algorithm/string/split.hpp
index cae712c..f5c323c 100644
--- a/boost/algorithm/string/split.hpp
+++ b/boost/algorithm/string/split.hpp
@@ -64,10 +64,10 @@
             Range1T& Input,
             const Range2T& Search)
         {
-            return ::boost::algorithm::iter_find(
+            return iter_find(
                 Result,
                 Input,
-                ::boost::algorithm::first_finder(Search) );        
+                first_finder(Search) );        
         }
 
         //! Find all algorithm ( case insensitive ) 
@@ -100,10 +100,10 @@
             const Range2T& Search,
             const std::locale& Loc=std::locale() )
         {
-            return ::boost::algorithm::iter_find(
+            return iter_find(
                 Result,
                 Input,
-                ::boost::algorithm::first_finder(Search, is_iequal(Loc) ) );        
+                first_finder(Search, is_iequal(Loc) ) );        
         }
 
 
@@ -143,10 +143,10 @@
             PredicateT Pred,
             token_compress_mode_type eCompress=token_compress_off )
         {
-            return ::boost::algorithm::iter_split(
+            return iter_split(
                 Result,
                 Input,
-                ::boost::algorithm::token_finder( Pred, eCompress ) );         
+                token_finder( Pred, eCompress ) );         
         }
 
     } // namespace algorithm
diff --git a/boost/algorithm/string/trim.hpp b/boost/algorithm/string/trim.hpp
index eb408a3..177ed1b 100644
--- a/boost/algorithm/string/trim.hpp
+++ b/boost/algorithm/string/trim.hpp
@@ -63,7 +63,7 @@
             const RangeT& Input,
             PredicateT IsSpace)
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_range(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_range(as_literal(Input));
 
             std::copy( 
                 ::boost::algorithm::detail::trim_begin( 
@@ -106,7 +106,7 @@
         inline SequenceT trim_left_copy(const SequenceT& Input, const std::locale& Loc=std::locale())
         {
             return            
-                ::boost::algorithm::trim_left_copy_if(
+                trim_left_copy_if(
                     Input, 
                     is_space(Loc));
         }
@@ -142,7 +142,7 @@
         template<typename SequenceT>
         inline void trim_left(SequenceT& Input, const std::locale& Loc=std::locale())
         {
-            ::boost::algorithm::trim_left_if( 
+            trim_left_if( 
                 Input, 
                 is_space(Loc));
         }
@@ -171,7 +171,7 @@
             const RangeT& Input,
             PredicateT IsSpace )
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_range(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_range(as_literal(Input));
          
             std::copy( 
                 ::boost::begin(lit_range),
@@ -215,7 +215,7 @@
         inline SequenceT trim_right_copy(const SequenceT& Input, const std::locale& Loc=std::locale())
         {
             return 
-                ::boost::algorithm::trim_right_copy_if( 
+                trim_right_copy_if( 
                     Input, 
                     is_space(Loc));
         }
@@ -254,7 +254,7 @@
         template<typename SequenceT>
         inline void trim_right(SequenceT& Input, const std::locale& Loc=std::locale())
         {
-            ::boost::algorithm::trim_right_if(
+            trim_right_if(
                 Input, 
                 is_space(Loc) );
         }
@@ -283,7 +283,7 @@
             const RangeT& Input,
             PredicateT IsSpace)
         {
-            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_range(::boost::as_literal(Input));
+            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_range(as_literal(Input));
 
             BOOST_STRING_TYPENAME 
                 range_const_iterator<RangeT>::type TrimEnd=
@@ -340,7 +340,7 @@
         inline SequenceT trim_copy( const SequenceT& Input, const std::locale& Loc=std::locale() )
         {
             return
-                ::boost::algorithm::trim_copy_if(
+                trim_copy_if(
                     Input, 
                     is_space(Loc) );
         }
@@ -357,8 +357,8 @@
         template<typename SequenceT, typename PredicateT>
         inline void trim_if(SequenceT& Input, PredicateT IsSpace)
         {
-            ::boost::algorithm::trim_right_if( Input, IsSpace );
-            ::boost::algorithm::trim_left_if( Input, IsSpace );
+            trim_right_if( Input, IsSpace );
+            trim_left_if( Input, IsSpace );
         }
 
         //! Trim
@@ -372,7 +372,7 @@
         template<typename SequenceT>
         inline void trim(SequenceT& Input, const std::locale& Loc=std::locale())
         {
-            ::boost::algorithm::trim_if(
+            trim_if(
                 Input, 
                 is_space( Loc ) );
         }
diff --git a/boost/algorithm/string/trim_all.hpp b/boost/algorithm/string/trim_all.hpp
deleted file mode 100644
index 70fd041..0000000
--- a/boost/algorithm/string/trim_all.hpp
+++ /dev/null
@@ -1,217 +0,0 @@
-//  Boost string_algo library trim.hpp header file  ---------------------------//
-
-//  Copyright Pavol Droba 2002-2003.
-//
-// 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)
-
-//  See http://www.boost.org/ for updates, documentation, and revision history.
-
-#ifndef BOOST_STRING_TRIM_ALL_HPP
-#define BOOST_STRING_TRIM_ALL_HPP
-
-#include <boost/algorithm/string/config.hpp>
-
-#include <boost/algorithm/string/trim.hpp>
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/find_format.hpp>
-#include <boost/algorithm/string/formatter.hpp>
-#include <boost/algorithm/string/finder.hpp>
-#include <locale>
-
-/*! \file
-    Defines trim_all algorithms.
-    
-    Just like \c trim, \c trim_all removes all trailing and leading spaces from a 
-    sequence (string). In addition, spaces in the middle of the sequence are truncated
-    to just one character. Space is recognized using given locales.
-
-    \c trim_fill acts as trim_all, but the spaces in the middle are replaces with 
-    a user-define sequence of character.
-
-    Parametric (\c _if) variants use a predicate (functor) to select which characters
-    are to be trimmed.. 
-    Functions take a selection predicate as a parameter, which is used to determine 
-    whether a character is a space. Common predicates are provided in classification.hpp header.
-
-*/
-
-namespace boost {
-    namespace algorithm {
-
-        // multi line trim  ----------------------------------------------- //
-
-        //! Trim All - parametric
-        /*!
-            Remove all leading and trailing spaces from the input and
-            compress all other spaces to a single character.
-            The result is a trimmed copy of the input
-
-            \param Input An input sequence
-             \param IsSpace An unary predicate identifying spaces
-            \return A trimmed copy of the input
-        */
-        template<typename SequenceT, typename PredicateT>
-        inline SequenceT trim_all_copy_if(const SequenceT& Input, PredicateT IsSpace)
-        {
-            return 
-                ::boost::find_format_all_copy(      
-                    ::boost::trim_copy_if(Input, IsSpace),
-                    ::boost::token_finder(IsSpace, ::boost::token_compress_on),
-                    ::boost::dissect_formatter(::boost::head_finder(1)));
-        }
-
-
-        //! Trim All
-        /*!
-            Remove all leading and trailing spaces from the input and
-            compress all other spaces to a single character.
-            The input sequence is modified in-place.
-
-            \param Input An input sequence
-            \param IsSpace An unary predicate identifying spaces
-        */
-        template<typename SequenceT, typename PredicateT>
-        inline void trim_all_if(SequenceT& Input, PredicateT IsSpace)
-        {
-            ::boost::trim_if(Input, IsSpace);
-            ::boost::find_format_all(       
-                Input,          
-                ::boost::token_finder(IsSpace, ::boost::token_compress_on),
-                ::boost::dissect_formatter(::boost::head_finder(1)));
-        }
-
-
-        //! Trim All
-        /*!
-            Remove all leading and trailing spaces from the input and
-            compress all other spaces to a single character.
-            The result is a trimmed copy of the input
-
-            \param Input An input sequence
-            \param Loc A locale used for 'space' classification
-            \return A trimmed copy of the input
-        */
-        template<typename SequenceT>
-        inline SequenceT trim_all_copy(const SequenceT& Input, const std::locale& Loc =std::locale())
-        {
-            return trim_all_copy_if(Input, ::boost::is_space(Loc));
-        }
-
-
-        //! Trim All
-        /*!
-            Remove all leading and trailing spaces from the input and
-            compress all other spaces to a single character.
-            The input sequence is modified in-place.
-
-            \param Input An input sequence
-            \param Loc A locale used for 'space' classification
-            \return A trimmed copy of the input
-        */
-        template<typename SequenceT>
-        inline void trim_all(SequenceT& Input, const std::locale& Loc =std::locale())
-        {
-            trim_all_if(Input, ::boost::is_space(Loc));
-        }
-
-
-        //! Trim Fill - parametric
-        /*!
-            Remove all leading and trailing spaces from the input and
-            replace all every block of consecutive spaces with a fill string
-            defined by user.
-            The result is a trimmed copy of the input
-
-            \param Input An input sequence
-            \param Fill A string used to fill the inner spaces
-            \param IsSpace An unary predicate identifying spaces
-            \return A trimmed copy of the input
-        */
-        template<typename SequenceT, typename RangeT, typename PredicateT>
-        inline SequenceT trim_fill_copy_if(const SequenceT& Input, const RangeT& Fill, PredicateT IsSpace)
-        {
-            return 
-                ::boost::find_format_all_copy(      
-                    ::boost::trim_copy_if(Input, IsSpace),
-                    ::boost::token_finder(IsSpace, ::boost::token_compress_on),
-                    ::boost::const_formatter(::boost::as_literal(Fill)));
-        }
-
-
-        //! Trim Fill
-        /*!
-            Remove all leading and trailing spaces from the input and
-            replace all every block of consecutive spaces with a fill string
-            defined by user.
-            The input sequence is modified in-place.
-
-            \param Input An input sequence
-            \param Fill A string used to fill the inner spaces
-            \param IsSpace An unary predicate identifying spaces
-        */
-        template<typename SequenceT, typename RangeT, typename PredicateT>
-        inline void trim_fill_if(SequenceT& Input, const RangeT& Fill, PredicateT IsSpace)
-        {
-            ::boost::trim_if(Input, IsSpace);
-            ::boost::find_format_all(       
-                Input,          
-                ::boost::token_finder(IsSpace, ::boost::token_compress_on),
-                ::boost::const_formatter(::boost::as_literal(Fill)));
-        }
-
-
-        //! Trim Fill
-        /*!
-            Remove all leading and trailing spaces from the input and
-            replace all every block of consecutive spaces with a fill string
-            defined by user.
-            The result is a trimmed copy of the input
-
-            \param Input An input sequence
-            \param Fill A string used to fill the inner spaces
-            \param Loc A locale used for 'space' classification
-            \return A trimmed copy of the input
-        */
-        template<typename SequenceT, typename RangeT>
-        inline SequenceT trim_fill_copy(const SequenceT& Input, const RangeT& Fill, const std::locale& Loc =std::locale())
-        {
-            return trim_fill_copy_if(Input, Fill, ::boost::is_space(Loc));
-        }
-
-
-        //! Trim Fill
-        /*!
-            Remove all leading and trailing spaces from the input and
-            replace all every block of consecutive spaces with a fill string
-            defined by user.
-            The input sequence is modified in-place.
-
-            \param Input An input sequence
-            \param Fill A string used to fill the inner spaces
-            \param Loc A locale used for 'space' classification
-            \return A trimmed copy of the input
-        */
-        template<typename SequenceT, typename RangeT>
-        inline void trim_fill(SequenceT& Input, const RangeT& Fill, const std::locale& Loc =std::locale())
-        {
-            trim_fill_if(Input, Fill, ::boost::is_space(Loc));
-        }
-
-
-    } // namespace algorithm    
-
-    // pull names to the boost namespace
-    using algorithm::trim_all;
-    using algorithm::trim_all_if;
-    using algorithm::trim_all_copy;
-    using algorithm::trim_all_copy_if;
-    using algorithm::trim_fill;
-    using algorithm::trim_fill_if;
-    using algorithm::trim_fill_copy;
-    using algorithm::trim_fill_copy_if;
-
-} // namespace boost
-
-#endif  // BOOST_STRING_TRIM_ALL_HPP
diff --git a/boost/any.hpp b/boost/any.hpp
index a8c654c..47773dc 100644
--- a/boost/any.hpp
+++ b/boost/any.hpp
@@ -19,17 +19,6 @@
 #include <boost/throw_exception.hpp>
 #include <boost/static_assert.hpp>
 
-// See boost/python/type_id.hpp
-// TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp
-# if (defined(__GNUC__) && __GNUC__ >= 3) \
- || defined(_AIX) \
- || (   defined(__sgi) && defined(__host_mips)) \
- || (defined(__hpux) && defined(__HP_aCC)) \
- || (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC))
-#  define BOOST_AUX_ANY_TYPE_ID_NAME
-#include <cstring>
-# endif 
-
 namespace boost
 {
     class any
@@ -175,14 +164,9 @@
     template<typename ValueType>
     ValueType * any_cast(any * operand)
     {
-        return operand && 
-#ifdef BOOST_AUX_ANY_TYPE_ID_NAME
-            std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0
-#else
-            operand->type() == typeid(ValueType)
-#endif
-            ? &static_cast<any::holder<ValueType> *>(operand->content)->held
-            : 0;
+        return operand && operand->type() == typeid(ValueType)
+                    ? &static_cast<any::holder<ValueType> *>(operand->content)->held
+                    : 0;
     }
 
     template<typename ValueType>
diff --git a/boost/archive/archive_exception.hpp b/boost/archive/archive_exception.hpp
index b5f33f6..8b9f3b6 100644
--- a/boost/archive/archive_exception.hpp
+++ b/boost/archive/archive_exception.hpp
@@ -17,22 +17,7 @@
 //  See http://www.boost.org for updates, documentation, and revision history.
 
 #include <exception>
-#include <boost/assert.hpp>
-#include <string>
-
-#include <boost/config.hpp> 
-#include <boost/preprocessor/empty.hpp>
-#include <boost/archive/detail/decl.hpp>
-
-// note: the only reason this is in here is that windows header
-// includes #define exception_code _exception_code (arrrgghhhh!).
-// the most expedient way to address this is be sure that this
-// header is always included whenever this header file is included.
-#if defined(BOOST_WINDOWS) 
-#include <excpt.h> 
-#endif 
-
-#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
+#include <cassert>
 
 namespace boost {
 namespace archive {
@@ -40,7 +25,7 @@
 //////////////////////////////////////////////////////////////////////
 // exceptions thrown by archives
 //
-class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception : 
+class archive_exception : 
     public virtual std::exception
 {
 public:
@@ -61,7 +46,7 @@
         incompatible_native_format, // attempt to read native binary format
                             // on incompatible platform
         array_size_too_short,// array being loaded doesn't fit in array allocated
-        input_stream_error, // error on input stream
+        stream_error,       // i/o error on stream
         invalid_class_name, // class name greater than the maximum permitted.
                             // most likely a corrupted archive or an attempt
                             // to insert virus via buffer overrun method.
@@ -70,28 +55,72 @@
         unsupported_class_version, // type saved with a version # greater than the 
                             // one used by the program.  This indicates that the proggram
                             // needs to be rebuilt.
-        multiple_code_instantiation, // code for implementing serialization for some
-                            // type has been instantiated in more than one module.
-        output_stream_error // error on input stream
+        inconsistent_pointer_serialization // an object as been serialized
+                            // more than once through pointers of different types.
     } exception_code;
-protected:
-    std::string m_msg;
-public:
     exception_code code;
-    archive_exception(
-        exception_code c, 
-        const char * e1 = NULL,
-        const char * e2 = NULL
-    );
-    ~archive_exception() throw ();
-    virtual const char *what( ) const throw();
+    archive_exception(exception_code c) : 
+        code(c)
+    {}
+    virtual const char *what( ) const throw( )
+    {
+        const char *msg = "programming error";
+        switch(code){
+        case no_exception:
+            msg = "uninitialized exception";
+            break;
+        case unregistered_class:
+            msg = "unregistered class";
+            break;
+        case invalid_signature:
+            msg = "invalid signature";
+            break;
+        case unsupported_version:
+            msg = "unsupported version";
+            break;
+        case pointer_conflict:
+            msg = "pointer conflict";
+            break;
+        case incompatible_native_format:
+            msg = "incompatible native format";
+            break;
+        case array_size_too_short:
+            msg = "array size too short";
+            break;
+        case stream_error:
+            msg = "stream error";
+            break;
+        case invalid_class_name:
+            msg = "class name too long";
+            break;
+        case unregistered_cast:
+            msg = "unregistered void cast";
+            break;
+        case unsupported_class_version:
+            msg = "class version";
+            break;
+        case other_exception:
+            // if get here - it indicates a derived exception 
+            // was sliced by passing by value in catch
+            msg = "unknown derived exception";
+            break;
+        case inconsistent_pointer_serialization:
+            // same object saved through different kinds of pointers
+            msg = "inconsistent_pointer_serialization";
+            break;
+        default:
+            assert(false);
+            break;
+        }
+        return msg;
+    }
 protected:
-    archive_exception();
+    archive_exception() : 
+         code(no_exception)
+    {}
 };
 
 }// namespace archive
 }// namespace boost
 
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 #endif //BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP
diff --git a/boost/archive/basic_archive.hpp b/boost/archive/basic_archive.hpp
index d408485..ac4c62b 100644
--- a/boost/archive/basic_archive.hpp
+++ b/boost/archive/basic_archive.hpp
@@ -16,11 +16,9 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
 #include <boost/config.hpp>
-#include <boost/cstdint.hpp> // size_t
+#include <boost/serialization/strong_typedef.hpp>
 #include <boost/noncopyable.hpp>
-#include <boost/integer_traits.hpp>
 
 #include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
@@ -28,159 +26,15 @@
 namespace boost {
 namespace archive {
 
-#if defined(_MSC_VER)
-#pragma warning( push )
-#pragma warning( disable : 4244 4267 )
-#endif
-
-/* NOTE : Warning  : Warning : Warning : Warning : Warning
- * Don't ever changes this.  If you do, they previously created
- * binary archives won't be readable !!!
- */
-class library_version_type {
-private:
-    typedef uint_least16_t base_type;
-    base_type t;
-public:
-    library_version_type(): t(0) {};
-    explicit library_version_type(const unsigned int & t_) : t(t_){
-        BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
-    }
-    library_version_type(const library_version_type & t_) : 
-        t(t_.t)
-    {}
-    library_version_type & operator=(const library_version_type & rhs){
-        t = rhs.t; 
-        return *this;
-    }
-    // used for text output
-    operator base_type () const {
-        return t;
-    }                
-    // used for text input
-    operator base_type & (){
-        return t;
-    }                
-    bool operator==(const library_version_type & rhs) const {
-        return t == rhs.t;
-    } 
-    bool operator<(const library_version_type & rhs) const {
-        return t < rhs.t;
-    }   
-};
-
-BOOST_ARCHIVE_DECL(library_version_type)
-BOOST_ARCHIVE_VERSION();
-
-class version_type {
-private:
-    typedef uint_least32_t base_type;
-    base_type t;
-public:
-    // should be private - but MPI fails if it's not!!!
-    version_type(): t(0) {};
-    explicit version_type(const unsigned int & t_) : t(t_){
-        BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
-    }
-    version_type(const version_type & t_) : 
-        t(t_.t)
-    {}
-    version_type & operator=(const version_type & rhs){
-        t = rhs.t; 
-        return *this;
-    }
-    // used for text output
-    operator base_type () const {
-        return t;
-    }                
-    // used for text intput
-    operator base_type  & (){
-        return t;
-    }                
-    bool operator==(const version_type & rhs) const {
-        return t == rhs.t;
-    } 
-    bool operator<(const version_type & rhs) const {
-        return t < rhs.t;
-    }   
-};
-
-class class_id_type {
-private:
-    typedef int_least16_t base_type;
-    base_type t;
-public:
-    // should be private - but then can't use BOOST_STRONG_TYPE below
-    class_id_type() : t(0) {};
-    explicit class_id_type(const int t_) : t(t_){
-        BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
-    }
-    explicit class_id_type(const std::size_t t_) : t(t_){
- //       BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
-    }
-    class_id_type(const class_id_type & t_) : 
-        t(t_.t)
-    {}
-    class_id_type & operator=(const class_id_type & rhs){
-        t = rhs.t; 
-        return *this;
-    }
-
-    // used for text output
-    operator int () const {
-        return t;
-    }                
-    // used for text input
-    operator int_least16_t &() {
-        return t;
-    }                
-    bool operator==(const class_id_type & rhs) const {
-        return t == rhs.t;
-    } 
-    bool operator<(const class_id_type & rhs) const {
-        return t < rhs.t;
-    }   
-};
-
-#define NULL_POINTER_TAG boost::archive::class_id_type(-1)
-
-class object_id_type {
-private:
-    typedef uint_least32_t base_type;
-    base_type t;
-public:
-    object_id_type(): t(0) {};
-    explicit object_id_type(const unsigned int & t_) : t(t_){
-        BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
-    }
-    object_id_type(const object_id_type & t_) : 
-        t(t_.t)
-    {}
-    object_id_type & operator=(const object_id_type & rhs){
-        t = rhs.t; 
-        return *this;
-    }
-    // used for text output
-    operator uint_least32_t () const {
-        return t;
-    }                
-    // used for text input
-    operator uint_least32_t & () {
-        return t;
-    }                
-    bool operator==(const object_id_type & rhs) const {
-        return t == rhs.t;
-    } 
-    bool operator<(const object_id_type & rhs) const {
-        return t < rhs.t;
-    }   
-};
-
-#if defined(_MSC_VER)
-#pragma warning( pop )
-#endif
+BOOST_STRONG_TYPEDEF(unsigned int, version_type)
+BOOST_STRONG_TYPEDEF(int, class_id_type)
+BOOST_STRONG_TYPEDEF(int, class_id_optional_type)
+BOOST_STRONG_TYPEDEF(int, class_id_reference_type)
+BOOST_STRONG_TYPEDEF(unsigned int, object_id_type)
+BOOST_STRONG_TYPEDEF(unsigned int, object_reference_type)
 
 struct tracking_type {
+    typedef bool value_type;
     bool t;
     explicit tracking_type(const bool t_ = false)
         : t(t_)
@@ -210,9 +64,7 @@
     }
 };
 
-struct class_name_type : 
-    private boost::noncopyable 
-{
+struct class_name_type : private boost::noncopyable {
     char *t;
     operator const char * & () const {
         return const_cast<const char * &>(t);
@@ -238,29 +90,13 @@
     flags_last = 8
 };
 
+#define NULL_POINTER_TAG class_id_type(-1)
+
 BOOST_ARCHIVE_DECL(const char *)
 BOOST_ARCHIVE_SIGNATURE();
 
-/* NOTE : Warning  : Warning : Warning : Warning : Warning
- * If any of these are changed to different sized types, 
- * binary_iarchive won't be able to read older archives
- * unless you rev the library version and include conditional
- * code based on the library version.  There is nothing
- * inherently wrong in doing this - but you have to be super
- * careful because it's easy to get wrong and start breaking
- * old archives !!!
- */
-
-#define BOOST_ARCHIVE_STRONG_TYPEDEF(T, D)         \
-    class D : public T {                           \
-    public:                                        \
-        explicit D(const T tt) : T(tt){}           \
-    };                                             \
-/**/
-
-BOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_reference_type)
-BOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_optional_type)
-BOOST_ARCHIVE_STRONG_TYPEDEF(object_id_type, object_reference_type)
+BOOST_ARCHIVE_DECL(unsigned char)
+BOOST_ARCHIVE_VERSION();
 
 }// namespace archive
 }// namespace boost
@@ -272,7 +108,6 @@
 // set implementation level to primitive for all types
 // used internally by the serialization library
 
-BOOST_CLASS_IMPLEMENTATION(boost::archive::library_version_type, primitive_type)
 BOOST_CLASS_IMPLEMENTATION(boost::archive::version_type, primitive_type)
 BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_type, primitive_type)
 BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_reference_type, primitive_type)
@@ -282,19 +117,4 @@
 BOOST_CLASS_IMPLEMENTATION(boost::archive::object_reference_type, primitive_type)
 BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type, primitive_type)
 
-#include <boost/serialization/is_bitwise_serializable.hpp>
-
-// set types used internally by the serialization library 
-// to be bitwise serializable
-
-BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::library_version_type)
-BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::version_type)
-BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_type)
-BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_reference_type)
-BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_optional_type)
-BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_name_type)
-BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_id_type)
-BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_reference_type)
-BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::tracking_type)
-
 #endif //BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
diff --git a/boost/archive/basic_binary_iarchive.hpp b/boost/archive/basic_binary_iarchive.hpp
index d851dab..c025216 100644
--- a/boost/archive/basic_binary_iarchive.hpp
+++ b/boost/archive/basic_binary_iarchive.hpp
@@ -27,17 +27,9 @@
 #include <boost/detail/workaround.hpp>
 #include <boost/serialization/pfto.hpp>
 
-#include <boost/archive/basic_archive.hpp>
 #include <boost/archive/detail/common_iarchive.hpp>
 #include <boost/serialization/collection_size_type.hpp>
 #include <boost/serialization/string.hpp>
-#include <boost/serialization/item_version_type.hpp>
-#include <boost/integer_traits.hpp>
-
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
@@ -69,136 +61,51 @@
     void load_override(T & t, BOOST_PFTO int version){
       this->detail_common_iarchive::load_override(t, static_cast<int>(version));
     }
-
-    // include these to trap a change in binary format which
-    // isn't specifically handled
-    // upto 32K classes
-    BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t));
-    BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t));
-    // upto 2G objects
-    BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t));
-    BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
-
     // binary files don't include the optional information 
     void load_override(class_id_optional_type & /* t */, int){}
 
-    void load_override(tracking_type & t, int /*version*/){
-        library_version_type lvt = this->get_library_version();
-        if(boost::archive::library_version_type(6) < lvt){
-            int_least8_t x=0;
-            * this->This() >> x;
-            t = boost::archive::tracking_type(x);
-        }
-        else{
-            bool x=0;
-            * this->This() >> x;
-            t = boost::archive::tracking_type(x);
-        }
+    // the following have been overridden to provide specific sizes
+    // for these pseudo prmitive types.
+    void load_override(version_type & t, int){ 
+        // upto 255 versions
+        unsigned char x=0;
+        * this->This() >> x;
+        t = version_type(x);
     }
-    void load_override(class_id_type & t, int version){
-        library_version_type lvt = this->get_library_version();
-        if(boost::archive::library_version_type(7) < lvt){
-            this->detail_common_iarchive::load_override(t, version);
-        }
-        else
-        if(boost::archive::library_version_type(6) < lvt){
-            int_least16_t x=0;
-            * this->This() >> x;
-            t = boost::archive::class_id_type(x);
-        }
-        else{
-            int x=0;
-            * this->This() >> x;
-            t = boost::archive::class_id_type(x);
-        }
+    void load_override(class_id_type & t, int){
+        // upto 32K classes
+        int_least16_t x=0;
+        * this->This() >> x;
+        t = class_id_type(x);
     }
-    void load_override(class_id_reference_type & t, int version){
-        load_override(static_cast<class_id_type &>(t), version);
+    void load_override(class_id_reference_type & t, int){
+        // upto 32K classes
+        int_least16_t x=0;
+        * this->This() >> x;
+        t = class_id_reference_type(x);
     }
-#if 0
-    void load_override(class_id_reference_type & t, int version){
-        library_version_type lvt = this->get_library_version();
-        if(boost::archive::library_version_type(7) < lvt){
-            this->detail_common_iarchive::load_override(t, version);
-        }
-        else
-        if(boost::archive::library_version_type(6) < lvt){
-            int_least16_t x=0;
-            * this->This() >> x;
-            t = boost::archive::class_id_reference_type(
-                boost::archive::class_id_type(x)
-            );
-        }
-        else{
-            int x=0;
-            * this->This() >> x;
-            t = boost::archive::class_id_reference_type(
-                boost::archive::class_id_type(x)
-            );
-        }
+    void load_override(object_id_type & t, int){
+        // upto 2G objects
+        uint_least32_t x=0;
+        * this->This() >> x;
+        t = object_id_type(x);
     }
-#endif
-
-    void load_override(version_type & t, int version){
-        library_version_type lvt = this->get_library_version();
-        if(boost::archive::library_version_type(7) < lvt){
-            this->detail_common_iarchive::load_override(t, version);
-        }
-        else
-        if(boost::archive::library_version_type(6) < lvt){
-            uint_least8_t x=0;
-            * this->This() >> x;
-            t = boost::archive::version_type(x);
-        }
-        else
-        if(boost::archive::library_version_type(5) < lvt){
-            uint_least16_t x=0;
-            * this->This() >> x;
-            t = boost::archive::version_type(x);
-        }
-        else
-        if(boost::archive::library_version_type(2) < lvt){
-            // upto 255 versions
-            unsigned char x=0;
-            * this->This() >> x;
-            t = version_type(x);
-        }
-        else{
-            unsigned int x=0;
-            * this->This() >> x;
-            t = boost::archive::version_type(x);
-        }
+    void load_override(object_reference_type & t, int){
+        // upto 2G objects
+        uint_least32_t x=0;
+        * this->This() >> x;
+        t = object_reference_type(x);
     }
-
-    void load_override(boost::serialization::item_version_type & t, int version){
-        library_version_type lvt = this->get_library_version();
-//        if(boost::archive::library_version_type(7) < lvt){
-        if(boost::archive::library_version_type(6) < lvt){
-            this->detail_common_iarchive::load_override(t, version);
-        }
-        else
-        if(boost::archive::library_version_type(6) < lvt){
-            uint_least16_t x=0;
-            * this->This() >> x;
-            t = boost::serialization::item_version_type(x);
-        }
-        else{
-            unsigned int x=0;
-            * this->This() >> x;
-            t = boost::serialization::item_version_type(x);
-        }
+    void load_override(tracking_type & t, int){
+        char x=0;
+        * this->This() >> x;
+        t = (0 != x);
     }
-
-    void load_override(serialization::collection_size_type & t, int version){
-        if(boost::archive::library_version_type(5) < this->get_library_version()){
-            this->detail_common_iarchive::load_override(t, version);
-        }
-        else{
-            unsigned int x=0;
-            * this->This() >> x;
-            t = serialization::collection_size_type(x);
-        } 
-    }
+  void load_override(serialization::collection_size_type & t, int){
+       unsigned int x=0;
+       * this->This() >> x;
+       t = serialization::collection_size_type(x);
+   }
 
     BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
     load_override(class_name_type & t, int);
@@ -213,10 +120,6 @@
 } // 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_BASIC_BINARY_IARCHIVE_HPP
diff --git a/boost/archive/basic_binary_iprimitive.hpp b/boost/archive/basic_binary_iprimitive.hpp
index fc27123..11f5b38 100644
--- a/boost/archive/basic_binary_iprimitive.hpp
+++ b/boost/archive/basic_binary_iprimitive.hpp
@@ -28,7 +28,7 @@
 //  See http://www.boost.org for updates, documentation, and revision history.
 
 #include <iosfwd>
-#include <boost/assert.hpp>
+#include <cassert>
 #include <locale>
 #include <cstring> // std::memcpy
 #include <cstddef> // std::size_t
@@ -46,15 +46,15 @@
 #include <boost/cstdint.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/serialization/throw_exception.hpp>
-#include <boost/integer.hpp>
-#include <boost/integer_traits.hpp>
+//#include <boost/limits.hpp>
+//#include <boost/io/ios_state.hpp>
 
 #include <boost/archive/basic_streambuf_locale_saver.hpp>
 #include <boost/archive/archive_exception.hpp>
+#include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/mpl/placeholders.hpp>
 #include <boost/serialization/is_bitwise_serializable.hpp>
 #include <boost/serialization/array.hpp>
-#include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 namespace boost { 
@@ -95,7 +95,7 @@
     void load(bool & t){
         load_binary(& t, sizeof(t));
         int i = t;
-        BOOST_ASSERT(0 == i || 1 == i);
+        assert(0 == i || 1 == i);
         (void)i; // warning suppression for release builds.
     }
     BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
@@ -126,10 +126,10 @@
         template <class T>  
         #if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)  
             struct apply {  
-                typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type;  
+                typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable<T>::type type;  
             };
         #else
-            struct apply : public boost::serialization::is_bitwise_serializable< T > {};  
+            struct apply : public boost::serialization::is_bitwise_serializable<T> {};  
         #endif
     };
 
@@ -151,22 +151,17 @@
     std::size_t count
 ){
     // note: an optimizer should eliminate the following for char files
-    BOOST_ASSERT(
-        static_cast<std::streamsize>(count / sizeof(Elem)) 
-        <= boost::integer_traits<std::streamsize>::const_max
-    );
-    std::streamsize s = static_cast<std::streamsize>(count / sizeof(Elem));
+    std::streamsize s = count / sizeof(Elem);
     std::streamsize scount = m_sb.sgetn(
         static_cast<Elem *>(address), 
         s
     );
     if(scount != s)
         boost::serialization::throw_exception(
-            archive_exception(archive_exception::input_stream_error)
+            archive_exception(archive_exception::stream_error)
         );
     // note: an optimizer should eliminate the following for char files
-    BOOST_ASSERT(count % sizeof(Elem) <= boost::integer_traits<std::streamsize>::const_max);
-    s = static_cast<std::streamsize>(count % sizeof(Elem));
+    s = count % sizeof(Elem);
     if(0 < s){
 //        if(is.fail())
 //            boost::serialization::throw_exception(
@@ -176,7 +171,7 @@
         scount = m_sb.sgetn(& t, 1);
         if(scount != 1)
             boost::serialization::throw_exception(
-                archive_exception(archive_exception::input_stream_error)
+                archive_exception(archive_exception::stream_error)
             );
         std::memcpy(static_cast<char*>(address) + (count - s), &t, s);
     }
diff --git a/boost/archive/basic_binary_oarchive.hpp b/boost/archive/basic_binary_oarchive.hpp
index 01622b9..93f5c11 100644
--- a/boost/archive/basic_binary_oarchive.hpp
+++ b/boost/archive/basic_binary_oarchive.hpp
@@ -23,25 +23,17 @@
 // IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE
 // ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON
 
-#include <boost/assert.hpp>
-#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/serialization/pfto.hpp>
-
+#include <cassert>
 #include <boost/integer.hpp>
 #include <boost/integer_traits.hpp>
 
+#include <boost/config.hpp>
+#include <boost/serialization/pfto.hpp>
+
+#include <boost/detail/workaround.hpp>
 #include <boost/archive/detail/common_oarchive.hpp>
 #include <boost/serialization/string.hpp>
 #include <boost/serialization/collection_size_type.hpp>
-#include <boost/serialization/item_version_type.hpp>
-
-#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
-
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
 
 namespace boost {
 namespace archive {
@@ -75,72 +67,44 @@
       this->detail_common_oarchive::save_override(t, static_cast<int>(version));
     }
 
-    // include these to trap a change in binary format which
-    // isn't specifically handled
-    BOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(bool));
-    // upto 32K classes
-    BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t));
-    BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t));
-    // upto 2G objects
-    BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t));
-    BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
-
     // binary files don't include the optional information 
     void save_override(const class_id_optional_type & /* t */, int){}
 
-    // enable this if we decide to support generation of previous versions
-    #if 0
-    void save_override(const boost::archive::version_type & t, int version){
-        library_version_type lvt = this->get_library_version();
-        if(boost::archive::library_version_type(7) < lvt){
-            this->detail_common_oarchive::save_override(t, version);
-        }
-        else
-        if(boost::archive::library_version_type(6) < lvt){
-            const boost::uint_least16_t x = t;
-            * this->This() << x;
-        }
-        else{
-            const unsigned int x = t;
-            * this->This() << x;
-        }
+    void save_override(const version_type & t, int){
+        // upto 255 versions
+        // note:t.t resolves borland ambguity
+        assert(t.t <= boost::integer_traits<unsigned char>::const_max);
+        const unsigned char x = static_cast<const unsigned char>(t.t);
+        * this->This() << x;
     }
-    void save_override(const boost::serialization::item_version_type & t, int version){
-        library_version_type lvt = this->get_library_version();
-        if(boost::archive::library_version_type(7) < lvt){
-            this->detail_common_oarchive::save_override(t, version);
-        }
-        else
-        if(boost::archive::library_version_type(6) < lvt){
-            const boost::uint_least16_t x = t;
-            * this->This() << x;
-        }
-        else{
-            const unsigned int x = t;
-            * this->This() << x;
-        }
+    void save_override(const class_id_type & t, int){
+        // upto 32K classes
+        assert(t.t <= boost::integer_traits<boost::int_least16_t>::const_max);
+        const boost::int_least16_t x = static_cast<const boost::int_least16_t>(t.t); 
+        * this->This() << x;
     }
-
-    void save_override(class_id_type & t, int version){
-        library_version_type lvt = this->get_library_version();
-        if(boost::archive::library_version_type(7) < lvt){
-            this->detail_common_oarchive::save_override(t, version);
-        }
-        else
-        if(boost::archive::library_version_type(6) < lvt){
-            const boost::int_least16_t x = t;
-            * this->This() << x;
-        }
-        else{
-            const int x = t;
-            * this->This() << x;
-        }
+    void save_override(const class_id_reference_type & t, int){
+        // upto 32K classes
+        assert(t.t <= boost::integer_traits<boost::uint_least32_t>::const_max);
+        const boost::uint_least16_t x = t.t;
+        * this->This() << x;
     }
-    void save_override(class_id_reference_type & t, int version){
-        save_override(static_cast<class_id_type &>(t), version);
+    void save_override(const object_id_type & t, int){
+        // upto 2G objects
+        assert(t.t <= boost::integer_traits<boost::uint_least32_t>::const_max);
+        const boost::uint_least32_t x = t.t;
+        * this->This() << x;
     }
-
-    #endif
+    void save_override(const object_reference_type & t, int){
+        // upto 2G objects
+        assert(t.t <= boost::integer_traits<boost::uint_least32_t>::const_max);
+        const boost::uint_least32_t x = t.t;
+        * this->This() << x;
+    }
+    void save_override(const tracking_type & t, int){
+        const char x = t.t;
+        * this->This() << x;
+    }
 
     // explicitly convert to char * to avoid compile ambiguities
     void save_override(const class_name_type & t, int){
@@ -148,18 +112,12 @@
         * this->This() << s;
     }
 
-    #if 0
     void save_override(const serialization::collection_size_type & t, int){
-        if (get_library_version() < boost::archive::library_version_type(6)){
-            unsigned int x=0;
-            * this->This() >> x;
-            t = serialization::collection_size_type(x);
-        } 
-        else{
-            * this->This() >> t;
-        }
-    }
-    #endif
+    // for backward compatibility, 64 bit integer or variable length integer would be preferred
+        unsigned int x = t.t;
+        * this->This() << x;
+   }
+
     BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
     init();
 
@@ -171,10 +129,4 @@
 } // 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_BASIC_BINARY_OARCHIVE_HPP
diff --git a/boost/archive/basic_binary_oprimitive.hpp b/boost/archive/basic_binary_oprimitive.hpp
index 53e44e4..c22c87c 100644
--- a/boost/archive/basic_binary_oprimitive.hpp
+++ b/boost/archive/basic_binary_oprimitive.hpp
@@ -24,7 +24,7 @@
 // ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON
 
 #include <iosfwd>
-#include <boost/assert.hpp>
+#include <cassert>
 #include <locale>
 #include <streambuf> // basic_streambuf
 #include <string>
@@ -38,17 +38,17 @@
 #endif
 
 #include <boost/cstdint.hpp>
-#include <boost/integer.hpp>
-#include <boost/integer_traits.hpp>
+//#include <boost/limits.hpp>
+//#include <boost/io/ios_state.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/serialization/throw_exception.hpp>
 
 #include <boost/archive/basic_streambuf_locale_saver.hpp>
 #include <boost/archive/archive_exception.hpp>
+#include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/serialization/is_bitwise_serializable.hpp>
 #include <boost/mpl/placeholders.hpp>
 #include <boost/serialization/array.hpp>
-#include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 namespace boost {
@@ -88,7 +88,7 @@
     // trap usage of invalid uninitialized boolean which would
     // otherwise crash on load.
     void save(const bool t){
-        BOOST_ASSERT(0 == static_cast<int>(t) || 1 == static_cast<int>(t));
+        assert(0 == static_cast<int>(t) || 1 == static_cast<int>(t));
         save_binary(& t, sizeof(t));
     }
     BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
@@ -122,10 +122,10 @@
         template <class T>  
         #if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)  
             struct apply {  
-                typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type;  
+                typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable<T>::type type;  
             };
         #else
-            struct apply : public boost::serialization::is_bitwise_serializable< T > {};  
+            struct apply : public boost::serialization::is_bitwise_serializable<T> {};  
         #endif
     };
     
@@ -146,7 +146,7 @@
     const void *address, 
     std::size_t count
 ){
-    //BOOST_ASSERT(
+    //assert(
     //    static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)()) >= count
     //);
     // note: if the following assertions fail
@@ -155,25 +155,24 @@
     // be sure that the output stream is opened with ios::binary
     //if(os.fail())
     //    boost::serialization::throw_exception(
-    //        archive_exception(archive_exception::output_stream_error)
+    //        archive_exception(archive_exception::stream_error)
     //    );
     // figure number of elements to output - round up
     count = ( count + sizeof(Elem) - 1) 
         / sizeof(Elem);
-    BOOST_ASSERT(count <= std::size_t(boost::integer_traits<std::streamsize>::const_max));
     std::streamsize scount = m_sb.sputn(
         static_cast<const Elem *>(address), 
-        static_cast<std::streamsize>(count)
+        count
     );
     if(count != static_cast<std::size_t>(scount))
         boost::serialization::throw_exception(
-            archive_exception(archive_exception::output_stream_error)
+            archive_exception(archive_exception::stream_error)
         );
     //os.write(
     //    static_cast<const BOOST_DEDUCED_TYPENAME OStream::char_type *>(address), 
     //    count
     //);
-    //BOOST_ASSERT(os.good());
+    //assert(os.good());
 }
 
 } //namespace boost 
diff --git a/boost/archive/basic_streambuf_locale_saver.hpp b/boost/archive/basic_streambuf_locale_saver.hpp
index ca764e1..3f587de 100644
--- a/boost/archive/basic_streambuf_locale_saver.hpp
+++ b/boost/archive/basic_streambuf_locale_saver.hpp
@@ -29,20 +29,11 @@
 #include <locale>     // for std::locale
 #include <streambuf>  // for std::basic_streambuf
 
-#include <boost/config.hpp>
-#include <boost/noncopyable.hpp>
-
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost{
 namespace archive{
 
 template < typename Ch, class Tr >
-class basic_streambuf_locale_saver :
-    private boost::noncopyable
+class basic_streambuf_locale_saver
 {
 public:
     typedef ::std::basic_streambuf<Ch, Tr> state_type;
@@ -65,9 +56,5 @@
 } // archive
 } // boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #endif // BOOST_NO_STD_LOCALE
 #endif // BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP
diff --git a/boost/archive/basic_text_iarchive.hpp b/boost/archive/basic_text_iarchive.hpp
index 729d51a..8080564 100644
--- a/boost/archive/basic_text_iarchive.hpp
+++ b/boost/archive/basic_text_iarchive.hpp
@@ -29,14 +29,10 @@
 #include <boost/detail/workaround.hpp>
 
 #include <boost/archive/detail/common_iarchive.hpp>
+#include <boost/serialization/string.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
 namespace archive {
 
@@ -61,7 +57,8 @@
     // template ordering
     typedef detail::common_iarchive<Archive> detail_common_iarchive;
     template<class T>
-    void load_override(T & t, BOOST_PFTO int){
+    void load_override(T & t, BOOST_PFTO int)
+    {
         this->detail_common_iarchive::load_override(t, 0);
     }
     // text file don't include the optional information 
@@ -82,10 +79,6 @@
 } // 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_BASIC_TEXT_IARCHIVE_HPP
diff --git a/boost/archive/basic_text_iprimitive.hpp b/boost/archive/basic_text_iprimitive.hpp
index b927ec9..da3234c 100644
--- a/boost/archive/basic_text_iprimitive.hpp
+++ b/boost/archive/basic_text_iprimitive.hpp
@@ -24,7 +24,7 @@
 // in such cases.   So we can't use basic_ostream<IStream::char_type> but rather
 // use two template parameters
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <locale>
 #include <cstddef> // size_t
 
@@ -46,11 +46,9 @@
 #include <boost/limits.hpp>
 #include <boost/io/ios_state.hpp>
 #include <boost/scoped_ptr.hpp>
-#include <boost/static_assert.hpp>
 
 #include <boost/serialization/throw_exception.hpp>
 #include <boost/archive/archive_exception.hpp>
-#include <boost/archive/basic_streambuf_locale_saver.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 namespace boost {
@@ -58,11 +56,6 @@
 
 /////////////////////////////////////////////////////////////////////////
 // class basic_text_iarchive - load serialized objects from a input text stream
-#if defined(_MSC_VER)
-#pragma warning( push )
-#pragma warning( disable : 4244 4267 )
-#endif
-
 template<class IStream>
 class basic_text_iprimitive
 {
@@ -77,50 +70,60 @@
 
     #ifndef BOOST_NO_STD_LOCALE
     boost::scoped_ptr<std::locale> archive_locale;
-    basic_streambuf_locale_saver<
-        BOOST_DEDUCED_TYPENAME IStream::char_type, 
-        BOOST_DEDUCED_TYPENAME IStream::traits_type
+    io::basic_ios_locale_saver<
+        BOOST_DEDUCED_TYPENAME IStream::char_type, BOOST_DEDUCED_TYPENAME IStream::traits_type
     > locale_saver;
     #endif
 
     template<class T>
     void load(T & t)
     {
-        if(! is.fail()){
-            is >> t;
-            return;
-        }
-        boost::serialization::throw_exception(
-            archive_exception(archive_exception::input_stream_error)
-        );
-    }
-
-    void load(char & t)
-    {
-        short int i;
-        load(i);
-        t = i;
-    }
-    void load(signed char & t)
-    {
-        short int i;
-        load(i);
-        t = i;
+        if(is.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
+        is >> t;
     }
     void load(unsigned char & t)
     {
+        if(is.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
         unsigned short int i;
-        load(i);
-        t = i;
+        is >> i;
+        t = static_cast<unsigned char>(i);
     }
-
+    void load(signed char & t)
+    {
+        if(is.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
+        signed short int i;
+        is >> i;
+        t = static_cast<signed char>(i);
+    }
+    void load(char & t)
+    {
+        if(is.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
+        short int i;
+        is >> i;
+        t = static_cast<char>(i);
+    }
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
     void load(wchar_t & t)
     {
-        BOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int));
-        int i;
-        load(i);
-        t = i;
+        if(is.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
+        unsigned i;
+        is >> i;
+        t = static_cast<wchar_t>(i);
     }
     #endif
     BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) 
@@ -132,10 +135,6 @@
     load_binary(void *address, std::size_t count);
 };
 
-#if defined(_MSC_VER)
-#pragma warning( pop )
-#endif
-
 } // namespace archive
 } // namespace boost
 
diff --git a/boost/archive/basic_text_oarchive.hpp b/boost/archive/basic_text_oarchive.hpp
index dd10f65..4fd55f0 100644
--- a/boost/archive/basic_text_oarchive.hpp
+++ b/boost/archive/basic_text_oarchive.hpp
@@ -24,7 +24,7 @@
 // in such cases.   So we can't use basic_ostream<OStream::char_type> but rather
 // use two template parameters
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <boost/config.hpp>
 #include <boost/serialization/pfto.hpp>
 #include <boost/detail/workaround.hpp>
@@ -34,11 +34,6 @@
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
 namespace archive {
 
@@ -83,7 +78,34 @@
     // start new objects on a new line
     void save_override(const object_id_type & t, int){
         this->This()->newline();
-        this->detail_common_oarchive::save_override(t, 0);
+        // note extra .t to funciton with Borland 5.51 compiler
+        // and invoke prmitive to underlying value
+        this->This()->save(t.t);
+    }
+
+    void save_override(const object_reference_type & t, int){
+        this->This()->newline();
+        // note extra .t to funciton with Borland 5.51 compiler
+        // and invoke prmitive to underlying value
+        this->This()->save(t.t);
+    }
+
+    // note the following four overrides are necessary for some borland
+    // compilers(5.51) which don't handle BOOST_STRONG_TYPE properly.
+    void save_override(const version_type & t, int){
+        // note:t.t resolves borland ambguity
+        const unsigned int x = t.t;
+        * this->This() << x;
+    }
+    void save_override(const class_id_type & t, int){
+        // note:t.t resolves borland ambguity
+        const int x = t.t;
+        * this->This() << x;
+    }
+    void save_override(const class_id_reference_type & t, int){
+        // note:t.t resolves borland ambguity
+        const int x = t.t;
+        * this->This() << x;
     }
 
     // text file don't include the optional information 
@@ -107,10 +129,6 @@
 } // 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_BASIC_TEXT_OARCHIVE_HPP
diff --git a/boost/archive/basic_text_oprimitive.hpp b/boost/archive/basic_text_oprimitive.hpp
index 06885ad..ba87709 100644
--- a/boost/archive/basic_text_oprimitive.hpp
+++ b/boost/archive/basic_text_oprimitive.hpp
@@ -27,11 +27,10 @@
 #include <iomanip>
 #include <locale>
 #include <boost/config/no_tr1/cmath.hpp> // isnan
-#include <boost/assert.hpp>
+#include <cassert>
 #include <cstddef> // size_t
 
 #include <boost/config.hpp>
-#include <boost/static_assert.hpp>
 #include <boost/detail/workaround.hpp>
 #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
 #include <boost/archive/dinkumware.hpp>
@@ -47,12 +46,12 @@
 #endif
 
 #include <boost/limits.hpp>
-#include <boost/integer.hpp>
 #include <boost/io/ios_state.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/serialization/throw_exception.hpp>
+
 #include <boost/archive/archive_exception.hpp>
-#include <boost/archive/basic_streambuf_locale_saver.hpp>
+
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 namespace boost {
@@ -76,9 +75,8 @@
 
     #ifndef BOOST_NO_STD_LOCALE
     boost::scoped_ptr<std::locale> archive_locale;
-    basic_streambuf_locale_saver<
-        BOOST_DEDUCED_TYPENAME OStream::char_type, 
-        BOOST_DEDUCED_TYPENAME OStream::traits_type
+    io::basic_ios_locale_saver<
+        BOOST_DEDUCED_TYPENAME OStream::char_type, BOOST_DEDUCED_TYPENAME OStream::traits_type
     > locale_saver;
     #endif
 
@@ -87,7 +85,7 @@
     void save(const T &t){
         if(os.fail())
             boost::serialization::throw_exception(
-                archive_exception(archive_exception::output_stream_error)
+                archive_exception(archive_exception::stream_error)
             );
         os << t;
     }
@@ -97,30 +95,45 @@
     void save(const bool t){
         // trap usage of invalid uninitialized boolean which would
         // otherwise crash on load.
-        BOOST_ASSERT(0 == static_cast<int>(t) || 1 == static_cast<int>(t));
+        assert(0 == static_cast<int>(t) || 1 == static_cast<int>(t));
         if(os.fail())
             boost::serialization::throw_exception(
-                archive_exception(archive_exception::output_stream_error)
+                archive_exception(archive_exception::stream_error)
             );
         os << t;
     }
     void save(const signed char t)
     {
-        save(static_cast<short int>(t));
+        if(os.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
+        os << static_cast<short int>(t);
     }
     void save(const unsigned char t)
     {
-        save(static_cast<short unsigned int>(t));
+        if(os.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
+        os << static_cast<short unsigned int>(t);
     }
     void save(const char t)
     {
-        save(static_cast<short int>(t));
+        if(os.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
+        os << static_cast<short int>(t);
     }
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
     void save(const wchar_t t)
     {
-        BOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int));
-        save(static_cast<int>(t));
+        if(os.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
+        os << static_cast<int>(t);
     }
     #endif
     void save(const float t)
@@ -128,7 +141,7 @@
         // must be a user mistake - can't serialize un-initialized data
         if(os.fail())
             boost::serialization::throw_exception(
-                archive_exception(archive_exception::output_stream_error)
+                archive_exception(archive_exception::stream_error)
             );
         os << std::setprecision(std::numeric_limits<float>::digits10 + 2);
         os << t;
@@ -138,7 +151,7 @@
         // must be a user mistake - can't serialize un-initialized data
         if(os.fail())
             boost::serialization::throw_exception(
-                archive_exception(archive_exception::output_stream_error)
+                archive_exception(archive_exception::stream_error)
             );
         os << std::setprecision(std::numeric_limits<double>::digits10 + 2);
         os << t;
@@ -149,15 +162,19 @@
     ~basic_text_oprimitive();
 public:
     // unformatted append of one character
-    void put(BOOST_DEDUCED_TYPENAME OStream::char_type c){
+    void put(int c){
         if(os.fail())
             boost::serialization::throw_exception(
-                archive_exception(archive_exception::output_stream_error)
+                archive_exception(archive_exception::stream_error)
             );
         os.put(c);
     }
     // unformatted append of null terminated string
     void put(const char * s){
+        if(os.fail())
+            boost::serialization::throw_exception(
+                archive_exception(archive_exception::stream_error)
+            );
         while('\0' != *s)
             os.put(*s++);
     }
diff --git a/boost/archive/basic_xml_archive.hpp b/boost/archive/basic_xml_archive.hpp
index c99d94f..df99836 100644
--- a/boost/archive/basic_xml_archive.hpp
+++ b/boost/archive/basic_xml_archive.hpp
@@ -16,9 +16,9 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
+#include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/archive_exception.hpp>
 
-#include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 namespace boost { 
diff --git a/boost/archive/basic_xml_iarchive.hpp b/boost/archive/basic_xml_iarchive.hpp
index d7b8bfd..fd3ae75 100644
--- a/boost/archive/basic_xml_iarchive.hpp
+++ b/boost/archive/basic_xml_iarchive.hpp
@@ -29,11 +29,6 @@
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
 namespace archive {
 
@@ -67,7 +62,7 @@
         // If your program fails to compile here, its most likely due to
         // not specifying an nvp wrapper around the variable to
         // be serialized.
-        BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
+        BOOST_MPL_ASSERT((serialization::is_wrapper<T>));
         this->detail_common_iarchive::load_override(t, 0);
     }
 
@@ -79,7 +74,7 @@
         #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
         const
         #endif
-        boost::serialization::nvp< T > & t,
+        boost::serialization::nvp<T> & t,
         int
     ){
         this->This()->load_start(t.name());
@@ -118,10 +113,6 @@
 } // 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_BASIC_XML_IARCHIVE_HPP
diff --git a/boost/archive/basic_xml_oarchive.hpp b/boost/archive/basic_xml_oarchive.hpp
index b571372..0ba2589 100644
--- a/boost/archive/basic_xml_oarchive.hpp
+++ b/boost/archive/basic_xml_oarchive.hpp
@@ -28,11 +28,6 @@
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
 namespace archive {
 
@@ -89,18 +84,18 @@
         // If your program fails to compile here, its most likely due to
         // not specifying an nvp wrapper around the variable to
         // be serialized.
-        BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
+        BOOST_MPL_ASSERT((serialization::is_wrapper<T>));
         this->detail_common_oarchive::save_override(t, 0);
     }
 
-    // special treatment for name-value pairs.
+   // special treatment for name-value pairs.
     typedef detail::common_oarchive<Archive> detail_common_oarchive;
     template<class T>
     void save_override(
         #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
         const
         #endif
-        ::boost::serialization::nvp< T > & t,
+        ::boost::serialization::nvp<T> & t,
         int
     ){
         this->This()->save_start(t.name());
@@ -136,10 +131,6 @@
 } // 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_BASIC_XML_OARCHIVE_HPP
diff --git a/boost/archive/binary_iarchive.hpp b/boost/archive/binary_iarchive.hpp
index 638d996..fdfc355 100644
--- a/boost/archive/binary_iarchive.hpp
+++ b/boost/archive/binary_iarchive.hpp
@@ -20,11 +20,6 @@
 #include <boost/archive/binary_iarchive_impl.hpp>
 #include <boost/archive/detail/register_archive.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -96,8 +91,4 @@
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_iarchive)
 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_iarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
diff --git a/boost/archive/binary_iarchive_impl.hpp b/boost/archive/binary_iarchive_impl.hpp
index 32c476d..c1d04d1 100644
--- a/boost/archive/binary_iarchive_impl.hpp
+++ b/boost/archive/binary_iarchive_impl.hpp
@@ -21,11 +21,6 @@
 #include <boost/archive/basic_binary_iprimitive.hpp>
 #include <boost/archive/basic_binary_iarchive.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -89,8 +84,4 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #endif // BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP
diff --git a/boost/archive/binary_oarchive.hpp b/boost/archive/binary_oarchive.hpp
index 2aac14f..ee5e7d8 100644
--- a/boost/archive/binary_oarchive.hpp
+++ b/boost/archive/binary_oarchive.hpp
@@ -17,15 +17,9 @@
 //  See http://www.boost.org for updates, documentation, and revision history.
 
 #include <ostream>
-#include <boost/config.hpp>
 #include <boost/archive/binary_oarchive_impl.hpp>
 #include <boost/archive/detail/register_archive.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -59,8 +53,4 @@
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_oarchive)
 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_oarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #endif // BOOST_ARCHIVE_BINARY_OARCHIVE_HPP
diff --git a/boost/archive/binary_oarchive_impl.hpp b/boost/archive/binary_oarchive_impl.hpp
index 7ca773b..331a874 100644
--- a/boost/archive/binary_oarchive_impl.hpp
+++ b/boost/archive/binary_oarchive_impl.hpp
@@ -17,16 +17,10 @@
 //  See http://www.boost.org for updates, documentation, and revision history.
 
 #include <ostream>
-#include <boost/config.hpp>
 #include <boost/serialization/pfto.hpp>
 #include <boost/archive/basic_binary_oprimitive.hpp>
 #include <boost/archive/basic_binary_oarchive.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -90,8 +84,4 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #endif // BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP
diff --git a/boost/archive/codecvt_null.hpp b/boost/archive/codecvt_null.hpp
index 910b261..9732ad9 100644
--- a/boost/archive/codecvt_null.hpp
+++ b/boost/archive/codecvt_null.hpp
@@ -24,20 +24,13 @@
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 #if defined(BOOST_NO_STDC_NAMESPACE)
-namespace std {
 // For STLport on WinCE, BOOST_NO_STDC_NAMESPACE can get defined if STLport is putting symbols in its own namespace.
 // In the case of codecvt, however, this does not mean that codecvt is in the global namespace (it will be in STLport's namespace)
-#  if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+#  if !defined(UNDER_CE) || (!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION))
     using ::codecvt;
 #  endif
     using ::mbstate_t;
     using ::size_t;
-} // namespace
-#endif
-
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
 #endif
 
 namespace boost {
@@ -92,9 +85,6 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#  pragma warning(pop)
-#endif
 #include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
 
 #endif //BOOST_ARCHIVE_CODECVT_NULL_HPP
diff --git a/boost/archive/detail/archive_serializer_map.hpp b/boost/archive/detail/archive_serializer_map.hpp
index 6d2eec4..ba68e30 100644
--- a/boost/archive/detail/archive_serializer_map.hpp
+++ b/boost/archive/detail/archive_serializer_map.hpp
@@ -7,10 +7,10 @@
 #endif
 
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
-// archive_serializer_map.hpp: extenstion of type_info required for 
+// archive_pointer_oserializer.hpp: extenstion of type_info required for 
 // serialization.
 
-// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com . 
+// (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)
@@ -36,10 +36,10 @@
 class basic_serializer;
 
 template<class Archive>
-class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) 
-archive_serializer_map {
+class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) archive_serializer_map 
+{
 public:
-    static bool insert(const basic_serializer * bs);
+    static void insert(const basic_serializer * bs);
     static void erase(const basic_serializer * bs);
     static const basic_serializer * find(
         const boost::serialization::extended_type_info & type_
diff --git a/boost/archive/detail/auto_link_archive.hpp b/boost/archive/detail/auto_link_archive.hpp
index 05956f0..af2788b 100644
--- a/boost/archive/detail/auto_link_archive.hpp
+++ b/boost/archive/detail/auto_link_archive.hpp
@@ -45,4 +45,4 @@
     #include <boost/config/auto_link.hpp>
 #endif  // auto-linking disabled
 
-#endif // BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP
+#endif // ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP
diff --git a/boost/archive/detail/basic_iarchive.hpp b/boost/archive/detail/basic_iarchive.hpp
index f62987e..4c9707c 100644
--- a/boost/archive/detail/basic_iarchive.hpp
+++ b/boost/archive/detail/basic_iarchive.hpp
@@ -20,8 +20,6 @@
 // #include <boost/scoped_ptr.hpp>
 
 #include <boost/config.hpp>
-#include <boost/noncopyable.hpp>
-
 #include <boost/type_traits/broken_compiler_spec.hpp>
 #include <boost/serialization/tracking_enum.hpp>
 #include <boost/archive/basic_archive.hpp>
@@ -41,8 +39,7 @@
 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
 //////////////////////////////////////////////////////////////////////
 // class basic_iarchive - read serialized objects from a input stream
-class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive :
-    private boost::noncopyable
+class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive 
 {
     friend class basic_iarchive_impl;
     // hide implementation of this class to minimize header conclusion
@@ -56,6 +53,9 @@
     virtual void vload(class_id_optional_type &t) = 0;
     virtual void vload(class_name_type &t) = 0;
     virtual void vload(tracking_type &t) = 0;
+
+    virtual const basic_pointer_iserializer * 
+    find(const boost::serialization::extended_type_info & eti) const = 0;
 protected:
     basic_iarchive(unsigned int flags);
     // account for bogus gcc warning
@@ -76,16 +76,12 @@
     const basic_pointer_iserializer * 
     load_pointer(
         void * & t, 
-        const basic_pointer_iserializer * bpis_ptr,
-        const basic_pointer_iserializer * (*finder)(
-            const boost::serialization::extended_type_info & eti
-        )
-
+        const basic_pointer_iserializer * bpis_ptr
     );
     // real public API starts here
     void 
-    set_library_version(library_version_type archive_library_version);
-    library_version_type 
+    set_library_version(unsigned int archive_library_version);
+    unsigned int 
     get_library_version() const;
     unsigned int
     get_flags() const;
diff --git a/boost/archive/detail/basic_iserializer.hpp b/boost/archive/detail/basic_iserializer.hpp
index 2f4f6d8..de9654f 100644
--- a/boost/archive/detail/basic_iserializer.hpp
+++ b/boost/archive/detail/basic_iserializer.hpp
@@ -19,18 +19,13 @@
 #include <cstdlib> // NULL
 #include <boost/config.hpp>
 
-#include <boost/archive/basic_archive.hpp>
 #include <boost/archive/detail/decl.hpp>
 #include <boost/archive/detail/basic_serializer.hpp>
 #include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
+
 namespace serialization {
     class extended_type_info;
 } // namespace serialization
@@ -76,7 +71,7 @@
     // returns true if objects should be tracked
     virtual bool tracking(const unsigned int) const = 0 ;
     // returns class version
-    virtual version_type version() const = 0 ;
+    virtual unsigned int version() const = 0 ;
     // returns true if this class is polymorphic
     virtual bool is_polymorphic() const = 0;
     virtual void destroy(/*const*/ void *address) const = 0 ;
@@ -86,10 +81,6 @@
 } // 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_BASIC_ISERIALIZER_HPP
diff --git a/boost/archive/detail/basic_oarchive.hpp b/boost/archive/detail/basic_oarchive.hpp
index 402e569..0a1b404 100644
--- a/boost/archive/detail/basic_oarchive.hpp
+++ b/boost/archive/detail/basic_oarchive.hpp
@@ -16,10 +16,8 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <cstddef> // NULL
 #include <boost/config.hpp>
-#include <boost/noncopyable.hpp>
-
+#include <cstddef> // NULL
 #include <boost/type_traits/broken_compiler_spec.hpp>
 
 // can't use this - much as I'd like to as borland doesn't support it
@@ -43,8 +41,7 @@
 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
 //////////////////////////////////////////////////////////////////////
 // class basic_oarchive - write serialized objects to an output stream
-class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive :
-    private boost::noncopyable
+class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive
 {
     friend class basic_oarchive_impl;
     // hide implementation of this class to minimize header conclusion
@@ -87,7 +84,7 @@
     }
     // real public interface starts here
     void end_preamble(); // default implementation does nothing
-    library_version_type get_library_version() const;
+    unsigned int get_library_version() const;
     unsigned int get_flags() const;
 };
 
diff --git a/boost/archive/detail/basic_oserializer.hpp b/boost/archive/detail/basic_oserializer.hpp
index 74af7e6..69a06cb 100644
--- a/boost/archive/detail/basic_oserializer.hpp
+++ b/boost/archive/detail/basic_oserializer.hpp
@@ -18,20 +18,14 @@
 
 #include <cstddef> // NULL
 #include <boost/config.hpp>
-#include <boost/noncopyable.hpp>
 
-#include <boost/archive/basic_archive.hpp>
 #include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/detail/basic_serializer.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
+
 namespace serialization {
     class extended_type_info;
 } // namespace serialization
@@ -75,7 +69,7 @@
     // returns true if objects should be tracked
     virtual bool tracking(const unsigned int flags) const = 0;
     // returns class version
-    virtual version_type version() const = 0;
+    virtual unsigned int version() const = 0;
     // returns true if this class is polymorphic
     virtual bool is_polymorphic() const = 0;
 };
@@ -84,10 +78,6 @@
 } // namespace serialization
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
 #endif // BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP
diff --git a/boost/archive/detail/basic_pointer_iserializer.hpp b/boost/archive/detail/basic_pointer_iserializer.hpp
index d957b83..1a46938 100644
--- a/boost/archive/detail/basic_pointer_iserializer.hpp
+++ b/boost/archive/detail/basic_pointer_iserializer.hpp
@@ -17,18 +17,13 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 #include <boost/config.hpp>
-#include <boost/noncopyable.hpp>
 #include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/detail/basic_serializer.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
+
 namespace serialization {
     class extended_type_info;
 } // namespace serialization
@@ -64,10 +59,6 @@
 } // 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_BASIC_POINTER_ISERIALIZER_HPP
diff --git a/boost/archive/detail/basic_pointer_oserializer.hpp b/boost/archive/detail/basic_pointer_oserializer.hpp
index b0d3fb9..9c8d717 100644
--- a/boost/archive/detail/basic_pointer_oserializer.hpp
+++ b/boost/archive/detail/basic_pointer_oserializer.hpp
@@ -17,18 +17,13 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 #include <boost/config.hpp>
-#include <boost/noncopyable.hpp>
 #include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/detail/basic_serializer.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
+
 namespace serialization {
     class extended_type_info;
 } // namespace serialization
@@ -40,8 +35,7 @@
 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
 
 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer : 
-    public basic_serializer
-{
+    public basic_serializer {
 protected:
     explicit basic_pointer_oserializer(
         const boost::serialization::extended_type_info & type_
@@ -63,10 +57,6 @@
 } // 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_BASIC_POINTER_OSERIALIZER_HPP
diff --git a/boost/archive/detail/basic_serializer.hpp b/boost/archive/detail/basic_serializer.hpp
index 5dbd886..f0f9b37 100644
--- a/boost/archive/detail/basic_serializer.hpp
+++ b/boost/archive/detail/basic_serializer.hpp
@@ -16,18 +16,13 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <cstddef> // NULL
 
 #include <boost/noncopyable.hpp>
 #include <boost/config.hpp>
 #include <boost/serialization/extended_type_info.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
 namespace archive {
 namespace detail {
@@ -42,25 +37,23 @@
     ) : 
         m_eti(& eti)
     {
-        BOOST_ASSERT(NULL != & eti);
+        assert(NULL != & eti);
     }
 public:
-    inline bool 
-    operator<(const basic_serializer & rhs) const {
-        // can't compare address since there can be multiple eti records
-        // for the same type in different execution modules (that is, DLLS)
-        // leave this here as a reminder not to do this!
-        // return & lhs.get_eti() < & rhs.get_eti();
-        return get_eti() < rhs.get_eti();
-    }
-    const char * get_debug_info() const {
-        return m_eti->get_debug_info();
-    }
     const boost::serialization::extended_type_info & get_eti() const {
         return * m_eti;
     }
 };
 
+inline bool 
+operator<(const basic_serializer & lhs, const basic_serializer & rhs)  {
+    // can't compare address since there can be multiple eti records
+    // for the same type in different execution modules (that is, DLLS)
+    // leave this here as a reminder not to do this!
+    // return & lhs.get_eti() < & rhs.get_eti();
+    return lhs.get_eti() < rhs.get_eti();
+}
+
 class basic_serializer_arg : public basic_serializer {
 public:
     basic_serializer_arg(const serialization::extended_type_info & eti) :
@@ -72,8 +65,4 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #endif // BOOST_ARCHIVE_BASIC_SERIALIZER_HPP
diff --git a/boost/archive/detail/basic_serializer_map.hpp b/boost/archive/detail/basic_serializer_map.hpp
index 19defcb..f11fb1b 100644
--- a/boost/archive/detail/basic_serializer_map.hpp
+++ b/boost/archive/detail/basic_serializer_map.hpp
@@ -16,14 +16,14 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <set>
+#include <list>
 
 #include <boost/config.hpp>
-#include <boost/utility.hpp>
 #include <boost/archive/detail/auto_link_archive.hpp>
-
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
+#include <boost/utility.hpp>
+
 namespace boost { 
 namespace serialization {
     class extended_type_info;
@@ -34,23 +34,13 @@
 
 class basic_serializer;
 
-class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
-basic_serializer_map : public
+class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_serializer_map : public
     boost::noncopyable
 {
-    struct type_info_pointer_compare
-    {
-        bool operator()(
-            const basic_serializer * lhs, const basic_serializer * rhs
-        ) const ;
-    };
-    typedef std::set<
-        const basic_serializer *, 
-        type_info_pointer_compare
-    > map_type;
+    typedef std::list<const basic_serializer *> map_type;
     map_type m_map;
 public:
-    bool insert(const basic_serializer * bs);
+    void insert(const basic_serializer * bs);
     void erase(const basic_serializer * bs);
     const basic_serializer * find(
         const boost::serialization::extended_type_info & type_
diff --git a/boost/archive/detail/check.hpp b/boost/archive/detail/check.hpp
deleted file mode 100644
index c9cba51..0000000
--- a/boost/archive/detail/check.hpp
+++ /dev/null
@@ -1,169 +0,0 @@
-#ifndef BOOST_ARCHIVE_DETAIL_CHECK_HPP
-#define BOOST_ARCHIVE_DETAIL_CHECK_HPP
-
-// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#pragma inline_depth(511)
-#pragma inline_recursion(on)
-#endif
-
-#if defined(__MWERKS__)
-#pragma inline_depth(511)
-#endif
-
-/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
-// check.hpp: interface for serialization system.
-
-// (C) Copyright 2009 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 <boost/config.hpp>
-
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_const.hpp>
-
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/or.hpp>
-#include <boost/mpl/equal_to.hpp>
-#include <boost/mpl/int.hpp>
-#include <boost/mpl/not.hpp>
-#include <boost/mpl/greater.hpp>
-#include <boost/mpl/assert.hpp>
-
-#include <boost/serialization/static_warning.hpp>
-#include <boost/serialization/version.hpp>
-#include <boost/serialization/level.hpp>
-#include <boost/serialization/tracking.hpp>
-#include <boost/serialization/wrapper.hpp>
-
-namespace boost {
-namespace archive {
-namespace detail {
-
-// checks for objects
-
-template<class T>
-inline void check_object_level(){
-    typedef 
-        BOOST_DEDUCED_TYPENAME mpl::greater_equal<
-            serialization::implementation_level< T >,
-            mpl::int_<serialization::primitive_type>
-        >::type typex;
-
-    // trap attempts to serialize objects marked
-    // not_serializable
-    BOOST_STATIC_ASSERT(typex::value);
-}
-
-template<class T>
-inline void check_object_versioning(){
-    typedef 
-        BOOST_DEDUCED_TYPENAME mpl::or_<
-            BOOST_DEDUCED_TYPENAME mpl::greater<
-                serialization::implementation_level< T >,
-                mpl::int_<serialization::object_serializable>
-            >,
-            BOOST_DEDUCED_TYPENAME mpl::equal_to<
-                serialization::version< T >,
-                mpl::int_<0>
-            >
-        > typex;
-    // trap attempts to serialize with objects that don't
-    // save class information in the archive with versioning.
-    BOOST_STATIC_ASSERT(typex::value);
-}
-
-template<class T>
-inline void check_object_tracking(){
-    // presume it has already been determined that
-    // T is not a const
-    BOOST_STATIC_ASSERT(! boost::is_const< T >::value);
-    typedef BOOST_DEDUCED_TYPENAME mpl::equal_to<
-        serialization::tracking_level< T >,
-        mpl::int_<serialization::track_never>
-    >::type typex;
-    // saving an non-const object of a type not marked "track_never)
-
-    // may be an indicator of an error usage of the
-    // serialization library and should be double checked.  
-    // See documentation on object tracking.  Also, see the 
-    // "rationale" section of the documenation
-    // for motivation for this checking.
-
-    BOOST_STATIC_WARNING(typex::value);
-}
-
-// checks for pointers
-
-template<class T>
-inline void check_pointer_level(){
-    // we should only invoke this once we KNOW that T
-    // has been used as a pointer!!
-    typedef 
-        BOOST_DEDUCED_TYPENAME mpl::or_<
-            BOOST_DEDUCED_TYPENAME mpl::greater<
-                serialization::implementation_level< T >,
-                mpl::int_<serialization::object_serializable>
-            >,
-            BOOST_DEDUCED_TYPENAME mpl::not_<
-                BOOST_DEDUCED_TYPENAME mpl::equal_to<
-                    serialization::tracking_level< T >,
-                    mpl::int_<serialization::track_selectively>
-                >
-            >
-        > typex;
-    // Address the following when serializing to a pointer:
-
-    // a) This type doesn't save class information in the
-    // archive. That is, the serialization trait implementation
-    // level <= object_serializable.
-    // b) Tracking for this type is set to "track selectively"
-
-    // in this case, indication that an object is tracked is
-    // not stored in the archive itself - see level == object_serializable
-    // but rather the existence of the operation ar >> T * is used to 
-    // infer that an object of this type should be tracked.  So, if
-    // you save via a pointer but don't load via a pointer the operation
-    // will fail on load without given any valid reason for the failure.
-
-    // So if your program traps here, consider changing the 
-    // tracking or implementation level traits - or not
-    // serializing via a pointer.
-    BOOST_STATIC_WARNING(typex::value);
-}
-
-template<class T>
-void inline check_pointer_tracking(){
-    typedef BOOST_DEDUCED_TYPENAME mpl::greater<
-        serialization::tracking_level< T >,
-        mpl::int_<serialization::track_never>
-    >::type typex;
-    // serializing an object of a type marked "track_never" through a pointer
-    // could result in creating more objects than were saved!
-    BOOST_STATIC_WARNING(typex::value);
-}
-
-template<class T>
-inline void check_const_loading(){
-    typedef
-        BOOST_DEDUCED_TYPENAME mpl::or_<
-            BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper< T >,
-            BOOST_DEDUCED_TYPENAME mpl::not_<
-                BOOST_DEDUCED_TYPENAME boost::is_const< T >
-            >
-        >::type typex;
-    // cannot load data into a "const" object unless it's a
-    // wrapper around some other non-const object.
-    BOOST_STATIC_ASSERT(typex::value);
-}
-
-} // detail
-} // archive
-} // boost
-
-#endif // BOOST_ARCHIVE_DETAIL_CHECK_HPP
diff --git a/boost/archive/detail/common_iarchive.hpp b/boost/archive/detail/common_iarchive.hpp
index 54c07c3..2713c2f 100644
--- a/boost/archive/detail/common_iarchive.hpp
+++ b/boost/archive/detail/common_iarchive.hpp
@@ -16,16 +16,11 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/config.hpp>
-
 #include <boost/archive/detail/basic_iarchive.hpp>
 #include <boost/archive/detail/basic_pointer_iserializer.hpp>
 #include <boost/archive/detail/interface_iarchive.hpp>
-
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
+#include <boost/archive/detail/archive_serializer_map.hpp>
+#include <boost/serialization/singleton.hpp>
 
 namespace boost {
 namespace archive {
@@ -74,15 +69,18 @@
         basic_iarchive(flags),
         interface_iarchive<Archive>()
     {}
+public:
+    virtual const basic_pointer_iserializer * 
+    find(const boost::serialization::extended_type_info & eti) const {
+    	return static_cast<const basic_pointer_iserializer *>(
+            archive_serializer_map<Archive>::find(eti)
+        );
+    }
 };
 
 } // namespace detail
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
 
diff --git a/boost/archive/detail/common_oarchive.hpp b/boost/archive/detail/common_oarchive.hpp
index 7962063..db072c3 100644
--- a/boost/archive/detail/common_oarchive.hpp
+++ b/boost/archive/detail/common_oarchive.hpp
@@ -16,16 +16,9 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/config.hpp>
-
 #include <boost/archive/detail/basic_oarchive.hpp>
 #include <boost/archive/detail/interface_oarchive.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
 namespace archive {
 namespace detail {
@@ -80,8 +73,4 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #endif // BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP
diff --git a/boost/archive/detail/interface_iarchive.hpp b/boost/archive/detail/interface_iarchive.hpp
index 0648752..7fd363d 100644
--- a/boost/archive/detail/interface_iarchive.hpp
+++ b/boost/archive/detail/interface_iarchive.hpp
@@ -15,6 +15,7 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 //  See http://www.boost.org for updates, documentation, and revision history.
+#include <string>
 #include <cstddef> // NULL
 #include <boost/cstdint.hpp>
 #include <boost/mpl/bool.hpp>
diff --git a/boost/archive/detail/interface_oarchive.hpp b/boost/archive/detail/interface_oarchive.hpp
index e8db7a2..6331e0e 100644
--- a/boost/archive/detail/interface_oarchive.hpp
+++ b/boost/archive/detail/interface_oarchive.hpp
@@ -15,6 +15,7 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 //  See http://www.boost.org for updates, documentation, and revision history.
+#include <string>
 #include <cstddef> // NULL
 #include <boost/cstdint.hpp>
 #include <boost/mpl/bool.hpp>
diff --git a/boost/archive/detail/iserializer.hpp b/boost/archive/detail/iserializer.hpp
index 46033fd..5788ee3 100644
--- a/boost/archive/detail/iserializer.hpp
+++ b/boost/archive/detail/iserializer.hpp
@@ -33,43 +33,54 @@
     using ::size_t; 
 } // namespace std
 #endif
-
-#include <boost/static_assert.hpp>
-
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/identity.hpp>
-#include <boost/mpl/greater_equal.hpp>
-#include <boost/mpl/equal_to.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/detail/no_exceptions_support.hpp>
-
-#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO   
-    #include <boost/serialization/extended_type_info_typeid.hpp>   
-#endif
 #include <boost/serialization/throw_exception.hpp>
 #include <boost/serialization/smart_cast.hpp>
+#include <boost/static_assert.hpp>
 #include <boost/serialization/static_warning.hpp>
+#include <boost/detail/no_exceptions_support.hpp>
 
 #include <boost/type_traits/is_pointer.hpp>
 #include <boost/type_traits/is_enum.hpp>
 #include <boost/type_traits/is_const.hpp>
 #include <boost/type_traits/remove_const.hpp>
 #include <boost/type_traits/remove_extent.hpp>
-#include <boost/type_traits/is_polymorphic.hpp>
-
 #include <boost/serialization/assume_abstract.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
 
 #define DONT_USE_HAS_NEW_OPERATOR (                    \
     defined(__BORLANDC__)                              \
     || defined(__IBMCPP__)                             \
     || defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)     \
-    || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590)   \
+    || defined(__SUNPRO_CC) && (__SUBPRO_CC < 0x590)   \
 )
 
 #if ! DONT_USE_HAS_NEW_OPERATOR
 #include <boost/type_traits/has_new_operator.hpp>
 #endif
 
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/greater_equal.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/empty.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/bool.hpp>
+
+#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO   
+    #include <boost/serialization/extended_type_info_typeid.hpp>   
+#endif
+// the following is need only for dynamic cast of polymorphic pointers
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/archive/detail/basic_iserializer.hpp>
+#include <boost/archive/detail/basic_pointer_iserializer.hpp>
+#include <boost/archive/detail/archive_serializer_map.hpp>
+#include <boost/archive/archive_exception.hpp>
+
 #include <boost/serialization/serialization.hpp>
 #include <boost/serialization/version.hpp>
 #include <boost/serialization/level.hpp>
@@ -80,15 +91,6 @@
 #include <boost/serialization/array.hpp>
 #include <boost/serialization/collection_size_type.hpp>
 #include <boost/serialization/singleton.hpp>
-#include <boost/serialization/wrapper.hpp>
-
-// the following is need only for dynamic cast of polymorphic pointers
-#include <boost/archive/archive_exception.hpp>
-#include <boost/archive/detail/basic_iarchive.hpp>
-#include <boost/archive/detail/basic_iserializer.hpp>
-#include <boost/archive/detail/basic_pointer_iserializer.hpp>
-#include <boost/archive/detail/archive_serializer_map.hpp>
-#include <boost/archive/detail/check.hpp>
 
 namespace boost {
 
@@ -110,11 +112,6 @@
 
 namespace detail {
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 template<class Archive, class T>
 class iserializer : public basic_iserializer
 {
@@ -126,10 +123,8 @@
     // protected constructor since it's always created by singleton
     explicit iserializer() :
         basic_iserializer(
-            boost::serialization::singleton<
-                BOOST_DEDUCED_TYPENAME 
-                boost::serialization::type_info_implementation< T >::type
-            >::get_const_instance()
+            boost::serialization::type_info_implementation<T>::type
+                ::get_const_instance()
         )
     {}
 public:
@@ -139,50 +134,37 @@
         const unsigned int file_version
     ) const BOOST_USED;
     virtual bool class_info() const {
-        return boost::serialization::implementation_level< T >::value 
+        return boost::serialization::implementation_level<T>::value 
             >= boost::serialization::object_class_info;
     }
     virtual bool tracking(const unsigned int /* flags */) const {
-        return boost::serialization::tracking_level< T >::value 
+        return boost::serialization::tracking_level<T>::value 
                 == boost::serialization::track_always
-            || ( boost::serialization::tracking_level< T >::value 
+            || ( boost::serialization::tracking_level<T>::value 
                 == boost::serialization::track_selectively
                 && serialized_as_pointer());
     }
-    virtual version_type version() const {
-        return version_type(::boost::serialization::version< T >::value);
+    virtual unsigned int version() const {
+        return ::boost::serialization::version<T>::value;
     }
     virtual bool is_polymorphic() const {
-        return boost::is_polymorphic< T >::value;
+        return boost::is_polymorphic<T>::value;
     }
     virtual ~iserializer(){};
 };
 
-#ifdef BOOST_MSVC
-#  pragma warning(pop)
-#endif
-
 template<class Archive, class T>
 BOOST_DLLEXPORT void iserializer<Archive, T>::load_object_data(
     basic_iarchive & ar,
     void *x, 
     const unsigned int file_version
 ) const {
-    // note: we now comment this out. Before we permited archive
-    // version # to be very large.  Now we don't.  To permit
-    // readers of these old archives, we have to suppress this 
-    // code.  Perhaps in the future we might re-enable it but
-    // permit its suppression with a runtime switch.
-    #if 0
     // trap case where the program cannot handle the current version
-    if(file_version > static_cast<const unsigned int>(version()))
-        boost::serialization::throw_exception(
-            archive::archive_exception(
-                boost::archive::archive_exception::unsupported_class_version,
-                get_debug_info()
-            )
-        );
-    #endif
+    if(file_version > version())
+        boost::serialization::throw_exception(archive::archive_exception(
+            boost::archive::archive_exception::unsupported_class_version
+        ));
+
     // make sure call is routed through the higest interface that might
     // be specialized by the user.
     boost::serialization::serialize_adl(
@@ -192,11 +174,6 @@
     );
 }
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 template<class Archive, class T>
 class pointer_iserializer :
     public basic_pointer_iserializer
@@ -218,10 +195,6 @@
     ~pointer_iserializer();
 };
 
-#ifdef BOOST_MSVC
-#  pragma warning(pop)
-#endif
-
 // note trick to be sure that operator new is using class specific
 // version if such exists. Due to Peter Dimov.
 // note: the following fails if T has no default constructor.
@@ -236,7 +209,7 @@
 template<class T>
 struct heap_allocator
 {
-    // boost::has_new_operator< T > doesn't work on these compilers
+    // boost::has_new_operator<T> doesn't work on these compilers
     #if DONT_USE_HAS_NEW_OPERATOR
         // This doesn't handle operator new overload for class T
         static T * invoke(){
@@ -256,7 +229,7 @@
         static T * invoke() {
             typedef BOOST_DEDUCED_TYPENAME
                 mpl::eval_if<
-                    boost::has_new_operator< T >,
+                    boost::has_new_operator<T>,
                     mpl::identity<has_new_operator >,
                     mpl::identity<doesnt_have_new_operator >    
                 >::type typex;
@@ -302,7 +275,7 @@
     Archive & ar_impl = 
         boost::serialization::smart_cast_reference<Archive &>(ar);
 
-    auto_ptr_with_deleter< T > ap(heap_allocator< T >::invoke());
+    auto_ptr_with_deleter<T> ap(heap_allocator<T>::invoke());
     if(NULL == ap.get())
         boost::serialization::throw_exception(std::bad_alloc()) ;
 
@@ -335,10 +308,8 @@
 template<class Archive, class T>
 pointer_iserializer<Archive, T>::pointer_iserializer() :
     basic_pointer_iserializer(
-        boost::serialization::singleton<
-            BOOST_DEDUCED_TYPENAME 
-            boost::serialization::type_info_implementation< T >::type
-        >::get_const_instance()
+        boost::serialization::type_info_implementation<T>::type
+            ::get_const_instance()
     )
 {
     boost::serialization::singleton<
@@ -352,12 +323,11 @@
     archive_serializer_map<Archive>::erase(this);
 }
 
-template<class Archive>
+template<class Archive, class T>
 struct load_non_pointer_type {
     // note this bounces the call right back to the archive
     // with no runtime overhead
     struct load_primitive {
-        template<class T>
         static void invoke(Archive & ar, T & t){
             load_access::load_primitive(ar, t);
         }
@@ -365,15 +335,12 @@
     // note this bounces the call right back to the archive
     // with no runtime overhead
     struct load_only {
-        template<class T>
-        static void invoke(Archive & ar, const T & t){
+        static void invoke(Archive & ar, T & t){
             // short cut to user's serializer
             // make sure call is routed through the higest interface that might
             // be specialized by the user.
             boost::serialization::serialize_adl(
-                ar, 
-                const_cast<T &>(t), 
-                boost::serialization::version< T >::value
+                ar, t, boost::serialization::version<T>::value
             );
         }
     };
@@ -381,9 +348,12 @@
     // note this save class information including version
     // and serialization level to the archive
     struct load_standard {
-        template<class T>
-        static void invoke(Archive &ar, const T & t){
-            void * x = & const_cast<T &>(t);
+        static void invoke(Archive &ar, T &t){
+            //BOOST_STATIC_ASSERT(! boost::is_const<T>::value);
+            // borland - for some reason T is const here - even though
+            // its not called that way - so fix it her
+            typedef BOOST_DEDUCED_TYPENAME boost::remove_const<T>::type typex;
+            void * x = & const_cast<typex &>(t);
             ar.load_object(
                 x, 
                 boost::serialization::singleton<
@@ -394,7 +364,6 @@
     };
 
     struct load_conditional {
-        template<class T>
         static void invoke(Archive &ar, T &t){
             //if(0 == (ar.get_flags() & no_tracking))
                 load_standard::invoke(ar, t);
@@ -403,65 +372,74 @@
         }
     };
 
-    template<class T>
-    static void invoke(Archive & ar, T &t){
-        typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
-                // if its primitive
-                mpl::equal_to<
-                    boost::serialization::implementation_level< T >,
-                    mpl::int_<boost::serialization::primitive_type>
-                >,
-                mpl::identity<load_primitive>,
-            // else
-            BOOST_DEDUCED_TYPENAME mpl::eval_if<
-            // class info / version
-            mpl::greater_equal<
-                        boost::serialization::implementation_level< T >,
-                        mpl::int_<boost::serialization::object_class_info>
-                    >,
-            // do standard load
-            mpl::identity<load_standard>,
+    typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+            // if its primitive
+            mpl::equal_to<
+                boost::serialization::implementation_level<T>,
+                mpl::int_<boost::serialization::primitive_type>
+            >,
+            mpl::identity<load_primitive>,
         // else
         BOOST_DEDUCED_TYPENAME mpl::eval_if<
-            // no tracking
-                    mpl::equal_to<
-                        boost::serialization::tracking_level< T >,
-                        mpl::int_<boost::serialization::track_never>
+        // class info / version
+        mpl::greater_equal<
+                    boost::serialization::implementation_level<T>,
+                    mpl::int_<boost::serialization::object_class_info>
                 >,
-                // do a fast load
-                mpl::identity<load_only>,
-            // else
-            // do a fast load only tracking is turned off
-            mpl::identity<load_conditional>
-        > > >::type typex;
-        check_object_versioning< T >();
-        check_object_level< T >();
+        // do standard load
+        mpl::identity<load_standard>,
+    // else
+    BOOST_DEDUCED_TYPENAME mpl::eval_if<
+        // no tracking
+                mpl::equal_to<
+                    boost::serialization::tracking_level<T>,
+                    mpl::int_<boost::serialization::track_never>
+            >,
+            // do a fast load
+            mpl::identity<load_only>,
+        // else
+        // do a fast load only tracking is turned off
+        mpl::identity<load_conditional>
+    > > >::type typex;
+
+    static void invoke(Archive & ar, T &t){
+        // check that we're not trying to serialize something that
+        // has been marked not to be serialized.  If this your program
+        // traps here, you've tried to serialize a class whose trait
+        // has been marked "non-serializable". Either reset the trait
+        // (see level.hpp) or change program not to serialize items of this class
+        BOOST_STATIC_ASSERT((
+            mpl::greater_equal<
+                boost::serialization::implementation_level<T>, 
+                mpl::int_<boost::serialization::primitive_type>
+            >::value
+        ));
         typex::invoke(ar, t);
     }
 };
 
-template<class Archive>
+template<class Archive, class Tptr>
 struct load_pointer_type {
+    template<class T>
     struct abstract
     {
-        template<class T>
         static const basic_pointer_iserializer * register_type(Archive & /* ar */){
             // it has? to be polymorphic
-            BOOST_STATIC_ASSERT(boost::is_polymorphic< T >::value);
+            BOOST_STATIC_ASSERT(boost::is_polymorphic<T>::value);
             return static_cast<basic_pointer_iserializer *>(NULL);
          }
     };
 
+    template<class T>
     struct non_abstract
     {
-        template<class T>
         static const basic_pointer_iserializer * register_type(Archive & ar){
             return ar.register_type(static_cast<T *>(NULL));
         }
     };
 
     template<class T>
-    static const basic_pointer_iserializer * register_type(Archive &ar, const T & /*t*/){
+    static const basic_pointer_iserializer * register_type(Archive &ar, T & /*t*/){
         // there should never be any need to load an abstract polymorphic 
         // class pointer.  Inhibiting code generation for this
         // permits abstract base classes to be used - note: exception
@@ -469,58 +447,34 @@
         typedef BOOST_DEDUCED_TYPENAME
             mpl::eval_if<
                 boost::serialization::is_abstract<const T>,
-                boost::mpl::identity<abstract>,
-                boost::mpl::identity<non_abstract>  
+                mpl::identity<abstract<T> >,
+                mpl::identity<non_abstract<T> >    
             >::type typex;
-        return typex::template register_type< T >(ar);
+        return typex::register_type(ar);
     }
 
     template<class T>
     static T * pointer_tweak(
         const boost::serialization::extended_type_info & eti,
-        void const * const t,
-        const T &
+        void * t,
+        T &
     ) {
         // tweak the pointer back to the base class
         return static_cast<T *>(
-            const_cast<void *>(
-                boost::serialization::void_upcast(
-                    eti,
-                    boost::serialization::singleton<
-                        BOOST_DEDUCED_TYPENAME 
-                        boost::serialization::type_info_implementation< T >::type
-                    >::get_const_instance(),
-                    t
-                )
+            boost::serialization::void_upcast(
+                eti,
+                boost::serialization::type_info_implementation<T>::type
+                    ::get_const_instance(),
+                t
             )
         );
     }
 
-    template<class T>
-    static void check_load(T & /* t */){
-        check_pointer_level< T >();
-        check_pointer_tracking< T >();
-    }
-
-    static const basic_pointer_iserializer *
-    find(const boost::serialization::extended_type_info & type){
-        return static_cast<const basic_pointer_iserializer *>(
-            archive_serializer_map<Archive>::find(type)
-        );
-    }
-
-    template<class Tptr>
     static void invoke(Archive & ar, Tptr & t){
-        check_load(*t);
         const basic_pointer_iserializer * bpis_ptr = register_type(ar, *t);
         const basic_pointer_iserializer * newbpis_ptr = ar.load_pointer(
-            // note major hack here !!!
-            // I tried every way to convert Tptr &t (where Tptr might
-            // include const) to void * &.  This is the only way
-            // I could make it work. RR
-            (void * & )t,
-            bpis_ptr,
-            find
+            * reinterpret_cast<void **>(&t),
+            bpis_ptr
         );
         // if the pointer isn't that of the base class
         if(newbpis_ptr != bpis_ptr){
@@ -529,39 +483,35 @@
     }
 };
 
-template<class Archive>
+template<class Archive, class T>
 struct load_enum_type {
-    template<class T>
     static void invoke(Archive &ar, T &t){
         // convert integers to correct enum to load
         int i;
         ar >> boost::serialization::make_nvp(NULL, i);
-        t = static_cast< T >(i);
+        t = static_cast<T>(i);
     }
 };
 
-template<class Archive>
+template<class Archive, class T>
 struct load_array_type {
-    template<class T>
     static void invoke(Archive &ar, T &t){
-        typedef BOOST_DEDUCED_TYPENAME remove_extent< T >::type value_type;
+        typedef BOOST_DEDUCED_TYPENAME remove_extent<T>::type value_type;
         
         // convert integers to correct enum to load
         // determine number of elements in the array. Consider the
         // fact that some machines will align elements on boundries
         // other than characters.
-        std::size_t current_count = sizeof(t) / (
+        int current_count = sizeof(t) / (
             static_cast<char *>(static_cast<void *>(&t[1])) 
             - static_cast<char *>(static_cast<void *>(&t[0]))
         );
-        boost::serialization::collection_size_type count;
+        int count;
         ar >> BOOST_SERIALIZATION_NVP(count);
-        if(static_cast<std::size_t>(count) > current_count)
-            boost::serialization::throw_exception(
-                archive::archive_exception(
-                    boost::archive::archive_exception::array_size_too_short
-                )
-            );
+        if(count > current_count)
+            boost::serialization::throw_exception(archive::archive_exception(
+                boost::archive::archive_exception::array_size_too_short
+            ));
         ar >> serialization::make_array(static_cast<value_type*>(&t[0]),count);
     }
 };
@@ -569,35 +519,33 @@
 } // detail
 
 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
     // const object with a compiler that doesn't have correct
     // funtion template ordering.  On other compilers, this is
     // handled below.
-    detail::check_const_loading< T >();
+    BOOST_STATIC_ASSERT(! boost::is_const<T>::value);
     typedef
-        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_pointer< T >,
-            mpl::identity<detail::load_pointer_type<Archive> >
+        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_pointer<T>,
+            mpl::identity<detail::load_pointer_type<Archive, T> >
         ,//else
-        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_array< T >,
-            mpl::identity<detail::load_array_type<Archive> >
+        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_array<T>,
+            mpl::identity<detail::load_array_type<Archive, T> >
         ,//else
-        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_enum< T >,
-            mpl::identity<detail::load_enum_type<Archive> >
+        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_enum<T>,
+            mpl::identity<detail::load_enum_type<Archive, T> >
         ,//else
-            mpl::identity<detail::load_non_pointer_type<Archive> >
+            mpl::identity<detail::load_non_pointer_type<Archive, T> >
         >
         >
         >::type typex;
     typex::invoke(ar, t);
 }
 
-#if 0
-
 // BORLAND
 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
 // borland has a couple of problems
-// a) if function is partially specialized - see below
+// a) if function is partiall specialized - see below
 // const paramters are transformed to non-const ones
 // b) implementation of base_object can't be made to work
 // correctly which results in all base_object s being const.
@@ -619,13 +567,11 @@
 #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
 template<class Archive, class T>
 inline void load(Archive &ar, const T&t){
-  load_wrapper(ar,t,serialization::is_wrapper< T >());
+  load_wrapper(ar,t,serialization::is_wrapper<T>());
 }
 #endif 
 #endif
 
-#endif
-
 } // namespace archive
 } // namespace boost
 
diff --git a/boost/archive/detail/oserializer.hpp b/boost/archive/detail/oserializer.hpp
index 7d2694d..c7021f0 100644
--- a/boost/archive/detail/oserializer.hpp
+++ b/boost/archive/detail/oserializer.hpp
@@ -22,24 +22,14 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <cstddef> // NULL
 
 #include <boost/config.hpp>
-#include <boost/static_assert.hpp>
 #include <boost/detail/workaround.hpp>
-
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/equal_to.hpp>
-#include <boost/mpl/greater_equal.hpp>
-#include <boost/mpl/identity.hpp>
-
-#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO   
-    #include <boost/serialization/extended_type_info_typeid.hpp>   
-#endif
 #include <boost/serialization/throw_exception.hpp>
 #include <boost/serialization/smart_cast.hpp>
-#include <boost/serialization/assume_abstract.hpp>
+#include <boost/static_assert.hpp>
 #include <boost/serialization/static_warning.hpp>
 
 #include <boost/type_traits/is_pointer.hpp>
@@ -47,6 +37,26 @@
 #include <boost/type_traits/is_const.hpp>
 #include <boost/type_traits/is_polymorphic.hpp>
 #include <boost/type_traits/remove_extent.hpp>
+#include <boost/serialization/assume_abstract.hpp>
+
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/greater_equal.hpp>
+#include <boost/mpl/equal_to.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/not.hpp>
+
+#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO   
+    #include <boost/serialization/extended_type_info_typeid.hpp>   
+#endif
+
+// the following is need only for dynamic cast of polymorphic pointers
+#include <boost/archive/detail/basic_oarchive.hpp>
+#include <boost/archive/detail/basic_oserializer.hpp>
+#include <boost/archive/detail/basic_pointer_oserializer.hpp>
+#include <boost/archive/detail/archive_serializer_map.hpp>
+#include <boost/archive/archive_exception.hpp>
 
 #include <boost/serialization/serialization.hpp>
 #include <boost/serialization/version.hpp>
@@ -59,13 +69,6 @@
 #include <boost/serialization/collection_size_type.hpp>
 #include <boost/serialization/singleton.hpp>
 
-#include <boost/archive/archive_exception.hpp>
-#include <boost/archive/detail/basic_oarchive.hpp>
-#include <boost/archive/detail/basic_oserializer.hpp>
-#include <boost/archive/detail/basic_pointer_oserializer.hpp>
-#include <boost/archive/detail/archive_serializer_map.hpp>
-#include <boost/archive/detail/check.hpp>
-
 namespace boost {
 
 namespace serialization {
@@ -91,11 +94,6 @@
 
 namespace detail {
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 template<class Archive, class T>
 class oserializer : public basic_oserializer
 {
@@ -105,10 +103,8 @@
 public:
     explicit BOOST_DLLEXPORT oserializer() :
         basic_oserializer(
-            boost::serialization::singleton<
-                BOOST_DEDUCED_TYPENAME 
-                boost::serialization::type_info_implementation< T >::type
-            >::get_const_instance()
+            boost::serialization::type_info_implementation<T>::type
+                ::get_const_instance()
         )
     {}
     virtual BOOST_DLLEXPORT void save_object_data(
@@ -116,27 +112,23 @@
         const void *x
     ) const BOOST_USED;
     virtual bool class_info() const {
-        return boost::serialization::implementation_level< T >::value 
+        return boost::serialization::implementation_level<T>::value 
             >= boost::serialization::object_class_info;
     }
     virtual bool tracking(const unsigned int /* flags */) const {
-        return boost::serialization::tracking_level< T >::value == boost::serialization::track_always
-            || (boost::serialization::tracking_level< T >::value == boost::serialization::track_selectively
+        return boost::serialization::tracking_level<T>::value == boost::serialization::track_always
+            || (boost::serialization::tracking_level<T>::value == boost::serialization::track_selectively
                 && serialized_as_pointer());
     }
-    virtual version_type version() const {
-        return version_type(::boost::serialization::version< T >::value);
+    virtual unsigned int version() const {
+        return ::boost::serialization::version<T>::value;
     }
     virtual bool is_polymorphic() const {
-        return boost::is_polymorphic< T >::value;
+        return boost::is_polymorphic<T>::value;
     }
     virtual ~oserializer(){}
 };
 
-#ifdef BOOST_MSVC
-#  pragma warning(pop)
-#endif
-
 template<class Archive, class T>
 BOOST_DLLEXPORT void oserializer<Archive, T>::save_object_data(
     basic_oarchive & ar,    
@@ -144,7 +136,7 @@
 ) const {
     // make sure call is routed through the highest interface that might
     // be specialized by the user.
-    BOOST_STATIC_ASSERT(boost::is_const< T >::value == false);
+    BOOST_STATIC_ASSERT(boost::is_const<T>::value == false);
     boost::serialization::serialize_adl(
         boost::serialization::smart_cast_reference<Archive &>(ar),
         * static_cast<T *>(const_cast<void *>(x)),
@@ -152,11 +144,6 @@
     );
 }
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 template<class Archive, class T>
 class pointer_oserializer :
     public basic_pointer_oserializer
@@ -177,20 +164,16 @@
     ~pointer_oserializer();
 };
 
-#ifdef BOOST_MSVC
-#  pragma warning(pop)
-#endif
-
 template<class Archive, class T>
 BOOST_DLLEXPORT void pointer_oserializer<Archive, T>::save_object_ptr(
     basic_oarchive & ar,
     const void * x
 ) const {
-    BOOST_ASSERT(NULL != x);
+    assert(NULL != x);
     // make sure call is routed through the highest interface that might
     // be specialized by the user.
     T * t = static_cast<T *>(const_cast<void *>(x));
-    const unsigned int file_version = boost::serialization::version< T >::value;
+    const unsigned int file_version = boost::serialization::version<T>::value;
     Archive & ar_impl 
         = boost::serialization::smart_cast_reference<Archive &>(ar);
     boost::serialization::save_construct_data_adl<Archive, T>(
@@ -204,10 +187,8 @@
 template<class Archive, class T>
 pointer_oserializer<Archive, T>::pointer_oserializer() :
     basic_pointer_oserializer(
-        boost::serialization::singleton<
-            BOOST_DEDUCED_TYPENAME 
-            boost::serialization::type_info_implementation< T >::type
-        >::get_const_instance()
+        boost::serialization::type_info_implementation<T>::type
+            ::get_const_instance()
     )
 {
     // make sure appropriate member function is instantiated
@@ -222,33 +203,30 @@
     archive_serializer_map<Archive>::erase(this);
 }
 
-template<class Archive>
+template<class Archive, class T>
 struct save_non_pointer_type {
     // note this bounces the call right back to the archive
     // with no runtime overhead
     struct save_primitive {
-        template<class T>
         static void invoke(Archive & ar, const T & t){
             save_access::save_primitive(ar, t);
         }
     };
     // same as above but passes through serialization
     struct save_only {
-        template<class T>
         static void invoke(Archive & ar, const T & t){
             // make sure call is routed through the highest interface that might
             // be specialized by the user.
             boost::serialization::serialize_adl(
                 ar, 
                 const_cast<T &>(t), 
-                ::boost::serialization::version< T >::value
+                ::boost::serialization::version<T>::value
             );
         }
     };
     // adds class information to the archive. This includes
     // serialization level and class version
     struct save_standard {
-        template<class T>
         static void invoke(Archive &ar, const T & t){
             ar.save_object(
                 & t, 
@@ -262,7 +240,6 @@
     // adds class information to the archive. This includes
     // serialization level and class version
     struct save_conditional {
-        template<class T>
         static void invoke(Archive &ar, const T &t){
             //if(0 == (ar.get_flags() & no_tracking))
                 save_standard::invoke(ar, t);
@@ -271,65 +248,68 @@
         }
     };
 
+    typedef 
+        BOOST_DEDUCED_TYPENAME mpl::eval_if<
+        // if its primitive
+            mpl::equal_to<
+                boost::serialization::implementation_level<T>,
+                mpl::int_<boost::serialization::primitive_type>
+            >,
+            mpl::identity<save_primitive>,
+        // else
+        BOOST_DEDUCED_TYPENAME mpl::eval_if<
+            // class info / version
+            mpl::greater_equal<
+                boost::serialization::implementation_level<T>,
+                mpl::int_<boost::serialization::object_class_info>
+            >,
+            // do standard save
+            mpl::identity<save_standard>,
+        // else
+        BOOST_DEDUCED_TYPENAME mpl::eval_if<
+                // no tracking
+            mpl::equal_to<
+                boost::serialization::tracking_level<T>,
+                mpl::int_<boost::serialization::track_never>
+            >,
+            // do a fast save
+            mpl::identity<save_only>,
+        // else
+            // do a fast save only tracking is turned off
+            mpl::identity<save_conditional>
+        > > >::type typex; 
 
-    template<class T>
     static void invoke(Archive & ar, const T & t){
-        typedef 
-            BOOST_DEDUCED_TYPENAME mpl::eval_if<
-            // if its primitive
-                mpl::equal_to<
-                    boost::serialization::implementation_level< T >,
-                    mpl::int_<boost::serialization::primitive_type>
-                >,
-                mpl::identity<save_primitive>,
-            // else
-            BOOST_DEDUCED_TYPENAME mpl::eval_if<
-                // class info / version
-                mpl::greater_equal<
-                    boost::serialization::implementation_level< T >,
-                    mpl::int_<boost::serialization::object_class_info>
-                >,
-                // do standard save
-                mpl::identity<save_standard>,
-            // else
-            BOOST_DEDUCED_TYPENAME mpl::eval_if<
-                    // no tracking
-                mpl::equal_to<
-                    boost::serialization::tracking_level< T >,
-                    mpl::int_<boost::serialization::track_never>
-                >,
-                // do a fast save
-                mpl::identity<save_only>,
-            // else
-                // do a fast save only tracking is turned off
-                mpl::identity<save_conditional>
-            > > >::type typex; 
-        check_object_versioning< T >();
+        // check that we're not trying to serialize something that
+        // has been marked not to be serialized.  If this your program
+        // traps here, you've tried to serialize a class whose trait
+        // has been marked "non-serializable". Either reset the trait
+        // (see level.hpp) or change program not to serialize items of this class
+        BOOST_STATIC_ASSERT((
+            mpl::greater_equal<
+                boost::serialization::implementation_level<T>, 
+                mpl::int_<boost::serialization::primitive_type>
+            >::value
+        ));
         typex::invoke(ar, t);
-    }
-    template<class T>
-    static void invoke(Archive & ar, T & t){
-        check_object_level< T >();
-        check_object_tracking< T >();
-        invoke(ar, const_cast<const T &>(t));
-    }
+    };
 };
 
-template<class Archive>
+template<class Archive, class TPtr>
 struct save_pointer_type {
+    template<class T>
     struct abstract
     {
-        template<class T>
         static const basic_pointer_oserializer * register_type(Archive & /* ar */){
             // it has? to be polymorphic
-            BOOST_STATIC_ASSERT(boost::is_polymorphic< T >::value);
+            BOOST_STATIC_ASSERT(boost::is_polymorphic<T>::value);
             return NULL;
         }
     };
 
+    template<class T>
     struct non_abstract
     {
-        template<class T>
         static const basic_pointer_oserializer * register_type(Archive & ar){
             return ar.register_type(static_cast<T *>(NULL));
         }
@@ -343,16 +323,16 @@
         // virtual serialize functions used for plug-ins
         typedef 
             BOOST_DEDUCED_TYPENAME mpl::eval_if<
-                boost::serialization::is_abstract< T >,
-                mpl::identity<abstract>,
-                mpl::identity<non_abstract>       
+                boost::serialization::is_abstract<T>,
+                mpl::identity<abstract<T> >,
+                mpl::identity<non_abstract<T> >       
             >::type typex;
-        return typex::template register_type< T >(ar);
+        return typex::register_type(ar);
     }
 
+    template<class T>
     struct non_polymorphic
     {
-        template<class T>
         static void save(
             Archive &ar, 
             T & t
@@ -366,25 +346,23 @@
         }
     };
 
+    template<class T>
     struct polymorphic
     {
-        template<class T>
         static void save(
             Archive &ar, 
             T & t
         ){
             BOOST_DEDUCED_TYPENAME 
-            boost::serialization::type_info_implementation< T >::type const
-            & i = boost::serialization::singleton<
-                BOOST_DEDUCED_TYPENAME 
-                boost::serialization::type_info_implementation< T >::type
-            >::get_const_instance();
+            boost::serialization::type_info_implementation<T>::type const
+            & i = boost::serialization::type_info_implementation<T>::type
+                    ::get_const_instance();
 
             boost::serialization::extended_type_info const * const this_type = & i;
 
             // retrieve the true type of the object pointed to
             // if this assertion fails its an error in this library
-            BOOST_ASSERT(NULL != this_type);
+            assert(NULL != this_type);
 
             const boost::serialization::extended_type_info * true_type =
                 i.get_derived_extended_type_info(t);
@@ -393,10 +371,7 @@
             // is either registered or exported.
             if(NULL == true_type){
                 boost::serialization::throw_exception(
-                    archive_exception(
-                        archive_exception::unregistered_class,
-                        "derived class not registered or exported"
-                    )
+                    archive_exception(archive_exception::unregistered_class)
                 );
             }
 
@@ -416,11 +391,7 @@
             );
             if(NULL == vp){
                 boost::serialization::throw_exception(
-                    archive_exception(
-                        archive_exception::unregistered_cast,
-                        true_type->get_debug_info(),
-                        this_type->get_debug_info()
-                    )
+                    archive_exception(archive_exception::unregistered_cast)
                 );
             }
 
@@ -433,35 +404,52 @@
                         archive_serializer_map<Archive>
                     >::get_const_instance().find(*true_type)
                 );
-            BOOST_ASSERT(NULL != bpos);
+            assert(NULL != bpos);
             if(NULL == bpos)
                 boost::serialization::throw_exception(
-                    archive_exception(
-                        archive_exception::unregistered_class,
-                        "derived class not registered or exported"
-                    )
+                    archive_exception(archive_exception::unregistered_class)
                 );
             ar.save_pointer(vp, bpos);
         }
     };
 
+    // out of line selector works around borland quirk
+    template<class T>
+    struct conditional {
+        typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+            is_polymorphic<T>,
+            mpl::identity<polymorphic<T> >,
+            mpl::identity<non_polymorphic<T> >
+        >::type type;
+    };
+
+    // used to convert TPtr in to a pointer to a T
     template<class T>
     static void save(
         Archive & ar, 
         const T & t
     ){
-        check_pointer_level< T >();
-        check_pointer_tracking< T >();
-        typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
-            is_polymorphic< T >,
-            mpl::identity<polymorphic>,
-            mpl::identity<non_polymorphic>
-        >::type type;
-        type::save(ar, const_cast<T &>(t));
+        conditional<T>::type::save(ar, const_cast<T &>(t));
     }
 
-    template<class TPtr>
+    template<class T>
+    static void const_check(T & t){
+        BOOST_STATIC_ASSERT(! boost::is_const<T>::value);
+    }
+
     static void invoke(Archive &ar, const TPtr t){
+        #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+            // if your program traps here, its because you tried to do
+            // something like ar << t where t is a pointer to a const value
+            // void f3(A const* a, text_oarchive& oa)
+            // {
+            //     oa << a;
+            // }
+            // with a compiler which doesn't support remove_const
+            // const_check(* t);
+        #else
+            // otherwise remove the const
+        #endif
         register_type(ar, * t);
         if(NULL == t){
             basic_oarchive & boa 
@@ -471,13 +459,12 @@
             return;
         }
         save(ar, * t);
-    }
+    };
 };
 
-template<class Archive>
+template<class Archive, class T>
 struct save_enum_type
 {
-    template<class T>
     static void invoke(Archive &ar, const T &t){
         // convert enum to integers on save
         const int i = static_cast<int>(t);
@@ -485,20 +472,18 @@
     }
 };
 
-template<class Archive>
+template<class Archive, class T>
 struct save_array_type
 {
-    template<class T>
     static void invoke(Archive &ar, const T &t){
-        typedef BOOST_DEDUCED_TYPENAME boost::remove_extent< T >::type value_type;
+        typedef BOOST_DEDUCED_TYPENAME boost::remove_extent<T>::type value_type;
         
         save_access::end_preamble(ar);
         // consider alignment
-        std::size_t c = sizeof(t) / (
+        int count = sizeof(t) / (
             static_cast<const char *>(static_cast<const void *>(&t[1])) 
             - static_cast<const char *>(static_cast<const void *>(&t[0]))
         );
-        boost::serialization::collection_size_type count(c);
         ar << BOOST_SERIALIZATION_NVP(count);
         ar << serialization::make_array(static_cast<value_type const*>(&t[0]),count);
     }
@@ -507,24 +492,58 @@
 } // detail
 
 template<class Archive, class T>
-inline void save(Archive & ar, /*const*/ T &t){
+inline void save(Archive & ar, const T &t){
     typedef 
-        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_pointer< T >,
-            mpl::identity<detail::save_pointer_type<Archive> >,
+        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_pointer<T>,
+            mpl::identity<detail::save_pointer_type<Archive, T> >,
         //else
-        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_enum< T >,
-            mpl::identity<detail::save_enum_type<Archive> >,
+        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_enum<T>,
+            mpl::identity<detail::save_enum_type<Archive, T> >,
         //else
-        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_array< T >,
-            mpl::identity<detail::save_array_type<Archive> >,
+        BOOST_DEDUCED_TYPENAME mpl::eval_if<is_array<T>,
+            mpl::identity<detail::save_array_type<Archive, T> >,
         //else
-            mpl::identity<detail::save_non_pointer_type<Archive> >
+            mpl::identity<detail::save_non_pointer_type<Archive, T> >
         >
         >
         >::type typex;
     typex::invoke(ar, t);
 }
 
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+template<class T>
+struct check_tracking {
+    typedef BOOST_DEDUCED_TYPENAME mpl::if_<
+        // if its never tracked.
+        BOOST_DEDUCED_TYPENAME mpl::equal_to<
+            serialization::tracking_level<T>,
+            mpl::int_<serialization::track_never>
+        >,
+        // it better not be a pointer
+        mpl::not_<is_pointer<T> >,
+    //else
+        // otherwise if it might be tracked.  So there shouldn't
+        // be any problem making a const
+        is_const<T>
+    >::type typex;
+    BOOST_STATIC_CONSTANT(bool, value = typex::value);
+};
+
+template<class Archive, class T>
+inline void save(Archive & ar, T &t){
+    // if your program traps here, it indicates that your doing one of the following:
+    // a) serializing an object of a type marked "track_never" through a pointer.
+    // b) saving an non-const object of a type not markd "track_never)
+    // Either of these conditions may be an indicator of an error usage of the
+    // serialization library and should be double checked.  See documentation on
+    // object tracking.  Also, see the "rationale" section of the documenation
+    // for motivation for this checking.
+    BOOST_STATIC_WARNING(check_tracking<T>::value);
+        save(ar, const_cast<const T &>(t));
+}
+#endif
+
 } // namespace archive
 } // namespace boost
 
diff --git a/boost/archive/detail/polymorphic_iarchive_route.hpp b/boost/archive/detail/polymorphic_iarchive_route.hpp
index d93bb79..e8f6240 100644
--- a/boost/archive/detail/polymorphic_iarchive_route.hpp
+++ b/boost/archive/detail/polymorphic_iarchive_route.hpp
@@ -27,8 +27,8 @@
 } // namespace std
 #endif
 
+#include <boost/noncopyable.hpp>
 #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
 
@@ -42,17 +42,13 @@
 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer;
 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) 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
+    public /*protected*/ ArchiveImplementation,
+    private boost::noncopyable
 {
 private:
     // these are used by the serialization library.
@@ -64,17 +60,14 @@
     }
     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
-        )
+        const basic_pointer_iserializer * bpis_ptr
     ){
-        return ArchiveImplementation::load_pointer(t, bpis_ptr, finder);
+        return ArchiveImplementation::load_pointer(t, bpis_ptr);
     }
-    virtual void set_library_version(library_version_type archive_library_version){
+    virtual void set_library_version(unsigned int archive_library_version){
         ArchiveImplementation::set_library_version(archive_library_version);
     }
-    virtual library_version_type get_library_version() const{
+    virtual unsigned int get_library_version() const{
         return ArchiveImplementation::get_library_version();
     }
     virtual unsigned int get_flags() const {
@@ -130,18 +123,11 @@
     virtual void load(unsigned long & t){
         ArchiveImplementation::load(t);
     }
-    #if defined(BOOST_HAS_LONG_LONG)
-    virtual void load(boost::long_long_type & t){
+    #if !defined(BOOST_NO_INTRINSIC_INT64_T)
+    virtual void load(boost::int64_t & 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){
+    virtual void load(boost::uint64_t & t){
         ArchiveImplementation::load(t);
     }
     #endif
@@ -180,17 +166,13 @@
     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(
@@ -206,10 +188,6 @@
 } // 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
diff --git a/boost/archive/detail/polymorphic_oarchive_route.hpp b/boost/archive/detail/polymorphic_oarchive_route.hpp
index f1b20f8..e043bb5 100644
--- a/boost/archive/detail/polymorphic_oarchive_route.hpp
+++ b/boost/archive/detail/polymorphic_oarchive_route.hpp
@@ -18,6 +18,8 @@
 
 #include <string>
 #include <ostream>
+#include <boost/noncopyable.hpp>
+#include <boost/cstdint.hpp>
 #include <cstddef> // size_t
 
 #include <boost/config.hpp>
@@ -27,8 +29,6 @@
 } // 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
 
@@ -42,17 +42,13 @@
 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) 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
+    public /*protected*/ ArchiveImplementation,
+    private boost::noncopyable
 {
 private:
     // these are used by the serialization library.
@@ -109,14 +105,7 @@
     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)
+    #if !defined(BOOST_NO_INTRINSIC_INT64_T)
     virtual void save(const boost::int64_t t){
         ArchiveImplementation::save(t);
     }
@@ -138,7 +127,7 @@
         ArchiveImplementation::save(t);
     }
     #endif
-    virtual library_version_type get_library_version() const{
+    virtual unsigned int get_library_version() const{
         return ArchiveImplementation::get_library_version();
     }
     virtual unsigned int get_flags() const {
@@ -175,12 +164,6 @@
     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(
@@ -196,10 +179,6 @@
 } // 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
diff --git a/boost/archive/detail/register_archive.hpp b/boost/archive/detail/register_archive.hpp
index e31ae46..87fedcb 100644
--- a/boost/archive/detail/register_archive.hpp
+++ b/boost/archive/detail/register_archive.hpp
@@ -54,12 +54,12 @@
 
 #define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive)                     \
 namespace boost { namespace archive { namespace detail {                  \
-    get_counter<Archive >::next adjust_counter(get_counter<Archive >::type);\
+    get_counter<Archive>::next adjust_counter(get_counter<Archive>::type);\
     template<class Serializable>                                          \
     void instantiate_ptr_serialization(Serializable* s,                   \
-        get_counter<Archive >::type) {                                    \
+        get_counter<Archive>::type) {                                     \
         ptr_serialization_support<Archive, Serializable> x;               \
-        instantiate_ptr_serialization(s, get_counter<Archive >::prior()); \
+        instantiate_ptr_serialization(s, get_counter<Archive>::prior());  \
     }\
 }}}
 
diff --git a/boost/archive/impl/archive_serializer_map.ipp b/boost/archive/impl/archive_serializer_map.ipp
index c8ad96b..6841121 100644
--- a/boost/archive/impl/archive_serializer_map.ipp
+++ b/boost/archive/impl/archive_serializer_map.ipp
@@ -21,26 +21,17 @@
 namespace archive {
 namespace detail {
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
-namespace extra_detail { // anon
+namespace { // anon
     template<class Archive>
     class map : public basic_serializer_map 
     {};
 }
 
-#ifdef BOOST_MSVC
-#  pragma warning(pop)
-#endif
-
 template<class Archive>
-BOOST_ARCHIVE_OR_WARCHIVE_DECL(bool)
+BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
 archive_serializer_map<Archive>::insert(const basic_serializer * bs){
     return boost::serialization::singleton<
-        extra_detail::map<Archive>
+        map<Archive>
     >::get_mutable_instance().insert(bs);
 }
 
@@ -48,11 +39,11 @@
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
 archive_serializer_map<Archive>::erase(const basic_serializer * bs){
     if(boost::serialization::singleton<
-        extra_detail::map<Archive>
+        map<Archive>
     >::is_destroyed())
         return;
     boost::serialization::singleton<
-        extra_detail::map<Archive>
+        map<Archive>
     >::get_mutable_instance().erase(bs);
 }
 
@@ -62,7 +53,7 @@
     const boost::serialization::extended_type_info & eti
 ) {
     return boost::serialization::singleton<
-        extra_detail::map<Archive>
+        map<Archive>
     >::get_const_instance().find(eti);
 }
 
diff --git a/boost/archive/impl/basic_binary_iarchive.ipp b/boost/archive/impl/basic_binary_iarchive.ipp
index 8ea39f7..230fb92 100644
--- a/boost/archive/impl/basic_binary_iarchive.ipp
+++ b/boost/archive/impl/basic_binary_iarchive.ipp
@@ -8,7 +8,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 #include <string>
-#include <boost/assert.hpp>
+#include <cassert>
 #include <algorithm>
 #include <cstring>
 
@@ -16,13 +16,10 @@
 #if defined(BOOST_NO_STDC_NAMESPACE)
 namespace std{ 
     using ::memcpy; 
-    using ::strlen;
-    using ::size_t;
 }
 #endif
 
 #include <boost/detail/workaround.hpp>
-#include <boost/detail/endian.hpp>
 
 #include <boost/archive/basic_binary_iarchive.hpp>
 
@@ -51,24 +48,7 @@
 basic_binary_iarchive<Archive>::init(){
     // read signature in an archive version independent manner
     std::string file_signature;
-    try {
-        std::size_t l;
-        this->This()->load(l);
-        if(l == std::strlen(BOOST_ARCHIVE_SIGNATURE())) {
-            // borland de-allocator fixup
-            #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
-            if(NULL != file_signature.data())
-            #endif
-                file_signature.resize(l);
-            // note breaking a rule here - could be a problem on some platform
-            if(0 < l)
-                this->This()->load_binary(&(*file_signature.begin()), l);
-        }
-    }
-    catch(archive_exception const &) {  // catch stream_error archive exceptions
-        // will cause invalid_signature archive exception to be thrown below
-        file_signature = "";   
-    }
+    * this->This() >> file_signature;
     if(file_signature != BOOST_ARCHIVE_SIGNATURE())
         boost::serialization::throw_exception(
             archive_exception(archive_exception::invalid_signature)
@@ -76,39 +56,8 @@
 
     // make sure the version of the reading archive library can
     // support the format of the archive being read
-    library_version_type input_library_version;
-    //* this->This() >> input_library_version;
-    {
-        int v = 0;
-        v = this->This()->m_sb.sbumpc();
-        #if defined(BOOST_LITTLE_ENDIAN)
-        if(v < 6){
-            ;
-        }
-        else
-        if(v < 7){
-            // version 6 - next byte should be zero
-            this->This()->m_sb.sbumpc();
-        }
-        else
-        if(v < 8){
-            int x1;
-            // version 7 = might be followed by zero or some other byte
-            x1 = this->This()->m_sb.sgetc();
-            // it's =a zero, push it back
-            if(0 == x1)
-                this->This()->m_sb.sbumpc();
-        }
-        else{
-            // version 8+ followed by a zero
-            this->This()->m_sb.sbumpc();
-        }
-        #elif defined(BOOST_BIG_ENDIAN)
-        if(v == 0)
-            v = this->This()->m_sb.sbumpc();
-        #endif
-        input_library_version = static_cast<library_version_type>(v);
-    }
+    version_type input_library_version;
+    * this->This() >> input_library_version;
     
     #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
     this->set_library_version(input_library_version);
@@ -119,7 +68,8 @@
     basic_iarchive::set_library_version(input_library_version);
     #endif
     
-    if(BOOST_ARCHIVE_VERSION() < input_library_version)
+    // extra little .t is to get around borland quirk
+    if(BOOST_ARCHIVE_VERSION() < input_library_version.t)
         boost::serialization::throw_exception(
             archive_exception(archive_exception::unsupported_version)
         );
diff --git a/boost/archive/impl/basic_binary_iprimitive.ipp b/boost/archive/impl/basic_binary_iprimitive.ipp
index e0f5c2e..8007d80 100644
--- a/boost/archive/impl/basic_binary_iprimitive.ipp
+++ b/boost/archive/impl/basic_binary_iprimitive.ipp
@@ -8,7 +8,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <cstddef> // size_t, NULL
 #include <cstring> // memcpy
 
@@ -46,34 +46,22 @@
     this->This()->load(size);
     if(sizeof(int) != size)
         boost::serialization::throw_exception(
-            archive_exception(
-                archive_exception::incompatible_native_format,
-                "size of int"
-            )
+            archive_exception(archive_exception::incompatible_native_format)
         );
     this->This()->load(size);
     if(sizeof(long) != size)
         boost::serialization::throw_exception(
-            archive_exception(
-                archive_exception::incompatible_native_format,
-                "size of long"
-            )
+            archive_exception(archive_exception::incompatible_native_format)
         );
     this->This()->load(size);
     if(sizeof(float) != size)
         boost::serialization::throw_exception(
-            archive_exception(
-                archive_exception::incompatible_native_format,
-                "size of float"
-            )
+            archive_exception(archive_exception::incompatible_native_format)
         );
     this->This()->load(size);
     if(sizeof(double) != size)
         boost::serialization::throw_exception(
-            archive_exception(
-                archive_exception::incompatible_native_format,
-                "size of double"
-            )
+            archive_exception(archive_exception::incompatible_native_format)
         );
 
     // for checking endian
@@ -81,10 +69,7 @@
     this->This()->load(i);
     if(1 != i)
         boost::serialization::throw_exception(
-            archive_exception(
-                archive_exception::incompatible_native_format,
-                "endian setting"
-            )
+            archive_exception(archive_exception::incompatible_native_format)
         );
 }
 
@@ -92,10 +77,10 @@
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
 basic_binary_iprimitive<Archive, Elem, Tr>::load(wchar_t * ws)
 {
-    std::size_t l; // number of wchar_t !!!
+    std::size_t l;
     this->This()->load(l);
     load_binary(ws, l * sizeof(wchar_t) / sizeof(char));
-    ws[l] = L'\0';
+    ws[l / sizeof(wchar_t)] = L'\0';
 }
 
 template<class Archive, class Elem, class Tr>
diff --git a/boost/archive/impl/basic_binary_oarchive.ipp b/boost/archive/impl/basic_binary_oarchive.ipp
index dec2cd7..4a8301e 100644
--- a/boost/archive/impl/basic_binary_oarchive.ipp
+++ b/boost/archive/impl/basic_binary_oarchive.ipp
@@ -8,7 +8,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 #include <string>
-#include <boost/assert.hpp>
+#include <cassert>
 #include <algorithm>
 #include <cstring>
 
@@ -38,7 +38,7 @@
     const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
     * this->This() << file_signature;
     // write library version
-    const library_version_type v(BOOST_ARCHIVE_VERSION());
+    const version_type v(BOOST_ARCHIVE_VERSION());
     * this->This() << v;
 }
 
diff --git a/boost/archive/impl/basic_binary_oprimitive.ipp b/boost/archive/impl/basic_binary_oprimitive.ipp
index 02b5ffa..1b25c22 100644
--- a/boost/archive/impl/basic_binary_oprimitive.ipp
+++ b/boost/archive/impl/basic_binary_oprimitive.ipp
@@ -20,6 +20,7 @@
 } // namespace std
 #endif
 
+
 #ifndef BOOST_NO_CWCHAR
 #include <cwchar>
 #ifdef BOOST_NO_STDC_NAMESPACE
@@ -29,6 +30,9 @@
 
 #include <boost/detail/workaround.hpp>
 
+#include <boost/serialization/throw_exception.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/archive/archive_exception.hpp>
 #include <boost/archive/add_facet.hpp>
 #include <boost/archive/codecvt_null.hpp>
 
@@ -81,7 +85,6 @@
     this->This()->save(l);
     save_binary(ws, l * sizeof(wchar_t) / sizeof(char));
 }
-#endif
 
 #ifndef BOOST_NO_STD_WSTRING
 template<class Archive, class Elem, class Tr>
@@ -93,6 +96,7 @@
     save_binary(ws.data(), l * sizeof(wchar_t) / sizeof(char));
 }
 #endif
+#endif
 
 template<class Archive, class Elem, class Tr>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
diff --git a/boost/archive/impl/basic_text_iarchive.ipp b/boost/archive/impl/basic_text_iarchive.ipp
index 0a246b7..6d9b8c7 100644
--- a/boost/archive/impl/basic_text_iarchive.ipp
+++ b/boost/archive/impl/basic_text_iarchive.ipp
@@ -19,7 +19,7 @@
 #endif
 
 #include <boost/detail/workaround.hpp>
-#include <boost/serialization/string.hpp>
+
 #include <boost/archive/basic_text_iarchive.hpp>
 
 namespace boost {
@@ -27,7 +27,6 @@
 
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // implementation of text_text_archive
-
 template<class Archive>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
 basic_text_iarchive<Archive>::load_override(class_name_type & t, int){
@@ -56,7 +55,7 @@
 
     // make sure the version of the reading archive library can
     // support the format of the archive being read
-    library_version_type input_library_version;
+    version_type input_library_version;
     * this->This() >> input_library_version;
 
     #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
@@ -65,11 +64,11 @@
     #if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
     detail::
     #endif
-    basic_iarchive::set_library_version(input_library_version);
+    basic_iarchive::set_library_version(input_library_version.t);
     #endif
 
     // extra little .t is to get around borland quirk
-    if(BOOST_ARCHIVE_VERSION() < input_library_version)
+    if(BOOST_ARCHIVE_VERSION() < input_library_version.t)
         boost::serialization::throw_exception(
             archive_exception(archive_exception::unsupported_version)
         );
diff --git a/boost/archive/impl/basic_text_iprimitive.ipp b/boost/archive/impl/basic_text_iprimitive.ipp
index ad6a6d5..c64502d 100644
--- a/boost/archive/impl/basic_text_iprimitive.ipp
+++ b/boost/archive/impl/basic_text_iprimitive.ipp
@@ -39,13 +39,13 @@
 
     template<>
     bool is_whitespace(char t){
-        return 0 != std::isspace(t);
+        return std::isspace(t);
     }
 
     #ifndef BOOST_NO_CWCHAR
     template<>
     bool is_whitespace(wchar_t t){
-        return 0 != std::iswspace(t);
+        return std::iswspace(t);
     }
     #endif
 }
@@ -63,14 +63,14 @@
     if(0 == count)
         return;
         
-    BOOST_ASSERT(
+    assert(
         static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)())
         > (count + sizeof(CharType) - 1)/sizeof(CharType)
     );
         
     if(is.fail())
         boost::serialization::throw_exception(
-            archive_exception(archive_exception::input_stream_error)
+            archive_exception(archive_exception::stream_error)
         );
     // convert from base64 to binary
     typedef BOOST_DEDUCED_TYPENAME
@@ -104,11 +104,11 @@
     
     iterators::istream_iterator<CharType> i;
     for(;;){
-        BOOST_DEDUCED_TYPENAME IStream::int_type r;
-        r = is.get();
+        CharType c;
+        c = is.get();
         if(is.eof())
             break;
-        if(is_whitespace(static_cast<CharType>(r)))
+        if(is_whitespace(c))
             break;
     }
 }
@@ -124,7 +124,7 @@
     flags_saver(is_),
     precision_saver(is_),
     archive_locale(NULL),
-    locale_saver(* is_.rdbuf())
+    locale_saver(is_)
 {
     if(! no_codecvt){
         archive_locale.reset(
diff --git a/boost/archive/impl/basic_text_oarchive.ipp b/boost/archive/impl/basic_text_oarchive.ipp
index 34e6995..3b7c7b0 100644
--- a/boost/archive/impl/basic_text_oarchive.ipp
+++ b/boost/archive/impl/basic_text_oarchive.ipp
@@ -8,7 +8,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 #include <string>
-#include <boost/assert.hpp>
+#include <cassert>
 #include <cstring>
 
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
@@ -32,7 +32,7 @@
 {
     switch(delimiter){
     default:
-        BOOST_ASSERT(false);
+        assert(false);
         break;
     case eol:
         this->This()->put('\n');
@@ -54,7 +54,7 @@
     const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
     * this->This() << file_signature;
     // write library version
-    const library_version_type v(BOOST_ARCHIVE_VERSION());
+    const version_type v(BOOST_ARCHIVE_VERSION());
     * this->This() << v;
 }
 
diff --git a/boost/archive/impl/basic_text_oprimitive.ipp b/boost/archive/impl/basic_text_oprimitive.ipp
index cacab61..702663a 100644
--- a/boost/archive/impl/basic_text_oprimitive.ipp
+++ b/boost/archive/impl/basic_text_oprimitive.ipp
@@ -37,7 +37,7 @@
     
     if(os.fail())
         boost::serialization::throw_exception(
-            archive_exception(archive_exception::output_stream_error)
+            archive_exception(archive_exception::stream_error)
         );
         
     os.put('\n');
@@ -84,7 +84,7 @@
     flags_saver(os_),
     precision_saver(os_),
     archive_locale(NULL),
-    locale_saver(* os_.rdbuf())
+    locale_saver(os_)
 {
     if(! no_codecvt){
         archive_locale.reset(
diff --git a/boost/archive/impl/basic_xml_grammar.hpp b/boost/archive/impl/basic_xml_grammar.hpp
index 807ed07..768009c 100644
--- a/boost/archive/impl/basic_xml_grammar.hpp
+++ b/boost/archive/impl/basic_xml_grammar.hpp
@@ -55,8 +55,26 @@
 #  pragma warning (disable : 4786) // too long name, harmless warning
 #endif
 
-#include <boost/spirit/include/classic_rule.hpp>
+//#define BOOST_SPIRIT_DEBUG
+#include <boost/spirit/core/non_terminal/rule.hpp>
+
+// the following hack is to evade a bogus error generated by using the
+// word "arg" when bind.hpp has been included
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+#define arg xarg
+#endif
+
+// spirit stuff
+#if (defined __BORLANDC__) && (__BORLANDC__ < 0x593) \
+    || (defined _MSC_VER) && (_MSC_VER <= 1300) 
+#include <boost/spirit/utility/chset.hpp>
+#else
 #include <boost/spirit/include/classic_chset.hpp>
+#endif
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+#undef arg
+#endif
 
 #include <boost/archive/basic_archive.hpp>
 #include <boost/serialization/tracking.hpp>
@@ -79,12 +97,12 @@
 private:
     typedef BOOST_DEDUCED_TYPENAME std::basic_istream<CharType> IStream;
     typedef BOOST_DEDUCED_TYPENAME std::basic_string<CharType> StringType;
-    typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::chset<CharType> chset_t;
-    typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::chlit<CharType> chlit_t;
-    typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::scanner<
+    typedef BOOST_DEDUCED_TYPENAME boost::spirit::chset<CharType> chset_t;
+    typedef BOOST_DEDUCED_TYPENAME boost::spirit::chlit<CharType> chlit_t;
+    typedef BOOST_DEDUCED_TYPENAME boost::spirit::scanner<
         BOOST_DEDUCED_TYPENAME  std::basic_string<CharType>::iterator
     > scanner_t;
-    typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::rule<scanner_t> rule_t;
+    typedef BOOST_DEDUCED_TYPENAME boost::spirit::rule<scanner_t> rule_t;
     // Start grammar definition
     rule_t    
         Reference,
@@ -151,12 +169,9 @@
     struct return_values {
         StringType object_name;
         StringType contents;
-        //class_id_type class_id;
-        int_least16_t class_id;
-        //object_id_type object_id;
-        uint_least32_t object_id;
-        //version_type version;
-        unsigned int version;
+        class_id_type class_id;
+        object_id_type object_id;
+        version_type version;
         tracking_type tracking_level;
         StringType class_name;
         return_values() :
diff --git a/boost/archive/impl/basic_xml_iarchive.ipp b/boost/archive/impl/basic_xml_iarchive.ipp
index 52dfde1..c640b52 100644
--- a/boost/archive/impl/basic_xml_iarchive.ipp
+++ b/boost/archive/impl/basic_xml_iarchive.ipp
@@ -8,12 +8,12 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <cstddef> // NULL
 #include <algorithm>
 
 #include <boost/serialization/throw_exception.hpp>
-#include <boost/archive/xml_archive_exception.hpp>
+
 #include <boost/archive/basic_xml_iarchive.hpp>
 #include <boost/serialization/tracking.hpp>
 
@@ -32,7 +32,7 @@
     bool result = this->This()->gimpl->parse_start_tag(this->This()->get_is());
     if(true != result){
         boost::serialization::throw_exception(
-            archive_exception(archive_exception::input_stream_error)
+            archive_exception(archive_exception::stream_error)
         );
     }
     // don't check start tag at highest level
@@ -49,7 +49,7 @@
     bool result = this->This()->gimpl->parse_end_tag(this->This()->get_is());
     if(true != result){
         boost::serialization::throw_exception(
-            archive_exception(archive_exception::input_stream_error)
+            archive_exception(archive_exception::stream_error)
         );
     }
     
@@ -67,10 +67,7 @@
             )
         ){
             boost::serialization::throw_exception(
-                xml_archive_exception(
-                    xml_archive_exception::xml_archive_tag_mismatch,
-                    name
-                )
+                archive_exception(archive_exception::stream_error)
             );
         }
     }
@@ -79,19 +76,19 @@
 template<class Archive>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
 basic_xml_iarchive<Archive>::load_override(object_id_type & t, int){
-    t = object_id_type(this->This()->gimpl->rv.object_id);
+    t = this->This()->gimpl->rv.object_id;
 }
 
 template<class Archive>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
 basic_xml_iarchive<Archive>::load_override(version_type & t, int){
-    t = version_type(this->This()->gimpl->rv.version);
+    t = this->This()->gimpl->rv.version;
 }
 
 template<class Archive>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
 basic_xml_iarchive<Archive>::load_override(class_id_type & t, int){
-    t = class_id_type(this->This()->gimpl->rv.class_id);
+    t = this->This()->gimpl->rv.class_id;
 }
 
 template<class Archive>
diff --git a/boost/archive/impl/basic_xml_oarchive.ipp b/boost/archive/impl/basic_xml_oarchive.ipp
index e2cc8d4..518d8a7 100644
--- a/boost/archive/impl/basic_xml_oarchive.ipp
+++ b/boost/archive/impl/basic_xml_oarchive.ipp
@@ -168,7 +168,7 @@
 basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
 {
     int i = t.t; // extra .t is for borland
-    write_attribute(BOOST_ARCHIVE_XML_VERSION(), i);
+    write_attribute(VBOOST_ARCHIVE_XML_ERSION(), i);
 }
 #endif
 
diff --git a/boost/archive/impl/xml_iarchive_impl.ipp b/boost/archive/impl/xml_iarchive_impl.ipp
index c7cbc7f..21d006e 100644
--- a/boost/archive/impl/xml_iarchive_impl.ipp
+++ b/boost/archive/impl/xml_iarchive_impl.ipp
@@ -112,7 +112,7 @@
     }
     *ws = L'\0';
 }
-#endif // BOOST_NO_INTRINSIC_WCHAR_T
+#endif
 
 #endif // BOOST_NO_CWCHAR
 
@@ -156,9 +156,7 @@
 BOOST_ARCHIVE_DECL(void)
 xml_iarchive_impl<Archive>::init(){
     gimpl->init(is);
-    this->set_library_version(
-        library_version_type(gimpl->rv.version)
-    );
+    this->set_library_version(gimpl->rv.version);
 }
 
 template<class Archive>
diff --git a/boost/archive/impl/xml_wiarchive_impl.ipp b/boost/archive/impl/xml_wiarchive_impl.ipp
index 9dde66c..3df68d9 100644
--- a/boost/archive/impl/xml_wiarchive_impl.ipp
+++ b/boost/archive/impl/xml_wiarchive_impl.ipp
@@ -20,7 +20,7 @@
 #include <boost/config.hpp> // msvc 6.0 needs this to suppress warnings
 #ifndef BOOST_NO_STD_WSTREAMBUF
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <algorithm>
 
 #include <boost/detail/workaround.hpp> // Dinkumware and RogueWave
@@ -146,9 +146,7 @@
 BOOST_WARCHIVE_DECL(void)
 xml_wiarchive_impl<Archive>::init(){
     gimpl->init(is);
-    this->set_library_version(
-        library_version_type(gimpl->rv.version)
-    );
+    this->set_library_version(gimpl->rv.version);
 }
 
 template<class Archive>
diff --git a/boost/archive/iterators/base64_exception.hpp b/boost/archive/iterators/base64_exception.hpp
index 81ad28e..eb2d2e1 100644
--- a/boost/archive/iterators/base64_exception.hpp
+++ b/boost/archive/iterators/base64_exception.hpp
@@ -20,7 +20,7 @@
 #ifndef BOOST_NO_EXCEPTIONS
 #include <exception>
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 namespace boost {
 namespace archive {
@@ -53,7 +53,7 @@
             msg = "attempt to decode a value not in base64 char set";
             break;
         default:
-            BOOST_ASSERT(false);
+            assert(false);
             break;
         }
         return msg;
diff --git a/boost/archive/iterators/base64_from_binary.hpp b/boost/archive/iterators/base64_from_binary.hpp
index ecb916a..a46137d 100644
--- a/boost/archive/iterators/base64_from_binary.hpp
+++ b/boost/archive/iterators/base64_from_binary.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 #include <cstddef> // size_t
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
@@ -49,7 +49,7 @@
             "abcdefghijklmnopqrstuvwxyz"
             "0123456789"
             "+/";
-        BOOST_ASSERT(t < 64);
+        assert(t < 64);
         return lookup_table[static_cast<size_t>(t)];
     }
 };
@@ -91,7 +91,7 @@
     template<class T>
     base64_from_binary(BOOST_PFTO_WRAPPER(T) start) :
         super_t(
-            Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))),
+            Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))),
             detail::from_6_bit<CharType>()
         )
     {}
diff --git a/boost/archive/iterators/binary_from_base64.hpp b/boost/archive/iterators/binary_from_base64.hpp
index 47e9d0b..b75e0b1 100644
--- a/boost/archive/iterators/binary_from_base64.hpp
+++ b/boost/archive/iterators/binary_from_base64.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
 #include <boost/serialization/throw_exception.hpp>
@@ -99,7 +99,7 @@
     template<class T>
     binary_from_base64(BOOST_PFTO_WRAPPER(T)  start) :
         super_t(
-            Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))), 
+            Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))), 
             detail::to_6_bit<CharType>()
         )
     {}
diff --git a/boost/archive/iterators/dataflow.hpp b/boost/archive/iterators/dataflow.hpp
index 1623b67..7958482 100644
--- a/boost/archive/iterators/dataflow.hpp
+++ b/boost/archive/iterators/dataflow.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
 
@@ -47,7 +47,7 @@
     } m_state;
     // convert to bool
     operator bool (){
-        BOOST_ASSERT(is_indeterminant != m_state);
+        assert(is_indeterminant != m_state);
         return is_true == m_state ? true : false;
     }
     // assign from bool
diff --git a/boost/archive/iterators/dataflow_exception.hpp b/boost/archive/iterators/dataflow_exception.hpp
index 1d655a1..765661e 100644
--- a/boost/archive/iterators/dataflow_exception.hpp
+++ b/boost/archive/iterators/dataflow_exception.hpp
@@ -21,7 +21,7 @@
 #include <exception>
 #endif //BOOST_NO_EXCEPTIONS
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 namespace boost {
 namespace archive {
@@ -66,7 +66,7 @@
             msg = "invalid multbyte/wide char conversion";
             break;
         default:
-            BOOST_ASSERT(false);
+            assert(false);
             break;
         }
         return msg;
diff --git a/boost/archive/iterators/escape.hpp b/boost/archive/iterators/escape.hpp
index bb527d4..3fe64fa 100644
--- a/boost/archive/iterators/escape.hpp
+++ b/boost/archive/iterators/escape.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <cstddef> // NULL
 
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
@@ -97,7 +97,7 @@
     const base_value_type *m_bnext;
     const base_value_type *m_bend;
     bool m_full;
-    base_value_type m_current_value;
+    BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type m_current_value;
 public:
     escape(Base base) : 
         super_t(base),
diff --git a/boost/archive/iterators/head_iterator.hpp b/boost/archive/iterators/head_iterator.hpp
index 7d39a35..279b202 100644
--- a/boost/archive/iterators/head_iterator.hpp
+++ b/boost/archive/iterators/head_iterator.hpp
@@ -16,6 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
+#include <boost/type_traits/is_same.hpp>
 #include <boost/iterator/iterator_adaptor.hpp>
 #include <boost/iterator/iterator_traits.hpp>
 
diff --git a/boost/archive/iterators/insert_linebreaks.hpp b/boost/archive/iterators/insert_linebreaks.hpp
index 5f826ca..feb8c5b 100644
--- a/boost/archive/iterators/insert_linebreaks.hpp
+++ b/boost/archive/iterators/insert_linebreaks.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
 #if defined(BOOST_NO_STDC_NAMESPACE)
@@ -84,7 +84,7 @@
     // make composible buy using templated constructor
     template<class T>
     insert_linebreaks(BOOST_PFTO_WRAPPER(T)  start) :
-        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
+        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start)))),
         m_count(0)
     {}
     // intel 7.1 doesn't like default copy constructor
diff --git a/boost/archive/iterators/istream_iterator.hpp b/boost/archive/iterators/istream_iterator.hpp
index 1df612d..ac3568a 100644
--- a/boost/archive/iterators/istream_iterator.hpp
+++ b/boost/archive/iterators/istream_iterator.hpp
@@ -61,7 +61,7 @@
 
     void increment(){
         if(NULL != m_istream){
-            m_current_value = static_cast<Elem>(m_istream->get());
+            m_current_value = m_istream->get();
             if(! m_istream->good()){
                 const_cast<this_t *>(this)->m_istream = NULL;
             }
diff --git a/boost/archive/iterators/mb_from_wchar.hpp b/boost/archive/iterators/mb_from_wchar.hpp
index d8f8a12..22ee950 100644
--- a/boost/archive/iterators/mb_from_wchar.hpp
+++ b/boost/archive/iterators/mb_from_wchar.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <cstddef> // size_t
 #include <cstdlib> // for wctomb()
 
@@ -90,9 +90,9 @@
         #else
         m_bend = std::wctomb(m_buffer, value);
         #endif
-        BOOST_ASSERT(-1 != m_bend);
-        BOOST_ASSERT((std::size_t)m_bend <= sizeof(m_buffer));
-        BOOST_ASSERT(m_bend > 0);
+        assert(-1 != m_bend);
+        assert((std::size_t)m_bend <= sizeof(m_buffer));
+        assert(m_bend > 0);
         m_bnext = 0;
     }
 
@@ -115,7 +115,7 @@
     // make composible buy using templated constructor
     template<class T>
     mb_from_wchar(BOOST_PFTO_WRAPPER(T) start) :
-        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
+        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start)))),
         m_bend(0),
         m_bnext(0),
         m_full(false)
diff --git a/boost/archive/iterators/remove_whitespace.hpp b/boost/archive/iterators/remove_whitespace.hpp
index a8e1092..c5e581d 100644
--- a/boost/archive/iterators/remove_whitespace.hpp
+++ b/boost/archive/iterators/remove_whitespace.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
 
@@ -154,7 +154,7 @@
     // make composible buy using templated constructor
     template<class T>
     remove_whitespace(BOOST_PFTO_WRAPPER(T) start) :
-        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))))
+        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))))
     {}
     // intel 7.1 doesn't like default copy constructor
     remove_whitespace(const remove_whitespace & rhs) : 
diff --git a/boost/archive/iterators/transform_width.hpp b/boost/archive/iterators/transform_width.hpp
index 6e2c526..c2e9bee 100644
--- a/boost/archive/iterators/transform_width.hpp
+++ b/boost/archive/iterators/transform_width.hpp
@@ -24,8 +24,6 @@
 // character and 8 bit bytes. Lowest common multiple is 24 => 4 6 bit characters
 // or 3 8 bit characters
 
-#include <algorithm>
-
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME & PTFO
 #include <boost/serialization/pfto.hpp>
 
@@ -115,7 +113,7 @@
     // make composible buy using templated constructor
     template<class T>
     transform_width(BOOST_PFTO_WRAPPER(T) start) : 
-        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
+        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start)))),
         m_displacement(0),
         m_full(false),
         m_bufferfull(false)
diff --git a/boost/archive/iterators/unescape.hpp b/boost/archive/iterators/unescape.hpp
index 9cbd316..e709138 100644
--- a/boost/archive/iterators/unescape.hpp
+++ b/boost/archive/iterators/unescape.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
 #include <boost/iterator/iterator_adaptor.hpp>
@@ -50,11 +50,13 @@
     > super_t;
 
     typedef unescape<Derived, Base> this_t;
+    typedef BOOST_DEDUCED_TYPENAME super_t::reference reference_type;
 public:
-    typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type;
-    typedef BOOST_DEDUCED_TYPENAME this_t::reference reference;
+    // gcc 3.4.1 - linux required that this be public
+    typedef BOOST_DEDUCED_TYPENAME super_t::value_type value_type;
 private:
-    value_type dereference_impl() {
+
+    reference_type dereference_impl() {
         if(! m_full){
             m_current_value = static_cast<Derived *>(this)->drain();
             m_full = true;
@@ -62,10 +64,11 @@
         return m_current_value;
     }
 
-    reference dereference() const {
+    reference_type dereference() const {
         return const_cast<this_t *>(this)->dereference_impl();
     }
 
+    // value_type is const char - can't be const fix later
     value_type m_current_value;
     bool m_full;
 
diff --git a/boost/archive/iterators/wchar_from_mb.hpp b/boost/archive/iterators/wchar_from_mb.hpp
index 4da8121..18f0622 100644
--- a/boost/archive/iterators/wchar_from_mb.hpp
+++ b/boost/archive/iterators/wchar_from_mb.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 #include <cctype>
 #include <cstddef> // size_t
 #include <cstdlib> // mblen
@@ -90,7 +90,7 @@
     // make composible buy using templated constructor
     template<class T>
     wchar_from_mb(BOOST_PFTO_WRAPPER(T) start) : 
-        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
+        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start)))),
         m_full(false)
     {}
     // intel 7.1 doesn't like default copy constructor
diff --git a/boost/archive/iterators/xml_escape.hpp b/boost/archive/iterators/xml_escape.hpp
index eadb96e..8eb87f4 100644
--- a/boost/archive/iterators/xml_escape.hpp
+++ b/boost/archive/iterators/xml_escape.hpp
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
 #include <boost/serialization/pfto.hpp>
@@ -44,7 +44,7 @@
 
     template<class T>
     xml_escape(BOOST_PFTO_WRAPPER(T) start) :
-        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))))
+        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))))
     {}
     // intel 7.1 doesn't like default copy constructor
     xml_escape(const xml_escape & rhs) : 
diff --git a/boost/archive/iterators/xml_unescape.hpp b/boost/archive/iterators/xml_unescape.hpp
index 3295adb..4272c97 100644
--- a/boost/archive/iterators/xml_unescape.hpp
+++ b/boost/archive/iterators/xml_unescape.hpp
@@ -16,10 +16,9 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
-
 #include <boost/serialization/throw_exception.hpp>
 #include <boost/serialization/pfto.hpp>
 
@@ -45,19 +44,12 @@
         return unescape<xml_unescape<Base>, Base>::dereference();
     }
 public:
-    // workaround msvc 7.1 ICU crash
-    #if defined(BOOST_MSVC)
-        typedef int value_type;
-    #else
-        typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type;
-    #endif
-
     void drain_residue(const char *literal);
-    value_type drain();
+    int drain();
 
     template<class T>
     xml_unescape(BOOST_PFTO_WRAPPER(T) start) : 
-        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))))
+        super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))))
     {}
     // intel 7.1 doesn't like default copy constructor
     xml_unescape(const xml_unescape & rhs) : 
@@ -83,10 +75,8 @@
 // iterator refenence which would make subsequent iterator comparisons
 // incorrect and thereby break the composiblity of iterators.
 template<class Base>
-BOOST_DEDUCED_TYPENAME xml_unescape<Base>::value_type 
-//int 
-xml_unescape<Base>::drain(){
-    value_type retval = * this->base_reference();
+int xml_unescape<Base>::drain(){
+    int retval = * this->base_reference();
     if('&' != retval){
         return retval;
     }
diff --git a/boost/archive/iterators/xml_unescape_exception.hpp b/boost/archive/iterators/xml_unescape_exception.hpp
index 259d2ba..a141737 100644
--- a/boost/archive/iterators/xml_unescape_exception.hpp
+++ b/boost/archive/iterators/xml_unescape_exception.hpp
@@ -20,7 +20,7 @@
 #ifndef BOOST_NO_EXCEPTIONS
 #include <exception>
 
-#include <boost/assert.hpp>
+#include <cassert>
 
 namespace boost {
 namespace archive {
diff --git a/boost/archive/polymorphic_binary_iarchive.hpp b/boost/archive/polymorphic_binary_iarchive.hpp
index ce7e3b0..c14ad5a 100644
--- a/boost/archive/polymorphic_binary_iarchive.hpp
+++ b/boost/archive/polymorphic_binary_iarchive.hpp
@@ -20,11 +20,6 @@
 #include <boost/archive/binary_iarchive.hpp>
 #include <boost/archive/detail/polymorphic_iarchive_route.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -41,10 +36,6 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(
     boost::archive::polymorphic_binary_iarchive
diff --git a/boost/archive/polymorphic_iarchive.hpp b/boost/archive/polymorphic_iarchive.hpp
index 2f76cf2..50e57fe 100644
--- a/boost/archive/polymorphic_iarchive.hpp
+++ b/boost/archive/polymorphic_iarchive.hpp
@@ -18,15 +18,15 @@
 
 #include <cstddef> // std::size_t
 #include <climits> // ULONG_MAX 
-#include <string>
-
 #include <boost/config.hpp>
+
 #if defined(BOOST_NO_STDC_NAMESPACE)
 namespace std{
     using ::size_t;
 } // namespace std
 #endif
 
+#include <string>
 #include <boost/cstdint.hpp>
 
 #include <boost/serialization/pfto.hpp>
@@ -38,6 +38,26 @@
 #include <boost/archive/detail/decl.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
+// determine if its necessary to handle (u)int64_t specifically
+// i.e. that its not a synonym for (unsigned) long
+// if there is no 64 bit int or if its the same as a long
+// we shouldn't define separate functions for int64 data types.
+#if defined(BOOST_NO_INT64_T)
+    #define BOOST_NO_INTRINSIC_INT64_T
+#else 
+    #if defined(ULLONG_MAX)  
+        #if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1  
+            #define BOOST_NO_INTRINSIC_INT64_T  
+        #endif  
+    #elif defined(ULONG_MAX)  
+        #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1  
+            #define BOOST_NO_INTRINSIC_INT64_T  
+        #endif  
+    #else   
+        #define BOOST_NO_INTRINSIC_INT64_T  
+    #endif  
+#endif
+
 namespace boost {
 template<class T>
 class shared_ptr;
@@ -79,14 +99,10 @@
     virtual void load(long & t) = 0;
     virtual void load(unsigned long & t) = 0;
 
-    #if defined(BOOST_HAS_LONG_LONG)
-    virtual void load(boost::long_long_type & t) = 0;
-    virtual void load(boost::ulong_long_type & t) = 0;
-    #elif defined(BOOST_HAS_MS_INT64)
-    virtual void load(__int64 & t) = 0;
-    virtual void load(unsigned __int64 & t) = 0;
+    #if !defined(BOOST_NO_INTRINSIC_INT64_T)
+    virtual void load(boost::int64_t & t) = 0;
+    virtual void load(boost::uint64_t & t) = 0;
     #endif
-
     virtual void load(float & t) = 0;
     virtual void load(double & t) = 0;
 
@@ -111,12 +127,12 @@
     // special treatment for name-value pairs.
     template<class T>
     void load_override(
-        #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
-        const
-        #endif
-        boost::serialization::nvp< T > & t,
-        int
-    ){
+                #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+                const
+                #endif
+                boost::serialization::nvp<T> & t,
+                int
+        ){
         load_start(t.name());
         archive::load(* this->This(), t.value());
         load_end(t.name());
@@ -125,8 +141,8 @@
     virtual ~polymorphic_iarchive_impl(){};
 public:
     // utility function implemented by all legal archives
-    virtual void set_library_version(library_version_type archive_library_version) = 0;
-    virtual library_version_type get_library_version() const = 0;
+    virtual void set_library_version(unsigned int archive_library_version) = 0;
+    virtual unsigned int get_library_version() const = 0;
     virtual unsigned int get_flags() const = 0;
     virtual void delete_created_pointers() = 0;
     virtual void reset_object_address(
@@ -143,18 +159,13 @@
     ) = 0;
     virtual const detail::basic_pointer_iserializer * load_pointer(
         void * & t,
-        const detail::basic_pointer_iserializer * bpis_ptr,
-        const detail::basic_pointer_iserializer * (*finder)(
-            const boost::serialization::extended_type_info & type
-        )
+        const detail::basic_pointer_iserializer * bpis_ptr
     ) = 0;
 };
 
 } // namespace archive
 } // namespace boost
 
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive.  We created a "mix-in"
 // class to provide this functionality.  Since shared_ptr holds a
@@ -178,4 +189,6 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::polymorphic_iarchive)
 
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
 #endif // BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP
diff --git a/boost/archive/polymorphic_oarchive.hpp b/boost/archive/polymorphic_oarchive.hpp
index 420029b..19aedf5 100644
--- a/boost/archive/polymorphic_oarchive.hpp
+++ b/boost/archive/polymorphic_oarchive.hpp
@@ -37,6 +37,26 @@
 #include <boost/archive/detail/decl.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
+// determine if its necessary to handle (u)int64_t specifically
+// i.e. that its not a synonym for (unsigned) long
+// if there is no 64 bit int or if its the same as a long
+// we shouldn't define separate functions for int64 data types.
+#if defined(BOOST_NO_INT64_T)
+    #define BOOST_NO_INTRINSIC_INT64_T
+#else 
+    #if defined(ULLONG_MAX)  
+        #if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1  
+            #define BOOST_NO_INTRINSIC_INT64_T  
+        #endif  
+    #elif defined(ULONG_MAX)  
+        #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1  
+            #define BOOST_NO_INTRINSIC_INT64_T  
+        #endif  
+    #else   
+        #define BOOST_NO_INTRINSIC_INT64_T  
+    #endif  
+#endif
+
 namespace boost {
 template<class T>
 class shared_ptr;
@@ -77,15 +97,10 @@
     virtual void save(const unsigned int t) = 0;
     virtual void save(const long t) = 0;
     virtual void save(const unsigned long t) = 0;
-
-    #if defined(BOOST_HAS_LONG_LONG)
-    virtual void save(const boost::long_long_type t) = 0;
-    virtual void save(const boost::ulong_long_type t) = 0;
-    #elif defined(BOOST_HAS_MS_INT64)
-    virtual void save(const __int64 t) = 0;
-    virtual void save(const unsigned __int64 t) = 0;
+    #if !defined(BOOST_NO_INTRINSIC_INT64_T)
+    virtual void save(const boost::int64_t t) = 0;
+    virtual void save(const boost::uint64_t t) = 0;
     #endif
-
     virtual void save(const float t) = 0;
     virtual void save(const double t) = 0;
 
@@ -116,7 +131,7 @@
                 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
                 const
                 #endif
-                ::boost::serialization::nvp< T > & t, int
+                ::boost::serialization::nvp<T> & t, int
         ){
         save_start(t.name());
         archive::save(* this->This(), t.const_value());
@@ -127,7 +142,7 @@
 public:
     // utility functions implemented by all legal archives
     virtual unsigned int get_flags() const = 0;
-    virtual library_version_type get_library_version() const = 0;
+    virtual unsigned int get_library_version() const = 0;
     virtual void save_binary(const void * t, std::size_t size) = 0;
 
     virtual void save_object(
diff --git a/boost/archive/polymorphic_text_iarchive.hpp b/boost/archive/polymorphic_text_iarchive.hpp
index 931a928..9dbc6c4 100644
--- a/boost/archive/polymorphic_text_iarchive.hpp
+++ b/boost/archive/polymorphic_text_iarchive.hpp
@@ -20,11 +20,6 @@
 #include <boost/archive/text_iarchive.hpp>
 #include <boost/archive/detail/polymorphic_iarchive_route.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -41,10 +36,6 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(
     boost::archive::polymorphic_text_iarchive
diff --git a/boost/archive/polymorphic_text_wiarchive.hpp b/boost/archive/polymorphic_text_wiarchive.hpp
index 4df3d47..a04283a 100644
--- a/boost/archive/polymorphic_text_wiarchive.hpp
+++ b/boost/archive/polymorphic_text_wiarchive.hpp
@@ -24,11 +24,6 @@
 #include <boost/archive/text_wiarchive.hpp>
 #include <boost/archive/detail/polymorphic_iarchive_route.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -45,10 +40,6 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(
     boost::archive::polymorphic_text_wiarchive
diff --git a/boost/archive/polymorphic_xml_iarchive.hpp b/boost/archive/polymorphic_xml_iarchive.hpp
index feb0b99..bcd7254 100644
--- a/boost/archive/polymorphic_xml_iarchive.hpp
+++ b/boost/archive/polymorphic_xml_iarchive.hpp
@@ -20,11 +20,6 @@
 #include <boost/archive/xml_iarchive.hpp>
 #include <boost/archive/detail/polymorphic_iarchive_route.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -41,10 +36,6 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(
     boost::archive::polymorphic_xml_iarchive
diff --git a/boost/archive/shared_ptr_helper.hpp b/boost/archive/shared_ptr_helper.hpp
index 0e5f4f2..8d2d736 100644
--- a/boost/archive/shared_ptr_helper.hpp
+++ b/boost/archive/shared_ptr_helper.hpp
@@ -7,7 +7,7 @@
 #endif
 
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
-// shared_ptr_helper.hpp: serialization for boost shared pointern
+// shared_ptr_helper.hpp: serialization for boost shared pointer
 
 // (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo
 // Use, modification and distribution is subject to the Boost Software
@@ -16,7 +16,7 @@
 
 //  See http://www.boost.org for updates, documentation, and revision history.
 
-#include <set>
+#include <map>
 #include <list>
 #include <utility>
 #include <cstddef> // NULL
@@ -24,15 +24,11 @@
 #include <boost/config.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include <boost/type_traits/is_polymorphic.hpp>
 #include <boost/serialization/type_info_implementation.hpp>
 #include <boost/serialization/shared_ptr_132.hpp>
 #include <boost/serialization/throw_exception.hpp>
 
 #include <boost/archive/archive_exception.hpp>
-#include <boost/archive/detail/decl.hpp>
-
-#include <boost/archive/detail/abi_prefix.hpp> // must be the last headern
 
 namespace boost_132 {
     template<class T> class shared_ptr;
@@ -44,28 +40,25 @@
         template<class Archive, class T>
         inline void load(
             Archive & ar,
-            boost::shared_ptr< T > &t,
+            boost::shared_ptr<T> &t,
             const unsigned int file_version
         );
     }
+
 namespace archive{
 namespace detail {
 
+struct null_deleter {
+    void operator()(void const *) const {}
+};
+
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // a common class for holding various types of shared pointers
 
 class shared_ptr_helper {
-    struct collection_type_compare {
-        bool operator()(
-            const shared_ptr<const void> &lhs,
-            const shared_ptr<const void> &rhs
-        )const{
-            return lhs.get() < rhs.get();
-        }
-    };
-    typedef std::set<
-        boost::shared_ptr<const void>,
-        collection_type_compare
+    typedef std::map<
+        const void *,
+        boost::shared_ptr<const void>
     > collection_type;
     typedef collection_type::const_iterator iterator_type;
     // list of shared_pointers create accessable by raw pointer. This
@@ -75,27 +68,13 @@
     // a "mix-in" even if shared_ptr isn't used.
     collection_type * m_pointers;
 
-    struct null_deleter {
-        void operator()(void const *) const {}
-    };
-
-    struct void_deleter {
-        const boost::serialization::extended_type_info * m_eti;
-        void_deleter(const boost::serialization::extended_type_info *eti) :
-            m_eti(eti)
-        {}
-        void operator()(void *vp) const {
-            m_eti->destroy(vp);
-        }
-    };
-
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
     template<class Archive, class T>
     friend inline void boost::serialization::load(
         Archive & ar,
-        boost::shared_ptr< T > &t,
+        boost::shared_ptr<T> &t,
         const unsigned int file_version
     );
 #endif
@@ -109,111 +88,85 @@
     // new system which is disjoint from this set.  This is implemented
     // by a change in load_construct_data below.  It makes this file suitable
     // only for loading pointers into a 1.33 or later boost system.
-    std::list<boost_132::shared_ptr<const void> > * m_pointers_132;
+    std::list<boost_132::shared_ptr<void> > * m_pointers_132;
 //  #endif
 
-    // returns pointer to object and an indicator whether this is a
-    // new entry (true) or a previous one (false)
-    BOOST_ARCHIVE_DECL(shared_ptr<void>) 
-    get_od(
-        const void * od,
-        const boost::serialization::extended_type_info * true_type, 
-        const boost::serialization::extended_type_info * this_type
-    );
-
-    BOOST_ARCHIVE_DECL(void)
-    append(const boost::shared_ptr<const void> &);
-
-    template<class T>
-    struct non_polymorphic {
-        static const boost::serialization::extended_type_info * 
-        get_object_identifier(T & t){
-            return & boost::serialization::singleton<
-                BOOST_DEDUCED_TYPENAME 
-                boost::serialization::type_info_implementation< T >::type
-            >::get_const_instance();
-        }
-    };
-    template<class T>
-    struct polymorphic {
-        static const boost::serialization::extended_type_info * 
-        get_object_identifier(T & t){
-            return boost::serialization::singleton<
-                BOOST_DEDUCED_TYPENAME 
-                boost::serialization::type_info_implementation< T >::type
-            >::get_const_instance().get_derived_extended_type_info(t);
-        }
-    };
 public:
     template<class T>
-    void reset(shared_ptr< T > & s, T * t){
+    void reset(shared_ptr<T> & s, T * t){
         if(NULL == t){
             s.reset();
             return;
         }
-        const boost::serialization::extended_type_info * this_type
-            = & boost::serialization::type_info_implementation< T >::type
-                    ::get_const_instance();
-
         // get pointer to the most derived object.  This is effectively
-        // the object identifern
-        typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
-            is_polymorphic< T >,
-            mpl::identity<polymorphic< T > >,
-            mpl::identity<non_polymorphic< T > >
-        >::type type;
-
-        const boost::serialization::extended_type_info * true_type
-            = type::get_object_identifier(*t);
-
-        // note:if this exception is thrown, be sure that derived pointern
+        // the object identifer
+        const boost::serialization::extended_type_info * true_type 
+            = boost::serialization::type_info_implementation<T>::type
+                ::get_const_instance().get_derived_extended_type_info(*t);
+        // note:if this exception is thrown, be sure that derived pointer
         // is either registered or exported.
         if(NULL == true_type)
             boost::serialization::throw_exception(
-                archive_exception(
-                    archive_exception::unregistered_class,
-                    this_type->get_debug_info()
-                )
+                archive_exception(archive_exception::unregistered_class)
             );
-        shared_ptr<void> r =
-            get_od(
-                static_cast<const void *>(t), 
-                true_type,
-                this_type
-            );
-        if(!r){
-            s.reset(t);
-            const void * od = void_downcast(
-                *true_type,
-                *this_type,
-                static_cast<const void *>(t)
-            );
-            shared_ptr<const void> sp(s, od);
-            append(sp);
-        }
-        else{
-            s = shared_ptr< T >(
-                r,
-                static_cast<T *>(r.get())
-            );
-        }
-    }
+        const boost::serialization::extended_type_info * this_type
+            = & boost::serialization::type_info_implementation<T>::type
+                    ::get_const_instance();
 
+        // get void pointer to the most derived type
+        // this uniquely identifies the object referred to
+        const void * od = void_downcast(
+            *true_type, 
+            *this_type, 
+            static_cast<const void *>(t)
+        );
+
+        // make tracking array if necessary
+        if(NULL == m_pointers)
+            m_pointers = new collection_type;
+
+        iterator_type it = m_pointers->find(od);
+
+        // create a new shared pointer to a void
+        if(it == m_pointers->end()){
+            s.reset(t);
+            shared_ptr<const void> sp(s, od);
+            m_pointers->insert(collection_type::value_type(od, sp));
+            return;
+        }
+        t = static_cast<T *>(const_cast<void *>(void_upcast(
+            *true_type, 
+            *this_type, 
+            ((*it).second.get())
+        )));
+        s = shared_ptr<T>((*it).second, t); // aliasing 
+    }
 //  #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
-    BOOST_ARCHIVE_DECL(void)
-    append(const boost_132::shared_ptr<const void> & t);
+    void append(const boost_132::shared_ptr<void> & t){
+        if(NULL == m_pointers_132)
+            m_pointers_132 = new std::list<boost_132::shared_ptr<void> >;
+        m_pointers_132->push_back(t);
+    }
 //  #endif
 public:
-    BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
-    shared_ptr_helper();
-    BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
-    ~shared_ptr_helper();
+    shared_ptr_helper() : 
+        m_pointers(NULL)
+        #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+            , m_pointers_132(NULL)
+        #endif
+    {}
+    ~shared_ptr_helper(){
+        if(NULL != m_pointers)
+            delete m_pointers;
+        #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+        if(NULL != m_pointers_132)
+            delete m_pointers_132;
+        #endif
+    }
 };
 
 } // namespace detail
-} // namespace archive
+} // namespace serialization
 } // namespace boost
 
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 #endif // BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP
diff --git a/boost/archive/text_iarchive.hpp b/boost/archive/text_iarchive.hpp
index 298928b..ff3cb4d 100644
--- a/boost/archive/text_iarchive.hpp
+++ b/boost/archive/text_iarchive.hpp
@@ -23,15 +23,9 @@
 #include <boost/archive/basic_text_iprimitive.hpp>
 #include <boost/archive/basic_text_iarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
-#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -52,16 +46,6 @@
     void load(T & t){
         basic_text_iprimitive<std::istream>::load(t);
     }
-    void load(version_type & t){
-        unsigned int v;
-        load(v);
-        t = version_type(v);
-    }
-    void load(boost::serialization::item_version_type & t){
-        unsigned int v;
-        load(v);
-        t = boost::serialization::item_version_type(v);
-    }
     BOOST_ARCHIVE_DECL(void) 
     load(char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
@@ -87,8 +71,7 @@
     init();
     BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) 
     text_iarchive_impl(std::istream & is, unsigned int flags);
-    // don't import inline definitions! leave this as a reminder.
-    //BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) 
+    BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) 
     ~text_iarchive_impl(){};
 };
 
@@ -101,9 +84,8 @@
     public text_iarchive_impl<naked_text_iarchive>
 {
 public:
-    naked_text_iarchive(std::istream & is_, unsigned int flags = 0) :
-        // note: added _ to suppress useless gcc warning
-        text_iarchive_impl<naked_text_iarchive>(is_, flags)
+    naked_text_iarchive(std::istream & is, unsigned int flags = 0) :
+        text_iarchive_impl<naked_text_iarchive>(is, flags)
     {}
     ~naked_text_iarchive(){}
 };
@@ -111,23 +93,12 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive.  We created a "mix-in"
 // class to provide this functionality.  Since shared_ptr holds a
 // special esteem in the boost library - we included it here by default.
 #include <boost/archive/shared_ptr_helper.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -136,9 +107,8 @@
     public detail::shared_ptr_helper
 {
 public:
-    text_iarchive(std::istream & is_, unsigned int flags = 0) :
-        // note: added _ to suppress useless gcc warning
-        text_iarchive_impl<text_iarchive>(is_, flags)
+    text_iarchive(std::istream & is, unsigned int flags = 0) :
+        text_iarchive_impl<text_iarchive>(is, flags)
     {}
     ~text_iarchive(){}
 };
@@ -149,8 +119,6 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_iarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
 #endif // BOOST_ARCHIVE_TEXT_IARCHIVE_HPP
diff --git a/boost/archive/text_oarchive.hpp b/boost/archive/text_oarchive.hpp
index 2100d53..e6cf3d8 100644
--- a/boost/archive/text_oarchive.hpp
+++ b/boost/archive/text_oarchive.hpp
@@ -30,15 +30,9 @@
 #include <boost/archive/basic_text_oprimitive.hpp>
 #include <boost/archive/basic_text_oarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
-#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -60,12 +54,6 @@
         this->newtoken();
         basic_text_oprimitive<std::ostream>::save(t);
     }
-    void save(const version_type & t){
-        save(static_cast<const unsigned int>(t));
-    }
-    void save(const boost::serialization::item_version_type & t){
-        save(static_cast<const unsigned int>(t));
-    }
     BOOST_ARCHIVE_DECL(void) 
     save(const char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
@@ -80,8 +68,7 @@
     #endif
     BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) 
     text_oarchive_impl(std::ostream & os, unsigned int flags);
-    // don't import inline definitions! leave this as a reminder.
-    //BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) 
+    BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) 
     ~text_oarchive_impl(){};
 public:
     BOOST_ARCHIVE_DECL(void) 
@@ -95,9 +82,9 @@
     public text_oarchive_impl<text_oarchive>
 {
 public:
-    text_oarchive(std::ostream & os_, unsigned int flags = 0) :
-        // note: added _ to suppress useless gcc warning
-        text_oarchive_impl<text_oarchive>(os_, flags)
+     
+    text_oarchive(std::ostream & os, unsigned int flags = 0) :
+        text_oarchive_impl<text_oarchive>(os, flags)
     {}
     ~text_oarchive(){}
 };
@@ -110,10 +97,6 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_oarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
 #endif // BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
diff --git a/boost/archive/text_wiarchive.hpp b/boost/archive/text_wiarchive.hpp
index 7451f3a..cd01eb3 100644
--- a/boost/archive/text_wiarchive.hpp
+++ b/boost/archive/text_wiarchive.hpp
@@ -27,15 +27,9 @@
 #include <boost/archive/basic_text_iprimitive.hpp>
 #include <boost/archive/basic_text_iarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
-#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -56,16 +50,6 @@
     void load(T & t){
         basic_text_iprimitive<std::wistream>::load(t);
     }
-    void load(version_type & t){
-        unsigned int v;
-        load(v);
-        t = version_type(v);
-    }
-    void load(boost::serialization::item_version_type & t){
-        unsigned int v;
-        load(v);
-        t = boost::serialization::item_version_type(v);
-    }
     BOOST_WARCHIVE_DECL(void)
     load(char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
@@ -107,23 +91,12 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive.  We created a "mix-in"
 // class to provide this functionality.  Since shared_ptr holds a
 // special esteem in the boost library - we included it here by default.
 #include <boost/archive/shared_ptr_helper.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -144,9 +117,7 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_wiarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
 #endif // BOOST_NO_STD_WSTREAMBUF
 #endif // BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP
diff --git a/boost/archive/text_woarchive.hpp b/boost/archive/text_woarchive.hpp
index 7ed0c82..79d3742 100644
--- a/boost/archive/text_woarchive.hpp
+++ b/boost/archive/text_woarchive.hpp
@@ -35,15 +35,9 @@
 #include <boost/archive/basic_text_oprimitive.hpp>
 #include <boost/archive/basic_text_oarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
-#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -65,12 +59,6 @@
         this->newtoken();
         basic_text_oprimitive<std::wostream>::save(t);
     }
-    void save(const version_type & t){
-        save(static_cast<const unsigned int>(t));
-    }
-    void save(const boost::serialization::item_version_type & t){
-        save(static_cast<const unsigned int>(t));
-    }
     BOOST_WARCHIVE_DECL(void)
     save(const char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
@@ -95,7 +83,7 @@
     }
 public:
     void save_binary(const void *address, std::size_t count){
-        put(static_cast<wchar_t>('\n'));
+        put(L'\n');
         this->end_preamble();
         #if ! defined(__MWERKS__)
         this->basic_text_oprimitive<std::wostream>::save_binary(
@@ -105,7 +93,7 @@
             address, 
             count
         );
-        put(static_cast<wchar_t>('\n'));
+        put(L'\n');
         this->delimiter = this->none;
     }
 
@@ -135,10 +123,6 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_woarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
 #endif // BOOST_NO_STD_WSTREAMBUF
diff --git a/boost/archive/tmpdir.hpp b/boost/archive/tmpdir.hpp
index 9e6ada4..f962e11 100644
--- a/boost/archive/tmpdir.hpp
+++ b/boost/archive/tmpdir.hpp
@@ -18,7 +18,7 @@
 
 #include <cstdlib> // getenv
 #include <cstddef> // NULL
-//#include <boost/assert.hpp>
+//#include <cassert>
 
 #include <boost/config.hpp>
 #ifdef BOOST_NO_STDC_NAMESPACE
@@ -38,7 +38,7 @@
     if(NULL == dirname)
         dirname = std::getenv("TEMP");
     if(NULL == dirname){
-        //BOOST_ASSERT(false); // no temp directory found
+        //assert(false); // no temp directory found
         dirname = ".";
     }
     return dirname;
diff --git a/boost/archive/xml_archive_exception.hpp b/boost/archive/xml_archive_exception.hpp
index 48e6cb3..be0f956 100644
--- a/boost/archive/xml_archive_exception.hpp
+++ b/boost/archive/xml_archive_exception.hpp
@@ -17,23 +17,18 @@
 //  See http://www.boost.org for updates, documentation, and revision history.
 
 #include <exception>
-#include <boost/assert.hpp>
+#include <cassert>
 
-#include <boost/config.hpp> 
-#include <boost/preprocessor/empty.hpp>
-#include <boost/archive/detail/decl.hpp>
 #include <boost/archive/archive_exception.hpp>
 
-#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
-
 namespace boost {
 namespace archive {
 
 //////////////////////////////////////////////////////////////////////
 // exceptions thrown by xml archives
 //
-class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) xml_archive_exception : 
-    public virtual boost::archive::archive_exception
+class xml_archive_exception : 
+    public virtual archive_exception
 {
 public:
     typedef enum {
@@ -41,16 +36,31 @@
         xml_archive_tag_mismatch,
         xml_archive_tag_name_error
     } exception_code;
-    xml_archive_exception(
-        exception_code c, 
-        const char * e1 = NULL,
-        const char * e2 = NULL
-    );
+    exception_code code;
+    xml_archive_exception(exception_code)
+    {}
+    virtual const char *what( ) const throw( )
+    {
+        const char *msg;
+        switch(code){
+        case xml_archive_parsing_error:
+            msg = "unrecognized XML syntax";
+            break;
+        case xml_archive_tag_mismatch:
+            msg = "XML start/end tag mismatch";
+            break;
+        case xml_archive_tag_name_error:
+            msg = "Invalid XML tag name";
+            break;
+        default:
+            msg = archive_exception::what();
+            break;
+        }
+        return msg;
+    }
 };
 
 }// namespace archive
 }// namespace boost
 
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 #endif //BOOST_XML_ARCHIVE_ARCHIVE_EXCEPTION_HPP
diff --git a/boost/archive/xml_iarchive.hpp b/boost/archive/xml_iarchive.hpp
index be6cfe4..b746242 100644
--- a/boost/archive/xml_iarchive.hpp
+++ b/boost/archive/xml_iarchive.hpp
@@ -23,15 +23,9 @@
 #include <boost/archive/basic_text_iprimitive.hpp>
 #include <boost/archive/basic_xml_iarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
-#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -64,18 +58,6 @@
     void load(T & t){
         basic_text_iprimitive<std::istream>::load(t);
     }
-    void 
-    load(version_type & t){
-        unsigned int v;
-        load(v);
-        t = version_type(v);
-    }
-    void 
-    load(boost::serialization::item_version_type & t){
-        unsigned int v;
-        load(v);
-        t = boost::serialization::item_version_type(v);
-    }
     BOOST_ARCHIVE_DECL(void)
     load(char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
@@ -120,23 +102,12 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive.  We created a "mix-in"
 // class to provide this functionality.  Since shared_ptr holds a
 // special esteem in the boost library - we included it here by default.
 #include <boost/archive/shared_ptr_helper.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -157,8 +128,6 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_iarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
 #endif // BOOST_ARCHIVE_XML_IARCHIVE_HPP
diff --git a/boost/archive/xml_oarchive.hpp b/boost/archive/xml_oarchive.hpp
index 167ba09..790b739 100644
--- a/boost/archive/xml_oarchive.hpp
+++ b/boost/archive/xml_oarchive.hpp
@@ -30,15 +30,9 @@
 #include <boost/archive/basic_text_oprimitive.hpp>
 #include <boost/archive/basic_xml_oarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
-#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
 namespace archive {
 
@@ -62,14 +56,6 @@
     void save(const T & t){
         basic_text_oprimitive<std::ostream>::save(t);
     }
-    void 
-    save(const version_type & t){
-        save(static_cast<const unsigned int>(t));
-    }
-    void 
-    save(const boost::serialization::item_version_type & t){
-        save(static_cast<const unsigned int>(t));
-    }
     BOOST_ARCHIVE_DECL(void) 
     save(const char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
@@ -124,10 +110,6 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_oarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
 #endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP
diff --git a/boost/archive/xml_wiarchive.hpp b/boost/archive/xml_wiarchive.hpp
index 09552ce..83164d2 100644
--- a/boost/archive/xml_wiarchive.hpp
+++ b/boost/archive/xml_wiarchive.hpp
@@ -28,15 +28,9 @@
 #include <boost/archive/basic_text_iprimitive.hpp>
 #include <boost/archive/basic_xml_iarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
-#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -65,22 +59,9 @@
         return is;
     }
     template<class T>
-    void 
-    load(T & t){
+    void load(T & t){
         basic_text_iprimitive<std::wistream>::load(t);
     }
-    void 
-    load(version_type & t){
-        unsigned int v;
-        load(v);
-        t = version_type(v);
-    }
-    void 
-    load(boost::serialization::item_version_type & t){
-        unsigned int v;
-        load(v);
-        t = boost::serialization::item_version_type(v);
-    }
     BOOST_WARCHIVE_DECL(void)
     load(char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
@@ -125,24 +106,12 @@
 } // namespace archive
 } // namespace boost
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive.  We created a "mix-in"
 // class to provide this functionality.  Since shared_ptr holds a
 // special esteem in the boost library - we included it here by default.
 #include <boost/archive/shared_ptr_helper.hpp>
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost { 
 namespace archive {
 
@@ -163,9 +132,7 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_wiarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
 #endif // BOOST_NO_STD_WSTREAMBUF
 #endif // BOOST_ARCHIVE_XML_WIARCHIVE_HPP
diff --git a/boost/archive/xml_woarchive.hpp b/boost/archive/xml_woarchive.hpp
index 08c0fdc..e396143 100644
--- a/boost/archive/xml_woarchive.hpp
+++ b/boost/archive/xml_woarchive.hpp
@@ -34,18 +34,20 @@
 #include <boost/archive/basic_text_oprimitive.hpp>
 #include <boost/archive/basic_xml_oarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
-#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable : 4511 4512)
-#endif
-
 namespace boost {
 namespace archive {
 
+#if 0
+BOOST_WARCHIVE_DECL(std::wostream &)
+operator<<(std::wostream &os, const char *t);
+
+BOOST_WARCHIVE_DECL(std::wostream &)
+operator<<(std::wostream &os, const char t);
+#endif
+
 template<class Archive>
 class xml_woarchive_impl : 
     public basic_text_oprimitive<std::wostream>,
@@ -67,14 +69,6 @@
     save(const T & t){
         basic_text_oprimitive<std::wostream>::save(t);
     }
-    void 
-    save(const version_type & t){
-        save(static_cast<const unsigned int>(t));
-    }
-    void 
-    save(const boost::serialization::item_version_type & t){
-        save(static_cast<const unsigned int>(t));
-    }
     BOOST_WARCHIVE_DECL(void)
     save(const char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
@@ -130,10 +124,6 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_woarchive)
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
 #endif // BOOST_NO_STD_WSTREAMBUF
diff --git a/boost/array.hpp b/boost/array.hpp
index ffb504b..8ef73c4 100644
--- a/boost/array.hpp
+++ b/boost/array.hpp
@@ -13,11 +13,6 @@
  * accompanying file LICENSE_1_0.txt or copy at
  * http://www.boost.org/LICENSE_1_0.txt)
  *
- * 28 Dec 2010 - (mtc) Added cbegin and cend (and crbegin and crend) for C++Ox compatibility.
- * 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
- *      See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
- *      Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow)
- * 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow)
  * 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
  * 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
  * 05 Aug 2001 - minor update (Nico Josuttis)
@@ -29,15 +24,6 @@
 #ifndef BOOST_ARRAY_HPP
 #define BOOST_ARRAY_HPP
 
-#include <boost/detail/workaround.hpp>
-
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)  
-# pragma warning(push)  
-# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
-# pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated 
-# pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required 
-#endif
-
 #include <cstddef>
 #include <stdexcept>
 #include <boost/assert.hpp>
@@ -70,13 +56,10 @@
         typedef std::ptrdiff_t difference_type;
 
         // iterator support
-        iterator        begin()       { return elems; }
-        const_iterator  begin() const { return elems; }
-        const_iterator cbegin() const { return elems; }
-        
-        iterator        end()       { return elems+N; }
-        const_iterator  end() const { return elems+N; }
-        const_iterator cend() const { return elems+N; }
+        iterator begin() { return elems; }
+        const_iterator begin() const { return elems; }
+        iterator end() { return elems+N; }
+        const_iterator end() const { return elems+N; }
 
         // reverse iterator support
 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
@@ -88,11 +71,6 @@
                                       reference, iterator, reference> > reverse_iterator;
         typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
                                       const_reference, iterator, reference> > const_reverse_iterator;
-#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) 
-        typedef std::reverse_iterator<iterator, std::random_access_iterator_tag, 
-              value_type, reference, iterator, difference_type> reverse_iterator; 
-        typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
-              value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
 #else
         // workaround for broken reverse_iterator implementations
         typedef std::reverse_iterator<iterator,T> reverse_iterator;
@@ -103,17 +81,10 @@
         const_reverse_iterator rbegin() const {
             return const_reverse_iterator(end());
         }
-        const_reverse_iterator crbegin() const {
-            return const_reverse_iterator(end());
-        }
-
         reverse_iterator rend() { return reverse_iterator(begin()); }
         const_reverse_iterator rend() const {
             return const_reverse_iterator(begin());
         }
-        const_reverse_iterator crend() const {
-            return const_reverse_iterator(begin());
-        }
 
         // operator[]
         reference operator[](size_type i) 
@@ -180,8 +151,7 @@
         }
 
         // assign one value to all elements
-        void assign (const T& value) { fill ( value ); }    // A synonym for fill
-        void fill   (const T& value)
+        void assign (const T& value)
         {
             std::fill_n(begin(),size(),value);
         }
@@ -189,8 +159,7 @@
         // check range (may be private because it is static)
         static void rangecheck (size_type i) {
             if (i >= size()) {
-                std::out_of_range e("array<>: index out of range");
-                boost::throw_exception(e);
+                throw std::out_of_range("array<>: index out of range");
             }
         }
 
@@ -211,13 +180,10 @@
         typedef std::ptrdiff_t difference_type;
 
         // iterator support
-        iterator        begin()       { return       iterator( reinterpret_cast<       T * >( this ) ); }
-        const_iterator  begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
-        const_iterator cbegin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
-
-        iterator        end()       { return  begin(); }
-        const_iterator  end() const { return  begin(); }
-        const_iterator cend() const { return cbegin(); }
+        iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); }
+        const_iterator begin() const { return const_iterator(  reinterpret_cast< const T * >( this ) ); }
+        iterator end() { return begin(); }
+        const_iterator end() const { return begin(); }
 
         // reverse iterator support
 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
@@ -229,11 +195,6 @@
                                       reference, iterator, reference> > reverse_iterator;
         typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
                                       const_reference, iterator, reference> > const_reverse_iterator;
-#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) 
-        typedef std::reverse_iterator<iterator, std::random_access_iterator_tag, 
-              value_type, reference, iterator, difference_type> reverse_iterator; 
-        typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
-              value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
 #else
         // workaround for broken reverse_iterator implementations
         typedef std::reverse_iterator<iterator,T> reverse_iterator;
@@ -244,17 +205,10 @@
         const_reverse_iterator rbegin() const {
             return const_reverse_iterator(end());
         }
-        const_reverse_iterator crbegin() const {
-            return const_reverse_iterator(end());
-        }
-
         reverse_iterator rend() { return reverse_iterator(begin()); }
         const_reverse_iterator rend() const {
             return const_reverse_iterator(begin());
         }
-        const_reverse_iterator crend() const {
-            return const_reverse_iterator(begin());
-        }
 
         // operator[]
         reference operator[](size_type /*i*/)
@@ -315,14 +269,12 @@
         }
 
         // assign one value to all elements
-        void assign (const T& value) { fill ( value ); }
-        void fill   (const T& ) {}
-        
+        void assign (const T& ) {   }
+
         // check range (may be private because it is static)
         static reference failed_rangecheck () {
                 std::out_of_range e("attempt to access element of an empty array");
                 boost::throw_exception(e);
-#if defined(BOOST_NO_EXCEPTIONS) || (!defined(BOOST_MSVC) && !defined(__PATHSCALE__))
                 //
                 // We need to return something here to keep
                 // some compilers happy: however we will never
@@ -330,7 +282,6 @@
                 //
                 static T placeholder;
                 return placeholder;
-#endif
             }
     };
 #endif
@@ -367,71 +318,6 @@
         x.swap(y);
     }
 
-#if defined(__SUNPRO_CC)
-//  Trac ticket #4757; the Sun Solaris compiler can't handle
-//  syntax like 'T(&get_c_array(boost::array<T,N>& arg))[N]'
-//  
-//  We can't just use this for all compilers, because the 
-//      borland compilers can't handle this form. 
-    namespace detail {
-       template <typename T, std::size_t N> struct c_array
-       {
-           typedef T type[N];
-       };
-    }
-    
-   // Specific for boost::array: simply returns its elems data member.
-   template <typename T, std::size_t N>
-   typename detail::c_array<T,N>::type& get_c_array(boost::array<T,N>& arg)
-   {
-       return arg.elems;
-   }
-
-   // Specific for boost::array: simply returns its elems data member.
-   template <typename T, std::size_t N>
-   typename const detail::c_array<T,N>::type& get_c_array(const boost::array<T,N>& arg)
-   {
-       return arg.elems;
-   }
-#else
-// Specific for boost::array: simply returns its elems data member.
-    template <typename T, std::size_t N>
-    T(&get_c_array(boost::array<T,N>& arg))[N]
-    {
-        return arg.elems;
-    }
-    
-    // Const version.
-    template <typename T, std::size_t N>
-    const T(&get_c_array(const boost::array<T,N>& arg))[N]
-    {
-        return arg.elems;
-    }
-#endif
-    
-#if 0
-    // Overload for std::array, assuming that std::array will have
-    // explicit conversion functions as discussed at the WG21 meeting
-    // in Summit, March 2009.
-    template <typename T, std::size_t N>
-    T(&get_c_array(std::array<T,N>& arg))[N]
-    {
-        return static_cast<T(&)[N]>(arg);
-    }
-    
-    // Const version.
-    template <typename T, std::size_t N>
-    const T(&get_c_array(const std::array<T,N>& arg))[N]
-    {
-        return static_cast<T(&)[N]>(arg);
-    }
-#endif
-
 } /* namespace boost */
 
-
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)  
-# pragma warning(pop)  
-#endif 
-
 #endif /*BOOST_ARRAY_HPP*/
diff --git a/boost/asio.hpp b/boost/asio.hpp
index fdfd7fa..5d8b43b 100644
--- a/boost/asio.hpp
+++ b/boost/asio.hpp
@@ -2,7 +2,7 @@
 // asio.hpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // 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)
@@ -21,9 +21,7 @@
 #include <boost/asio/basic_deadline_timer.hpp>
 #include <boost/asio/basic_io_object.hpp>
 #include <boost/asio/basic_raw_socket.hpp>
-#include <boost/asio/basic_seq_packet_socket.hpp>
 #include <boost/asio/basic_serial_port.hpp>
-#include <boost/asio/basic_signal_set.hpp>
 #include <boost/asio/basic_socket_acceptor.hpp>
 #include <boost/asio/basic_socket_iostream.hpp>
 #include <boost/asio/basic_socket_streambuf.hpp>
@@ -38,7 +36,6 @@
 #include <boost/asio/buffered_write_stream.hpp>
 #include <boost/asio/buffers_iterator.hpp>
 #include <boost/asio/completion_condition.hpp>
-#include <boost/asio/connect.hpp>
 #include <boost/asio/datagram_socket_service.hpp>
 #include <boost/asio/deadline_timer_service.hpp>
 #include <boost/asio/deadline_timer.hpp>
@@ -79,12 +76,9 @@
 #include <boost/asio/read.hpp>
 #include <boost/asio/read_at.hpp>
 #include <boost/asio/read_until.hpp>
-#include <boost/asio/seq_packet_socket_service.hpp>
 #include <boost/asio/serial_port.hpp>
 #include <boost/asio/serial_port_base.hpp>
 #include <boost/asio/serial_port_service.hpp>
-#include <boost/asio/signal_set.hpp>
-#include <boost/asio/signal_set_service.hpp>
 #include <boost/asio/socket_acceptor_service.hpp>
 #include <boost/asio/socket_base.hpp>
 #include <boost/asio/strand.hpp>
diff --git a/boost/asio/basic_datagram_socket.hpp b/boost/asio/basic_datagram_socket.hpp
index bdbcec1..8fa870b 100644
--- a/boost/asio/basic_datagram_socket.hpp
+++ b/boost/asio/basic_datagram_socket.hpp
@@ -2,7 +2,7 @@
 // basic_datagram_socket.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // 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)
@@ -15,15 +15,17 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#include <boost/asio/detail/config.hpp>
-#include <cstddef>
-#include <boost/asio/basic_socket.hpp>
-#include <boost/asio/datagram_socket_service.hpp>
-#include <boost/asio/detail/handler_type_requirements.hpp>
-#include <boost/asio/detail/throw_error.hpp>
-#include <boost/asio/error.hpp>
+#include <boost/asio/detail/push_options.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
+#include <cstddef>
+#include <boost/config.hpp>
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/basic_socket.hpp>
+#include <boost/asio/datagram_socket_service.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/detail/throw_error.hpp>
 
 namespace boost {
 namespace asio {
@@ -43,12 +45,8 @@
   : public basic_socket<Protocol, DatagramSocketService>
 {
 public:
-  /// (Deprecated: Use native_handle_type.) The native representation of a
-  /// socket.
-  typedef typename DatagramSocketService::native_handle_type native_type;
-
   /// The native representation of a socket.
-  typedef typename DatagramSocketService::native_handle_type native_handle_type;
+  typedef typename DatagramSocketService::native_type native_type;
 
   /// The protocol type.
   typedef Protocol protocol_type;
@@ -126,48 +124,12 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_datagram_socket(boost::asio::io_service& io_service,
-      const protocol_type& protocol, const native_handle_type& native_socket)
+      const protocol_type& protocol, const native_type& native_socket)
     : basic_socket<Protocol, DatagramSocketService>(
         io_service, protocol, native_socket)
   {
   }
 
-#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-  /// Move-construct a basic_datagram_socket from another.
-  /**
-   * This constructor moves a datagram socket from one object to another.
-   *
-   * @param other The other basic_datagram_socket object from which the move
-   * will occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_datagram_socket(io_service&) constructor.
-   */
-  basic_datagram_socket(basic_datagram_socket&& other)
-    : basic_socket<Protocol, DatagramSocketService>(
-        BOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other))
-  {
-  }
-
-  /// Move-assign a basic_datagram_socket from another.
-  /**
-   * This assignment operator moves a datagram socket from one object to
-   * another.
-   *
-   * @param other The other basic_datagram_socket object from which the move
-   * will occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_datagram_socket(io_service&) constructor.
-   */
-  basic_datagram_socket& operator=(basic_datagram_socket&& other)
-  {
-    basic_socket<Protocol, DatagramSocketService>::operator=(
-        BOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other));
-    return *this;
-  }
-#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
   /// Send some data on a connected socket.
   /**
    * This function is used to send data on the datagram socket. The function
@@ -194,9 +156,8 @@
   std::size_t send(const ConstBufferSequence& buffers)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().send(
-        this->get_implementation(), buffers, 0, ec);
-    boost::asio::detail::throw_error(ec, "send");
+    std::size_t s = this->service.send(this->implementation, buffers, 0, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -222,9 +183,9 @@
       socket_base::message_flags flags)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().send(
-        this->get_implementation(), buffers, flags, ec);
-    boost::asio::detail::throw_error(ec, "send");
+    std::size_t s = this->service.send(
+        this->implementation, buffers, flags, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -249,8 +210,7 @@
   std::size_t send(const ConstBufferSequence& buffers,
       socket_base::message_flags flags, boost::system::error_code& ec)
   {
-    return this->get_service().send(
-        this->get_implementation(), buffers, flags, ec);
+    return this->service.send(this->implementation, buffers, flags, ec);
   }
 
   /// Start an asynchronous send on a connected socket.
@@ -290,15 +250,9 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
-  void async_send(const ConstBufferSequence& buffers,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
+  void async_send(const ConstBufferSequence& buffers, WriteHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_send(this->get_implementation(),
-        buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+    this->service.async_send(this->implementation, buffers, 0, handler);
   }
 
   /// Start an asynchronous send on a connected socket.
@@ -332,15 +286,9 @@
    */
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_send(const ConstBufferSequence& buffers,
-      socket_base::message_flags flags,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
+      socket_base::message_flags flags, WriteHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_send(this->get_implementation(),
-        buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+    this->service.async_send(this->implementation, buffers, flags, handler);
   }
 
   /// Send a datagram to the specified endpoint.
@@ -373,9 +321,9 @@
       const endpoint_type& destination)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().send_to(
-        this->get_implementation(), buffers, destination, 0, ec);
-    boost::asio::detail::throw_error(ec, "send_to");
+    std::size_t s = this->service.send_to(
+        this->implementation, buffers, destination, 0, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -400,9 +348,9 @@
       const endpoint_type& destination, socket_base::message_flags flags)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().send_to(
-        this->get_implementation(), buffers, destination, flags, ec);
-    boost::asio::detail::throw_error(ec, "send_to");
+    std::size_t s = this->service.send_to(
+        this->implementation, buffers, destination, flags, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -427,7 +375,7 @@
       const endpoint_type& destination, socket_base::message_flags flags,
       boost::system::error_code& ec)
   {
-    return this->get_service().send_to(this->get_implementation(),
+    return this->service.send_to(this->implementation,
         buffers, destination, flags, ec);
   }
 
@@ -470,15 +418,10 @@
    */
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_send_to(const ConstBufferSequence& buffers,
-      const endpoint_type& destination,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
+      const endpoint_type& destination, WriteHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_send_to(this->get_implementation(), buffers,
-        destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+    this->service.async_send_to(this->implementation, buffers, destination, 0,
+        handler);
   }
 
   /// Start an asynchronous send.
@@ -511,14 +454,10 @@
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_send_to(const ConstBufferSequence& buffers,
       const endpoint_type& destination, socket_base::message_flags flags,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
+      WriteHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_send_to(this->get_implementation(), buffers,
-        destination, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+    this->service.async_send_to(this->implementation, buffers, destination,
+        flags, handler);
   }
 
   /// Receive some data on a connected socket.
@@ -549,9 +488,9 @@
   std::size_t receive(const MutableBufferSequence& buffers)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().receive(
-        this->get_implementation(), buffers, 0, ec);
-    boost::asio::detail::throw_error(ec, "receive");
+    std::size_t s = this->service.receive(
+        this->implementation, buffers, 0, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -578,9 +517,9 @@
       socket_base::message_flags flags)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().receive(
-        this->get_implementation(), buffers, flags, ec);
-    boost::asio::detail::throw_error(ec, "receive");
+    std::size_t s = this->service.receive(
+        this->implementation, buffers, flags, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -606,8 +545,7 @@
   std::size_t receive(const MutableBufferSequence& buffers,
       socket_base::message_flags flags, boost::system::error_code& ec)
   {
-    return this->get_service().receive(
-        this->get_implementation(), buffers, flags, ec);
+    return this->service.receive(this->implementation, buffers, flags, ec);
   }
 
   /// Start an asynchronous receive on a connected socket.
@@ -647,15 +585,9 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
-  void async_receive(const MutableBufferSequence& buffers,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
+  void async_receive(const MutableBufferSequence& buffers, ReadHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive(this->get_implementation(),
-        buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+    this->service.async_receive(this->implementation, buffers, 0, handler);
   }
 
   /// Start an asynchronous receive on a connected socket.
@@ -688,15 +620,9 @@
    */
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_receive(const MutableBufferSequence& buffers,
-      socket_base::message_flags flags,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
+      socket_base::message_flags flags, ReadHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive(this->get_implementation(),
-        buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+    this->service.async_receive(this->implementation, buffers, flags, handler);
   }
 
   /// Receive a datagram with the endpoint of the sender.
@@ -730,9 +656,9 @@
       endpoint_type& sender_endpoint)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().receive_from(
-        this->get_implementation(), buffers, sender_endpoint, 0, ec);
-    boost::asio::detail::throw_error(ec, "receive_from");
+    std::size_t s = this->service.receive_from(
+        this->implementation, buffers, sender_endpoint, 0, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
   
@@ -757,9 +683,9 @@
       endpoint_type& sender_endpoint, socket_base::message_flags flags)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().receive_from(
-        this->get_implementation(), buffers, sender_endpoint, flags, ec);
-    boost::asio::detail::throw_error(ec, "receive_from");
+    std::size_t s = this->service.receive_from(
+        this->implementation, buffers, sender_endpoint, flags, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
   
@@ -784,8 +710,8 @@
       endpoint_type& sender_endpoint, socket_base::message_flags flags,
       boost::system::error_code& ec)
   {
-    return this->get_service().receive_from(this->get_implementation(),
-        buffers, sender_endpoint, flags, ec);
+    return this->service.receive_from(this->implementation, buffers,
+        sender_endpoint, flags, ec);
   }
 
   /// Start an asynchronous receive.
@@ -826,15 +752,10 @@
    */
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_receive_from(const MutableBufferSequence& buffers,
-      endpoint_type& sender_endpoint,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
+      endpoint_type& sender_endpoint, ReadHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive_from(this->get_implementation(), buffers,
-        sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+    this->service.async_receive_from(this->implementation, buffers,
+        sender_endpoint, 0, handler);
   }
 
   /// Start an asynchronous receive.
@@ -869,14 +790,10 @@
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_receive_from(const MutableBufferSequence& buffers,
       endpoint_type& sender_endpoint, socket_base::message_flags flags,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
+      ReadHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive_from(this->get_implementation(), buffers,
-        sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+    this->service.async_receive_from(this->implementation, buffers,
+        sender_endpoint, flags, handler);
   }
 };
 
diff --git a/boost/asio/basic_deadline_timer.hpp b/boost/asio/basic_deadline_timer.hpp
index c90cbee..ef63ba0 100644
--- a/boost/asio/basic_deadline_timer.hpp
+++ b/boost/asio/basic_deadline_timer.hpp
@@ -2,7 +2,7 @@
 // basic_deadline_timer.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // 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)
@@ -15,15 +15,17 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#include <boost/asio/detail/config.hpp>
-#include <cstddef>
-#include <boost/asio/basic_io_object.hpp>
-#include <boost/asio/deadline_timer_service.hpp>
-#include <boost/asio/detail/handler_type_requirements.hpp>
-#include <boost/asio/detail/throw_error.hpp>
-#include <boost/asio/error.hpp>
+#include <boost/asio/detail/push_options.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
+#include <cstddef>
+#include <boost/config.hpp>
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/basic_io_object.hpp>
+#include <boost/asio/deadline_timer_service.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/detail/throw_error.hpp>
 
 namespace boost {
 namespace asio {
@@ -162,7 +164,7 @@
   {
     boost::system::error_code ec;
     this->service.expires_at(this->implementation, expiry_time, ec);
-    boost::asio::detail::throw_error(ec, "expires_at");
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Constructor to set a particular expiry time relative to now.
@@ -181,7 +183,7 @@
   {
     boost::system::error_code ec;
     this->service.expires_from_now(this->implementation, expiry_time, ec);
-    boost::asio::detail::throw_error(ec, "expires_from_now");
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Cancel any asynchronous operations that are waiting on the timer.
@@ -210,7 +212,7 @@
   {
     boost::system::error_code ec;
     std::size_t s = this->service.cancel(this->implementation, ec);
-    boost::asio::detail::throw_error(ec, "cancel");
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -241,67 +243,6 @@
     return this->service.cancel(this->implementation, ec);
   }
 
-  /// Cancels one asynchronous operation that is waiting on the timer.
-  /**
-   * This function forces the completion of one pending asynchronous wait
-   * operation against the timer. Handlers are cancelled in FIFO order. The
-   * handler for the cancelled operation will be invoked with the
-   * boost::asio::error::operation_aborted error code.
-   *
-   * Cancelling the timer does not change the expiry time.
-   *
-   * @return The number of asynchronous operations that were cancelled. That is,
-   * either 0 or 1.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   *
-   * @note If the timer has already expired when cancel_one() is called, then
-   * the handlers for asynchronous wait operations will:
-   *
-   * @li have already been invoked; or
-   *
-   * @li have been queued for invocation in the near future.
-   *
-   * These handlers can no longer be cancelled, and therefore are passed an
-   * error code that indicates the successful completion of the wait operation.
-   */
-  std::size_t cancel_one()
-  {
-    boost::system::error_code ec;
-    std::size_t s = this->service.cancel_one(this->implementation, ec);
-    boost::asio::detail::throw_error(ec, "cancel_one");
-    return s;
-  }
-
-  /// Cancels one asynchronous operation that is waiting on the timer.
-  /**
-   * This function forces the completion of one pending asynchronous wait
-   * operation against the timer. Handlers are cancelled in FIFO order. The
-   * handler for the cancelled operation will be invoked with the
-   * boost::asio::error::operation_aborted error code.
-   *
-   * Cancelling the timer does not change the expiry time.
-   *
-   * @param ec Set to indicate what error occurred, if any.
-   *
-   * @return The number of asynchronous operations that were cancelled. That is,
-   * either 0 or 1.
-   *
-   * @note If the timer has already expired when cancel_one() is called, then
-   * the handlers for asynchronous wait operations will:
-   *
-   * @li have already been invoked; or
-   *
-   * @li have been queued for invocation in the near future.
-   *
-   * These handlers can no longer be cancelled, and therefore are passed an
-   * error code that indicates the successful completion of the wait operation.
-   */
-  std::size_t cancel_one(boost::system::error_code& ec)
-  {
-    return this->service.cancel_one(this->implementation, ec);
-  }
-
   /// Get the timer's expiry time as an absolute time.
   /**
    * This function may be used to obtain the timer's current expiry time.
@@ -339,7 +280,7 @@
     boost::system::error_code ec;
     std::size_t s = this->service.expires_at(
         this->implementation, expiry_time, ec);
-    boost::asio::detail::throw_error(ec, "expires_at");
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -408,7 +349,7 @@
     boost::system::error_code ec;
     std::size_t s = this->service.expires_from_now(
         this->implementation, expiry_time, ec);
-    boost::asio::detail::throw_error(ec, "expires_from_now");
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -452,7 +393,7 @@
   {
     boost::system::error_code ec;
     this->service.wait(this->implementation, ec);
-    boost::asio::detail::throw_error(ec, "wait");
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Perform a blocking wait on the timer.
@@ -492,14 +433,9 @@
    * boost::asio::io_service::post().
    */
   template <typename WaitHandler>
-  void async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
+  void async_wait(WaitHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WaitHandler.
-    BOOST_ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check;
-
-    this->service.async_wait(this->implementation,
-        BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
+    this->service.async_wait(this->implementation, handler);
   }
 };
 
diff --git a/boost/asio/basic_io_object.hpp b/boost/asio/basic_io_object.hpp
index 57a7397..1cbf9bb 100644
--- a/boost/asio/basic_io_object.hpp
+++ b/boost/asio/basic_io_object.hpp
@@ -2,7 +2,7 @@
 // basic_io_object.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // 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)
@@ -15,50 +15,18 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#include <boost/asio/detail/config.hpp>
-#include <boost/asio/io_service.hpp>
-
 #include <boost/asio/detail/push_options.hpp>
 
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/noncopyable.hpp>
+
 namespace boost {
 namespace asio {
 
-#if defined(BOOST_ASIO_HAS_MOVE)
-namespace detail
-{
-  // Type trait used to determine whether a service supports move.
-  template <typename IoObjectService>
-  class service_has_move
-  {
-  private:
-    typedef IoObjectService service_type;
-    typedef typename service_type::implementation_type implementation_type;
-
-    template <typename T, typename U>
-    static auto eval(T* t, U* u) -> decltype(t->move_construct(*u, *u), char());
-    static char (&eval(...))[2];
-
-  public:
-    static const bool value =
-      sizeof(service_has_move::eval(
-        static_cast<service_type*>(0),
-        static_cast<implementation_type*>(0))) == 1;
-  };
-}
-#endif // defined(BOOST_ASIO_HAS_MOVE)
-
 /// Base class for all I/O objects.
-/**
- * @note All I/O objects are non-copyable. However, when using C++0x, certain
- * I/O objects do support move construction and move assignment.
- */
-#if !defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 template <typename IoObjectService>
-#else
-template <typename IoObjectService,
-    bool Movable = detail::service_has_move<IoObjectService>::value>
-#endif
 class basic_io_object
+  : private noncopyable
 {
 public:
   /// The type of the service that will be used to provide I/O operations.
@@ -67,6 +35,20 @@
   /// The underlying implementation type of I/O object.
   typedef typename service_type::implementation_type implementation_type;
 
+  /// (Deprecated: use get_io_service().) Get the io_service associated with
+  /// the object.
+  /**
+   * This function may be used to obtain the io_service object that the I/O
+   * object uses to dispatch handlers for asynchronous operations.
+   *
+   * @return A reference to the io_service object that the I/O object will use
+   * to dispatch handlers. Ownership is not transferred to the caller.
+   */
+  boost::asio::io_service& io_service()
+  {
+    return service.get_io_service();
+  }
+
   /// Get the io_service associated with the object.
   /**
    * This function may be used to obtain the io_service object that the I/O
@@ -84,7 +66,7 @@
   /// Construct a basic_io_object.
   /**
    * Performs:
-   * @code get_service().construct(get_implementation()); @endcode
+   * @code service.construct(implementation); @endcode
    */
   explicit basic_io_object(boost::asio::io_service& io_service)
     : service(boost::asio::use_service<IoObjectService>(io_service))
@@ -92,148 +74,23 @@
     service.construct(implementation);
   }
 
-#if defined(GENERATING_DOCUMENTATION)
-  /// Move-construct a basic_io_object.
-  /**
-   * Performs:
-   * @code get_service().move_construct(
-   *     get_implementation(), other.get_implementation()); @endcode
-   *
-   * @note Available only for services that support movability,
-   */
-  basic_io_object(basic_io_object&& other);
-
-  /// Move-assign a basic_io_object.
-  /**
-   * Performs:
-   * @code get_service().move_assign(get_implementation(),
-   *     other.get_service(), other.get_implementation()); @endcode
-   *
-   * @note Available only for services that support movability,
-   */
-  basic_io_object& operator=(basic_io_object&& other);
-#endif // defined(GENERATING_DOCUMENTATION)
-
   /// Protected destructor to prevent deletion through this type.
   /**
    * Performs:
-   * @code get_service().destroy(get_implementation()); @endcode
+   * @code service.destroy(implementation); @endcode
    */
   ~basic_io_object()
   {
     service.destroy(implementation);
   }
 
-  /// Get the service associated with the I/O object.
-  service_type& get_service()
-  {
-    return service;
-  }
-
-  /// Get the service associated with the I/O object.
-  const service_type& get_service() const
-  {
-    return service;
-  }
-
-  /// (Deprecated: Use get_service().) The service associated with the I/O
-  /// object.
-  /**
-   * @note Available only for services that do not support movability.
-   */
+  /// The service associated with the I/O object.
   service_type& service;
 
-  /// Get the underlying implementation of the I/O object.
-  implementation_type& get_implementation()
-  {
-    return implementation;
-  }
-
-  /// Get the underlying implementation of the I/O object.
-  const implementation_type& get_implementation() const
-  {
-    return implementation;
-  }
-
-  /// (Deprecated: Use get_implementation().) The underlying implementation of
-  /// the I/O object.
+  /// The underlying implementation of the I/O object.
   implementation_type implementation;
-
-private:
-  basic_io_object(const basic_io_object&);
-  basic_io_object& operator=(const basic_io_object&);
 };
 
-#if defined(BOOST_ASIO_HAS_MOVE)
-// Specialisation for movable objects.
-template <typename IoObjectService>
-class basic_io_object<IoObjectService, true>
-{
-public:
-  typedef IoObjectService service_type;
-  typedef typename service_type::implementation_type implementation_type;
-
-  boost::asio::io_service& get_io_service()
-  {
-    return service_->get_io_service();
-  }
-
-protected:
-  explicit basic_io_object(boost::asio::io_service& io_service)
-    : service_(&boost::asio::use_service<IoObjectService>(io_service))
-  {
-    service_->construct(implementation);
-  }
-
-  basic_io_object(basic_io_object&& other)
-    : service_(&other.get_service())
-  {
-    service_->move_construct(implementation, other.implementation);
-  }
-
-  ~basic_io_object()
-  {
-    service_->destroy(implementation);
-  }
-
-  basic_io_object& operator=(basic_io_object&& other)
-  {
-    service_->move_assign(implementation,
-        *other.service_, other.implementation);
-    service_ = other.service_;
-    return *this;
-  }
-
-  service_type& get_service()
-  {
-    return *service_;
-  }
-
-  const service_type& get_service() const
-  {
-    return *service_;
-  }
-
-  implementation_type& get_implementation()
-  {
-    return implementation;
-  }
-
-  const implementation_type& get_implementation() const
-  {
-    return implementation;
-  }
-
-  implementation_type implementation;
-
-private:
-  basic_io_object(const basic_io_object&);
-  void operator=(const basic_io_object&);
-
-  IoObjectService* service_;
-};
-#endif // defined(BOOST_ASIO_HAS_MOVE)
-
 } // namespace asio
 } // namespace boost
 
diff --git a/boost/asio/basic_raw_socket.hpp b/boost/asio/basic_raw_socket.hpp
index b29dd62..1ba5558 100644
--- a/boost/asio/basic_raw_socket.hpp
+++ b/boost/asio/basic_raw_socket.hpp
@@ -2,7 +2,7 @@
 // basic_raw_socket.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // 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)
@@ -15,15 +15,17 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#include <boost/asio/detail/config.hpp>
-#include <cstddef>
-#include <boost/asio/basic_socket.hpp>
-#include <boost/asio/detail/handler_type_requirements.hpp>
-#include <boost/asio/detail/throw_error.hpp>
-#include <boost/asio/error.hpp>
-#include <boost/asio/raw_socket_service.hpp>
+#include <boost/asio/detail/push_options.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
+#include <cstddef>
+#include <boost/config.hpp>
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/basic_socket.hpp>
+#include <boost/asio/raw_socket_service.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/detail/throw_error.hpp>
 
 namespace boost {
 namespace asio {
@@ -43,12 +45,8 @@
   : public basic_socket<Protocol, RawSocketService>
 {
 public:
-  /// (Deprecated: Use native_handle_type.) The native representation of a
-  /// socket.
-  typedef typename RawSocketService::native_handle_type native_type;
-
   /// The native representation of a socket.
-  typedef typename RawSocketService::native_handle_type native_handle_type;
+  typedef typename RawSocketService::native_type native_type;
 
   /// The protocol type.
   typedef Protocol protocol_type;
@@ -126,47 +124,12 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_raw_socket(boost::asio::io_service& io_service,
-      const protocol_type& protocol, const native_handle_type& native_socket)
+      const protocol_type& protocol, const native_type& native_socket)
     : basic_socket<Protocol, RawSocketService>(
         io_service, protocol, native_socket)
   {
   }
 
-#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-  /// Move-construct a basic_raw_socket from another.
-  /**
-   * This constructor moves a raw socket from one object to another.
-   *
-   * @param other The other basic_raw_socket object from which the move
-   * will occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_raw_socket(io_service&) constructor.
-   */
-  basic_raw_socket(basic_raw_socket&& other)
-    : basic_socket<Protocol, RawSocketService>(
-        BOOST_ASIO_MOVE_CAST(basic_raw_socket)(other))
-  {
-  }
-
-  /// Move-assign a basic_raw_socket from another.
-  /**
-   * This assignment operator moves a raw socket from one object to another.
-   *
-   * @param other The other basic_raw_socket object from which the move
-   * will occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_raw_socket(io_service&) constructor.
-   */
-  basic_raw_socket& operator=(basic_raw_socket&& other)
-  {
-    basic_socket<Protocol, RawSocketService>::operator=(
-        BOOST_ASIO_MOVE_CAST(basic_raw_socket)(other));
-    return *this;
-  }
-#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
   /// Send some data on a connected socket.
   /**
    * This function is used to send data on the raw socket. The function call
@@ -192,9 +155,8 @@
   std::size_t send(const ConstBufferSequence& buffers)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().send(
-        this->get_implementation(), buffers, 0, ec);
-    boost::asio::detail::throw_error(ec, "send");
+    std::size_t s = this->service.send(this->implementation, buffers, 0, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -219,9 +181,9 @@
       socket_base::message_flags flags)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().send(
-        this->get_implementation(), buffers, flags, ec);
-    boost::asio::detail::throw_error(ec, "send");
+    std::size_t s = this->service.send(
+        this->implementation, buffers, flags, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -245,8 +207,7 @@
   std::size_t send(const ConstBufferSequence& buffers,
       socket_base::message_flags flags, boost::system::error_code& ec)
   {
-    return this->get_service().send(
-        this->get_implementation(), buffers, flags, ec);
+    return this->service.send(this->implementation, buffers, flags, ec);
   }
 
   /// Start an asynchronous send on a connected socket.
@@ -285,15 +246,9 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
-  void async_send(const ConstBufferSequence& buffers,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
+  void async_send(const ConstBufferSequence& buffers, WriteHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_send(this->get_implementation(),
-        buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+    this->service.async_send(this->implementation, buffers, 0, handler);
   }
 
   /// Start an asynchronous send on a connected socket.
@@ -326,15 +281,9 @@
    */
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_send(const ConstBufferSequence& buffers,
-      socket_base::message_flags flags,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
+      socket_base::message_flags flags, WriteHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_send(this->get_implementation(),
-        buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+    this->service.async_send(this->implementation, buffers, flags, handler);
   }
 
   /// Send raw data to the specified endpoint.
@@ -367,9 +316,9 @@
       const endpoint_type& destination)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().send_to(
-        this->get_implementation(), buffers, destination, 0, ec);
-    boost::asio::detail::throw_error(ec, "send_to");
+    std::size_t s = this->service.send_to(
+        this->implementation, buffers, destination, 0, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -394,9 +343,9 @@
       const endpoint_type& destination, socket_base::message_flags flags)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().send_to(
-        this->get_implementation(), buffers, destination, flags, ec);
-    boost::asio::detail::throw_error(ec, "send_to");
+    std::size_t s = this->service.send_to(
+        this->implementation, buffers, destination, flags, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -421,7 +370,7 @@
       const endpoint_type& destination, socket_base::message_flags flags,
       boost::system::error_code& ec)
   {
-    return this->get_service().send_to(this->get_implementation(),
+    return this->service.send_to(this->implementation,
         buffers, destination, flags, ec);
   }
 
@@ -464,15 +413,10 @@
    */
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_send_to(const ConstBufferSequence& buffers,
-      const endpoint_type& destination,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
+      const endpoint_type& destination, WriteHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_send_to(this->get_implementation(), buffers,
-        destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+    this->service.async_send_to(this->implementation, buffers, destination, 0,
+        handler);
   }
 
   /// Start an asynchronous send.
@@ -505,14 +449,10 @@
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_send_to(const ConstBufferSequence& buffers,
       const endpoint_type& destination, socket_base::message_flags flags,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
+      WriteHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_send_to(this->get_implementation(), buffers,
-        destination, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+    this->service.async_send_to(this->implementation, buffers, destination,
+        flags, handler);
   }
 
   /// Receive some data on a connected socket.
@@ -543,9 +483,9 @@
   std::size_t receive(const MutableBufferSequence& buffers)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().receive(
-        this->get_implementation(), buffers, 0, ec);
-    boost::asio::detail::throw_error(ec, "receive");
+    std::size_t s = this->service.receive(
+        this->implementation, buffers, 0, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -572,9 +512,9 @@
       socket_base::message_flags flags)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().receive(
-        this->get_implementation(), buffers, flags, ec);
-    boost::asio::detail::throw_error(ec, "receive");
+    std::size_t s = this->service.receive(
+        this->implementation, buffers, flags, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -600,8 +540,7 @@
   std::size_t receive(const MutableBufferSequence& buffers,
       socket_base::message_flags flags, boost::system::error_code& ec)
   {
-    return this->get_service().receive(
-        this->get_implementation(), buffers, flags, ec);
+    return this->service.receive(this->implementation, buffers, flags, ec);
   }
 
   /// Start an asynchronous receive on a connected socket.
@@ -641,15 +580,9 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
-  void async_receive(const MutableBufferSequence& buffers,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
+  void async_receive(const MutableBufferSequence& buffers, ReadHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive(this->get_implementation(),
-        buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+    this->service.async_receive(this->implementation, buffers, 0, handler);
   }
 
   /// Start an asynchronous receive on a connected socket.
@@ -682,15 +615,9 @@
    */
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_receive(const MutableBufferSequence& buffers,
-      socket_base::message_flags flags,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
+      socket_base::message_flags flags, ReadHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive(this->get_implementation(),
-        buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+    this->service.async_receive(this->implementation, buffers, flags, handler);
   }
 
   /// Receive raw data with the endpoint of the sender.
@@ -724,9 +651,9 @@
       endpoint_type& sender_endpoint)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().receive_from(
-        this->get_implementation(), buffers, sender_endpoint, 0, ec);
-    boost::asio::detail::throw_error(ec, "receive_from");
+    std::size_t s = this->service.receive_from(
+        this->implementation, buffers, sender_endpoint, 0, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
   
@@ -751,9 +678,9 @@
       endpoint_type& sender_endpoint, socket_base::message_flags flags)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().receive_from(
-        this->get_implementation(), buffers, sender_endpoint, flags, ec);
-    boost::asio::detail::throw_error(ec, "receive_from");
+    std::size_t s = this->service.receive_from(
+        this->implementation, buffers, sender_endpoint, flags, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
   
@@ -778,8 +705,8 @@
       endpoint_type& sender_endpoint, socket_base::message_flags flags,
       boost::system::error_code& ec)
   {
-    return this->get_service().receive_from(this->get_implementation(),
-        buffers, sender_endpoint, flags, ec);
+    return this->service.receive_from(this->implementation, buffers,
+        sender_endpoint, flags, ec);
   }
 
   /// Start an asynchronous receive.
@@ -820,15 +747,10 @@
    */
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_receive_from(const MutableBufferSequence& buffers,
-      endpoint_type& sender_endpoint,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
+      endpoint_type& sender_endpoint, ReadHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive_from(this->get_implementation(), buffers,
-        sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+    this->service.async_receive_from(this->implementation, buffers,
+        sender_endpoint, 0, handler);
   }
 
   /// Start an asynchronous receive.
@@ -863,14 +785,10 @@
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_receive_from(const MutableBufferSequence& buffers,
       endpoint_type& sender_endpoint, socket_base::message_flags flags,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
+      ReadHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive_from(this->get_implementation(), buffers,
-        sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+    this->service.async_receive_from(this->implementation, buffers,
+        sender_endpoint, flags, handler);
   }
 };
 
diff --git a/boost/asio/basic_seq_packet_socket.hpp b/boost/asio/basic_seq_packet_socket.hpp
deleted file mode 100644
index 17e15e7..0000000
--- a/boost/asio/basic_seq_packet_socket.hpp
+++ /dev/null
@@ -1,514 +0,0 @@
-//
-// basic_seq_packet_socket.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-#ifndef BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP
-#define BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include <boost/asio/detail/config.hpp>
-#include <cstddef>
-#include <boost/asio/basic_socket.hpp>
-#include <boost/asio/detail/handler_type_requirements.hpp>
-#include <boost/asio/detail/throw_error.hpp>
-#include <boost/asio/error.hpp>
-#include <boost/asio/seq_packet_socket_service.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
-
-namespace boost {
-namespace asio {
-
-/// Provides sequenced packet socket functionality.
-/**
- * The basic_seq_packet_socket class template provides asynchronous and blocking
- * sequenced packet socket functionality.
- *
- * @par Thread Safety
- * @e Distinct @e objects: Safe.@n
- * @e Shared @e objects: Unsafe.
- */
-template <typename Protocol,
-    typename SeqPacketSocketService = seq_packet_socket_service<Protocol> >
-class basic_seq_packet_socket
-  : public basic_socket<Protocol, SeqPacketSocketService>
-{
-public:
-  /// (Deprecated: Use native_handle_type.) The native representation of a
-  /// socket.
-  typedef typename SeqPacketSocketService::native_handle_type native_type;
-
-  /// The native representation of a socket.
-  typedef typename SeqPacketSocketService::native_handle_type
-    native_handle_type;
-
-  /// The protocol type.
-  typedef Protocol protocol_type;
-
-  /// The endpoint type.
-  typedef typename Protocol::endpoint endpoint_type;
-
-  /// Construct a basic_seq_packet_socket without opening it.
-  /**
-   * This constructor creates a sequenced packet socket without opening it. The
-   * socket needs to be opened and then connected or accepted before data can
-   * be sent or received on it.
-   *
-   * @param io_service The io_service object that the sequenced packet socket
-   * will use to dispatch handlers for any asynchronous operations performed on
-   * the socket.
-   */
-  explicit basic_seq_packet_socket(boost::asio::io_service& io_service)
-    : basic_socket<Protocol, SeqPacketSocketService>(io_service)
-  {
-  }
-
-  /// Construct and open a basic_seq_packet_socket.
-  /**
-   * This constructor creates and opens a sequenced_packet socket. The socket
-   * needs to be connected or accepted before data can be sent or received on
-   * it.
-   *
-   * @param io_service The io_service object that the sequenced packet socket
-   * will use to dispatch handlers for any asynchronous operations performed on
-   * the socket.
-   *
-   * @param protocol An object specifying protocol parameters to be used.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   */
-  basic_seq_packet_socket(boost::asio::io_service& io_service,
-      const protocol_type& protocol)
-    : basic_socket<Protocol, SeqPacketSocketService>(io_service, protocol)
-  {
-  }
-
-  /// Construct a basic_seq_packet_socket, opening it and binding it to the
-  /// given local endpoint.
-  /**
-   * This constructor creates a sequenced packet socket and automatically opens
-   * it bound to the specified endpoint on the local machine. The protocol used
-   * is the protocol associated with the given endpoint.
-   *
-   * @param io_service The io_service object that the sequenced packet socket
-   * will use to dispatch handlers for any asynchronous operations performed on
-   * the socket.
-   *
-   * @param endpoint An endpoint on the local machine to which the sequenced
-   * packet socket will be bound.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   */
-  basic_seq_packet_socket(boost::asio::io_service& io_service,
-      const endpoint_type& endpoint)
-    : basic_socket<Protocol, SeqPacketSocketService>(io_service, endpoint)
-  {
-  }
-
-  /// Construct a basic_seq_packet_socket on an existing native socket.
-  /**
-   * This constructor creates a sequenced packet socket object to hold an
-   * existing native socket.
-   *
-   * @param io_service The io_service object that the sequenced packet socket
-   * will use to dispatch handlers for any asynchronous operations performed on
-   * the socket.
-   *
-   * @param protocol An object specifying protocol parameters to be used.
-   *
-   * @param native_socket The new underlying socket implementation.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   */
-  basic_seq_packet_socket(boost::asio::io_service& io_service,
-      const protocol_type& protocol, const native_handle_type& native_socket)
-    : basic_socket<Protocol, SeqPacketSocketService>(
-        io_service, protocol, native_socket)
-  {
-  }
-
-#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-  /// Move-construct a basic_seq_packet_socket from another.
-  /**
-   * This constructor moves a sequenced packet socket from one object to
-   * another.
-   *
-   * @param other The other basic_seq_packet_socket object from which the move
-   * will occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_seq_packet_socket(io_service&) constructor.
-   */
-  basic_seq_packet_socket(basic_seq_packet_socket&& other)
-    : basic_socket<Protocol, SeqPacketSocketService>(
-        BOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other))
-  {
-  }
-
-  /// Move-assign a basic_seq_packet_socket from another.
-  /**
-   * This assignment operator moves a sequenced packet socket from one object to
-   * another.
-   *
-   * @param other The other basic_seq_packet_socket object from which the move
-   * will occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_seq_packet_socket(io_service&) constructor.
-   */
-  basic_seq_packet_socket& operator=(basic_seq_packet_socket&& other)
-  {
-    basic_socket<Protocol, SeqPacketSocketService>::operator=(
-        BOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other));
-    return *this;
-  }
-#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
-  /// Send some data on the socket.
-  /**
-   * This function is used to send data on the sequenced packet socket. The
-   * function call will block until the data has been sent successfully, or an
-   * until error occurs.
-   *
-   * @param buffers One or more data buffers to be sent on the socket.
-   *
-   * @param flags Flags specifying how the send call is to be made.
-   *
-   * @returns The number of bytes sent.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   *
-   * @par Example
-   * To send a single data buffer use the @ref buffer function as follows:
-   * @code
-   * socket.send(boost::asio::buffer(data, size), 0);
-   * @endcode
-   * See the @ref buffer documentation for information on sending multiple
-   * buffers in one go, and how to use it with arrays, boost::array or
-   * std::vector.
-   */
-  template <typename ConstBufferSequence>
-  std::size_t send(const ConstBufferSequence& buffers,
-      socket_base::message_flags flags)
-  {
-    boost::system::error_code ec;
-    std::size_t s = this->get_service().send(
-        this->get_implementation(), buffers, flags, ec);
-    boost::asio::detail::throw_error(ec, "send");
-    return s;
-  }
-
-  /// Send some data on the socket.
-  /**
-   * This function is used to send data on the sequenced packet socket. The
-   * function call will block the data has been sent successfully, or an until
-   * error occurs.
-   *
-   * @param buffers One or more data buffers to be sent on the socket.
-   *
-   * @param flags Flags specifying how the send call is to be made.
-   *
-   * @param ec Set to indicate what error occurred, if any.
-   *
-   * @returns The number of bytes sent. Returns 0 if an error occurred.
-   *
-   * @note The send operation may not transmit all of the data to the peer.
-   * Consider using the @ref write function if you need to ensure that all data
-   * is written before the blocking operation completes.
-   */
-  template <typename ConstBufferSequence>
-  std::size_t send(const ConstBufferSequence& buffers,
-      socket_base::message_flags flags, boost::system::error_code& ec)
-  {
-    return this->get_service().send(
-        this->get_implementation(), buffers, flags, ec);
-  }
-
-  /// Start an asynchronous send.
-  /**
-   * This function is used to asynchronously send data on the sequenced packet
-   * socket. The function call always returns immediately.
-   *
-   * @param buffers One or more data buffers to be sent on the socket. Although
-   * the buffers object may be copied as necessary, ownership of the underlying
-   * memory blocks is retained by the caller, which must guarantee that they
-   * remain valid until the handler is called.
-   *
-   * @param flags Flags specifying how the send call is to be made.
-   *
-   * @param handler The handler to be called when the send operation completes.
-   * Copies will be made of the handler as required. The function signature of
-   * the handler must be:
-   * @code void handler(
-   *   const boost::system::error_code& error, // Result of operation.
-   *   std::size_t bytes_transferred           // Number of bytes sent.
-   * ); @endcode
-   * Regardless of whether the asynchronous operation completes immediately or
-   * not, the handler will not be invoked from within this function. Invocation
-   * of the handler will be performed in a manner equivalent to using
-   * boost::asio::io_service::post().
-   *
-   * @par Example
-   * To send a single data buffer use the @ref buffer function as follows:
-   * @code
-   * socket.async_send(boost::asio::buffer(data, size), 0, handler);
-   * @endcode
-   * See the @ref buffer documentation for information on sending multiple
-   * buffers in one go, and how to use it with arrays, boost::array or
-   * std::vector.
-   */
-  template <typename ConstBufferSequence, typename WriteHandler>
-  void async_send(const ConstBufferSequence& buffers,
-      socket_base::message_flags flags,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
-  {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_send(this->get_implementation(),
-        buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
-  }
-
-  /// Receive some data on the socket.
-  /**
-   * This function is used to receive data on the sequenced packet socket. The
-   * function call will block until data has been received successfully, or
-   * until an error occurs.
-   *
-   * @param buffers One or more buffers into which the data will be received.
-   *
-   * @param out_flags After the receive call completes, contains flags
-   * associated with the received data. For example, if the
-   * socket_base::message_end_of_record bit is set then the received data marks
-   * the end of a record.
-   *
-   * @returns The number of bytes received.
-   *
-   * @throws boost::system::system_error Thrown on failure. An error code of
-   * boost::asio::error::eof indicates that the connection was closed by the
-   * peer.
-   *
-   * @par Example
-   * To receive into a single data buffer use the @ref buffer function as
-   * follows:
-   * @code
-   * socket.receive(boost::asio::buffer(data, size), out_flags);
-   * @endcode
-   * See the @ref buffer documentation for information on receiving into
-   * multiple buffers in one go, and how to use it with arrays, boost::array or
-   * std::vector.
-   */
-  template <typename MutableBufferSequence>
-  std::size_t receive(const MutableBufferSequence& buffers,
-      socket_base::message_flags& out_flags)
-  {
-    boost::system::error_code ec;
-    std::size_t s = this->get_service().receive(
-        this->get_implementation(), buffers, 0, out_flags, ec);
-    boost::asio::detail::throw_error(ec, "receive");
-    return s;
-  }
-
-  /// Receive some data on the socket.
-  /**
-   * This function is used to receive data on the sequenced packet socket. The
-   * function call will block until data has been received successfully, or
-   * until an error occurs.
-   *
-   * @param buffers One or more buffers into which the data will be received.
-   *
-   * @param in_flags Flags specifying how the receive call is to be made.
-   *
-   * @param out_flags After the receive call completes, contains flags
-   * associated with the received data. For example, if the
-   * socket_base::message_end_of_record bit is set then the received data marks
-   * the end of a record.
-   *
-   * @returns The number of bytes received.
-   *
-   * @throws boost::system::system_error Thrown on failure. An error code of
-   * boost::asio::error::eof indicates that the connection was closed by the
-   * peer.
-   *
-   * @note The receive operation may not receive all of the requested number of
-   * bytes. Consider using the @ref read function if you need to ensure that the
-   * requested amount of data is read before the blocking operation completes.
-   *
-   * @par Example
-   * To receive into a single data buffer use the @ref buffer function as
-   * follows:
-   * @code
-   * socket.receive(boost::asio::buffer(data, size), 0, out_flags);
-   * @endcode
-   * See the @ref buffer documentation for information on receiving into
-   * multiple buffers in one go, and how to use it with arrays, boost::array or
-   * std::vector.
-   */
-  template <typename MutableBufferSequence>
-  std::size_t receive(const MutableBufferSequence& buffers,
-      socket_base::message_flags in_flags,
-      socket_base::message_flags& out_flags)
-  {
-    boost::system::error_code ec;
-    std::size_t s = this->get_service().receive(
-        this->get_implementation(), buffers, in_flags, out_flags, ec);
-    boost::asio::detail::throw_error(ec, "receive");
-    return s;
-  }
-
-  /// Receive some data on a connected socket.
-  /**
-   * This function is used to receive data on the sequenced packet socket. The
-   * function call will block until data has been received successfully, or
-   * until an error occurs.
-   *
-   * @param buffers One or more buffers into which the data will be received.
-   *
-   * @param in_flags Flags specifying how the receive call is to be made.
-   *
-   * @param out_flags After the receive call completes, contains flags
-   * associated with the received data. For example, if the
-   * socket_base::message_end_of_record bit is set then the received data marks
-   * the end of a record.
-   *
-   * @param ec Set to indicate what error occurred, if any.
-   *
-   * @returns The number of bytes received. Returns 0 if an error occurred.
-   *
-   * @note The receive operation may not receive all of the requested number of
-   * bytes. Consider using the @ref read function if you need to ensure that the
-   * requested amount of data is read before the blocking operation completes.
-   */
-  template <typename MutableBufferSequence>
-  std::size_t receive(const MutableBufferSequence& buffers,
-      socket_base::message_flags in_flags,
-      socket_base::message_flags& out_flags, boost::system::error_code& ec)
-  {
-    return this->get_service().receive(this->get_implementation(),
-        buffers, in_flags, out_flags, ec);
-  }
-
-  /// Start an asynchronous receive.
-  /**
-   * This function is used to asynchronously receive data from the sequenced
-   * packet socket. The function call always returns immediately.
-   *
-   * @param buffers One or more buffers into which the data will be received.
-   * Although the buffers object may be copied as necessary, ownership of the
-   * underlying memory blocks is retained by the caller, which must guarantee
-   * that they remain valid until the handler is called.
-   *
-   * @param out_flags Once the asynchronous operation completes, contains flags
-   * associated with the received data. For example, if the
-   * socket_base::message_end_of_record bit is set then the received data marks
-   * the end of a record. The caller must guarantee that the referenced
-   * variable remains valid until the handler is called.
-   *
-   * @param handler The handler to be called when the receive operation
-   * completes. Copies will be made of the handler as required. The function
-   * signature of the handler must be:
-   * @code void handler(
-   *   const boost::system::error_code& error, // Result of operation.
-   *   std::size_t bytes_transferred           // Number of bytes received.
-   * ); @endcode
-   * Regardless of whether the asynchronous operation completes immediately or
-   * not, the handler will not be invoked from within this function. Invocation
-   * of the handler will be performed in a manner equivalent to using
-   * boost::asio::io_service::post().
-   *
-   * @par Example
-   * To receive into a single data buffer use the @ref buffer function as
-   * follows:
-   * @code
-   * socket.async_receive(boost::asio::buffer(data, size), out_flags, handler);
-   * @endcode
-   * See the @ref buffer documentation for information on receiving into
-   * multiple buffers in one go, and how to use it with arrays, boost::array or
-   * std::vector.
-   */
-  template <typename MutableBufferSequence, typename ReadHandler>
-  void async_receive(const MutableBufferSequence& buffers,
-      socket_base::message_flags& out_flags,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
-  {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive(this->get_implementation(), buffers,
-        0, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
-  }
-
-  /// Start an asynchronous receive.
-  /**
-   * This function is used to asynchronously receive data from the sequenced
-   * data socket. The function call always returns immediately.
-   *
-   * @param buffers One or more buffers into which the data will be received.
-   * Although the buffers object may be copied as necessary, ownership of the
-   * underlying memory blocks is retained by the caller, which must guarantee
-   * that they remain valid until the handler is called.
-   *
-   * @param in_flags Flags specifying how the receive call is to be made.
-   *
-   * @param out_flags Once the asynchronous operation completes, contains flags
-   * associated with the received data. For example, if the
-   * socket_base::message_end_of_record bit is set then the received data marks
-   * the end of a record. The caller must guarantee that the referenced
-   * variable remains valid until the handler is called.
-   *
-   * @param handler The handler to be called when the receive operation
-   * completes. Copies will be made of the handler as required. The function
-   * signature of the handler must be:
-   * @code void handler(
-   *   const boost::system::error_code& error, // Result of operation.
-   *   std::size_t bytes_transferred           // Number of bytes received.
-   * ); @endcode
-   * Regardless of whether the asynchronous operation completes immediately or
-   * not, the handler will not be invoked from within this function. Invocation
-   * of the handler will be performed in a manner equivalent to using
-   * boost::asio::io_service::post().
-   *
-   * @par Example
-   * To receive into a single data buffer use the @ref buffer function as
-   * follows:
-   * @code
-   * socket.async_receive(
-   *     boost::asio::buffer(data, size),
-   *     0, out_flags, handler);
-   * @endcode
-   * See the @ref buffer documentation for information on receiving into
-   * multiple buffers in one go, and how to use it with arrays, boost::array or
-   * std::vector.
-   */
-  template <typename MutableBufferSequence, typename ReadHandler>
-  void async_receive(const MutableBufferSequence& buffers,
-      socket_base::message_flags in_flags,
-      socket_base::message_flags& out_flags,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
-  {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_receive(this->get_implementation(), buffers,
-        in_flags, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
-  }
-};
-
-} // namespace asio
-} // namespace boost
-
-#include <boost/asio/detail/pop_options.hpp>
-
-#endif // BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP
diff --git a/boost/asio/basic_serial_port.hpp b/boost/asio/basic_serial_port.hpp
index a94b0e5..339d5df 100644
--- a/boost/asio/basic_serial_port.hpp
+++ b/boost/asio/basic_serial_port.hpp
@@ -2,7 +2,7 @@
 // basic_serial_port.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -16,20 +16,21 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/push_options.hpp>
 
-#if defined(BOOST_ASIO_HAS_SERIAL_PORT) \
-  || defined(GENERATING_DOCUMENTATION)
-
+#include <boost/asio/detail/push_options.hpp>
 #include <string>
+#include <boost/config.hpp>
+#include <boost/asio/detail/pop_options.hpp>
+
 #include <boost/asio/basic_io_object.hpp>
-#include <boost/asio/detail/handler_type_requirements.hpp>
-#include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/serial_port_base.hpp>
 #include <boost/asio/serial_port_service.hpp>
+#include <boost/asio/detail/throw_error.hpp>
 
-#include <boost/asio/detail/push_options.hpp>
+#if defined(BOOST_ASIO_HAS_SERIAL_PORT) \
+  || defined(GENERATING_DOCUMENTATION)
 
 namespace boost {
 namespace asio {
@@ -49,12 +50,8 @@
     public serial_port_base
 {
 public:
-  /// (Deprecated: Use native_handle_type.) The native representation of a
-  /// serial port.
-  typedef typename SerialPortService::native_handle_type native_type;
-
   /// The native representation of a serial port.
-  typedef typename SerialPortService::native_handle_type native_handle_type;
+  typedef typename SerialPortService::native_type native_type;
 
   /// A basic_serial_port is always the lowest layer.
   typedef basic_serial_port<SerialPortService> lowest_layer_type;
@@ -87,8 +84,8 @@
     : basic_io_object<SerialPortService>(io_service)
   {
     boost::system::error_code ec;
-    this->get_service().open(this->get_implementation(), device, ec);
-    boost::asio::detail::throw_error(ec, "open");
+    this->service.open(this->implementation, device, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Construct and open a basic_serial_port.
@@ -107,8 +104,8 @@
     : basic_io_object<SerialPortService>(io_service)
   {
     boost::system::error_code ec;
-    this->get_service().open(this->get_implementation(), device, ec);
-    boost::asio::detail::throw_error(ec, "open");
+    this->service.open(this->implementation, device, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Construct a basic_serial_port on an existing native serial port.
@@ -124,50 +121,14 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_serial_port(boost::asio::io_service& io_service,
-      const native_handle_type& native_serial_port)
+      const native_type& native_serial_port)
     : basic_io_object<SerialPortService>(io_service)
   {
     boost::system::error_code ec;
-    this->get_service().assign(this->get_implementation(),
-        native_serial_port, ec);
-    boost::asio::detail::throw_error(ec, "assign");
+    this->service.assign(this->implementation, native_serial_port, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
-#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-  /// Move-construct a basic_serial_port from another.
-  /**
-   * This constructor moves a serial port from one object to another.
-   *
-   * @param other The other basic_serial_port object from which the move will
-   * occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_serial_port(io_service&) constructor.
-   */
-  basic_serial_port(basic_serial_port&& other)
-    : basic_io_object<SerialPortService>(
-        BOOST_ASIO_MOVE_CAST(basic_serial_port)(other))
-  {
-  }
-
-  /// Move-assign a basic_serial_port from another.
-  /**
-   * This assignment operator moves a serial port from one object to another.
-   *
-   * @param other The other basic_serial_port object from which the move will
-   * occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_serial_port(io_service&) constructor.
-   */
-  basic_serial_port& operator=(basic_serial_port&& other)
-  {
-    basic_io_object<SerialPortService>::operator=(
-        BOOST_ASIO_MOVE_CAST(basic_serial_port)(other));
-    return *this;
-  }
-#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
   /// Get a reference to the lowest layer.
   /**
    * This function returns a reference to the lowest layer in a stack of
@@ -207,8 +168,8 @@
   void open(const std::string& device)
   {
     boost::system::error_code ec;
-    this->get_service().open(this->get_implementation(), device, ec);
-    boost::asio::detail::throw_error(ec, "open");
+    this->service.open(this->implementation, device, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Open the serial port using the specified device name.
@@ -223,7 +184,7 @@
   boost::system::error_code open(const std::string& device,
       boost::system::error_code& ec)
   {
-    return this->get_service().open(this->get_implementation(), device, ec);
+    return this->service.open(this->implementation, device, ec);
   }
 
   /// Assign an existing native serial port to the serial port.
@@ -234,12 +195,11 @@
    *
    * @throws boost::system::system_error Thrown on failure.
    */
-  void assign(const native_handle_type& native_serial_port)
+  void assign(const native_type& native_serial_port)
   {
     boost::system::error_code ec;
-    this->get_service().assign(this->get_implementation(),
-        native_serial_port, ec);
-    boost::asio::detail::throw_error(ec, "assign");
+    this->service.assign(this->implementation, native_serial_port, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Assign an existing native serial port to the serial port.
@@ -250,17 +210,16 @@
    *
    * @param ec Set to indicate what error occurred, if any.
    */
-  boost::system::error_code assign(const native_handle_type& native_serial_port,
+  boost::system::error_code assign(const native_type& native_serial_port,
       boost::system::error_code& ec)
   {
-    return this->get_service().assign(this->get_implementation(),
-        native_serial_port, ec);
+    return this->service.assign(this->implementation, native_serial_port, ec);
   }
 
   /// Determine whether the serial port is open.
   bool is_open() const
   {
-    return this->get_service().is_open(this->get_implementation());
+    return this->service.is_open(this->implementation);
   }
 
   /// Close the serial port.
@@ -274,8 +233,8 @@
   void close()
   {
     boost::system::error_code ec;
-    this->get_service().close(this->get_implementation(), ec);
-    boost::asio::detail::throw_error(ec, "close");
+    this->service.close(this->implementation, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Close the serial port.
@@ -288,19 +247,7 @@
    */
   boost::system::error_code close(boost::system::error_code& ec)
   {
-    return this->get_service().close(this->get_implementation(), ec);
-  }
-
-  /// (Deprecated: Use native_handle().) Get the native serial port
-  /// representation.
-  /**
-   * This function may be used to obtain the underlying representation of the
-   * serial port. This is intended to allow access to native serial port
-   * functionality that is not otherwise provided.
-   */
-  native_type native()
-  {
-    return this->get_service().native_handle(this->get_implementation());
+    return this->service.close(this->implementation, ec);
   }
 
   /// Get the native serial port representation.
@@ -309,9 +256,9 @@
    * serial port. This is intended to allow access to native serial port
    * functionality that is not otherwise provided.
    */
-  native_handle_type native_handle()
+  native_type native()
   {
-    return this->get_service().native_handle(this->get_implementation());
+    return this->service.native(this->implementation);
   }
 
   /// Cancel all asynchronous operations associated with the serial port.
@@ -325,8 +272,8 @@
   void cancel()
   {
     boost::system::error_code ec;
-    this->get_service().cancel(this->get_implementation(), ec);
-    boost::asio::detail::throw_error(ec, "cancel");
+    this->service.cancel(this->implementation, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Cancel all asynchronous operations associated with the serial port.
@@ -339,7 +286,7 @@
    */
   boost::system::error_code cancel(boost::system::error_code& ec)
   {
-    return this->get_service().cancel(this->get_implementation(), ec);
+    return this->service.cancel(this->implementation, ec);
   }
 
   /// Send a break sequence to the serial port.
@@ -352,8 +299,8 @@
   void send_break()
   {
     boost::system::error_code ec;
-    this->get_service().send_break(this->get_implementation(), ec);
-    boost::asio::detail::throw_error(ec, "send_break");
+    this->service.send_break(this->implementation, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Send a break sequence to the serial port.
@@ -365,7 +312,7 @@
    */
   boost::system::error_code send_break(boost::system::error_code& ec)
   {
-    return this->get_service().send_break(this->get_implementation(), ec);
+    return this->service.send_break(this->implementation, ec);
   }
 
   /// Set an option on the serial port.
@@ -387,8 +334,8 @@
   void set_option(const SettableSerialPortOption& option)
   {
     boost::system::error_code ec;
-    this->get_service().set_option(this->get_implementation(), option, ec);
-    boost::asio::detail::throw_error(ec, "set_option");
+    this->service.set_option(this->implementation, option, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Set an option on the serial port.
@@ -410,8 +357,7 @@
   boost::system::error_code set_option(const SettableSerialPortOption& option,
       boost::system::error_code& ec)
   {
-    return this->get_service().set_option(
-        this->get_implementation(), option, ec);
+    return this->service.set_option(this->implementation, option, ec);
   }
 
   /// Get an option from the serial port.
@@ -434,8 +380,8 @@
   void get_option(GettableSerialPortOption& option)
   {
     boost::system::error_code ec;
-    this->get_service().get_option(this->get_implementation(), option, ec);
-    boost::asio::detail::throw_error(ec, "get_option");
+    this->service.get_option(this->implementation, option, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Get an option from the serial port.
@@ -458,8 +404,7 @@
   boost::system::error_code get_option(GettableSerialPortOption& option,
       boost::system::error_code& ec)
   {
-    return this->get_service().get_option(
-        this->get_implementation(), option, ec);
+    return this->service.get_option(this->implementation, option, ec);
   }
 
   /// Write some data to the serial port.
@@ -493,9 +438,8 @@
   std::size_t write_some(const ConstBufferSequence& buffers)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().write_some(
-        this->get_implementation(), buffers, ec);
-    boost::asio::detail::throw_error(ec, "write_some");
+    std::size_t s = this->service.write_some(this->implementation, buffers, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -519,8 +463,7 @@
   std::size_t write_some(const ConstBufferSequence& buffers,
       boost::system::error_code& ec)
   {
-    return this->get_service().write_some(
-        this->get_implementation(), buffers, ec);
+    return this->service.write_some(this->implementation, buffers, ec);
   }
 
   /// Start an asynchronous write.
@@ -560,14 +503,9 @@
    */
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_write_some(const ConstBufferSequence& buffers,
-      BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
+      WriteHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a WriteHandler.
-    BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
-
-    this->get_service().async_write_some(this->get_implementation(),
-        buffers, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+    this->service.async_write_some(this->implementation, buffers, handler);
   }
 
   /// Read some data from the serial port.
@@ -602,9 +540,8 @@
   std::size_t read_some(const MutableBufferSequence& buffers)
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().read_some(
-        this->get_implementation(), buffers, ec);
-    boost::asio::detail::throw_error(ec, "read_some");
+    std::size_t s = this->service.read_some(this->implementation, buffers, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -629,8 +566,7 @@
   std::size_t read_some(const MutableBufferSequence& buffers,
       boost::system::error_code& ec)
   {
-    return this->get_service().read_some(
-        this->get_implementation(), buffers, ec);
+    return this->service.read_some(this->implementation, buffers, ec);
   }
 
   /// Start an asynchronous read.
@@ -671,23 +607,18 @@
    */
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_read_some(const MutableBufferSequence& buffers,
-      BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
+      ReadHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ReadHandler.
-    BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
-
-    this->get_service().async_read_some(this->get_implementation(),
-        buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+    this->service.async_read_some(this->implementation, buffers, handler);
   }
 };
 
 } // namespace asio
 } // namespace boost
 
-#include <boost/asio/detail/pop_options.hpp>
-
 #endif // defined(BOOST_ASIO_HAS_SERIAL_PORT)
        //   || defined(GENERATING_DOCUMENTATION)
 
+#include <boost/asio/detail/pop_options.hpp>
+
 #endif // BOOST_ASIO_BASIC_SERIAL_PORT_HPP
diff --git a/boost/asio/basic_signal_set.hpp b/boost/asio/basic_signal_set.hpp
deleted file mode 100644
index 2f84a14..0000000
--- a/boost/asio/basic_signal_set.hpp
+++ /dev/null
@@ -1,384 +0,0 @@
-//
-// basic_signal_set.hpp
-// ~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-#ifndef BOOST_ASIO_BASIC_SIGNAL_SET_HPP
-#define BOOST_ASIO_BASIC_SIGNAL_SET_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include <boost/asio/detail/config.hpp>
-
-#include <boost/asio/basic_io_object.hpp>
-#include <boost/asio/detail/handler_type_requirements.hpp>
-#include <boost/asio/detail/throw_error.hpp>
-#include <boost/asio/error.hpp>
-#include <boost/asio/signal_set_service.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
-
-namespace boost {
-namespace asio {
-
-/// Provides signal functionality.
-/**
- * The basic_signal_set class template provides the ability to perform an
- * asynchronous wait for one or more signals to occur.
- *
- * Most applications will use the boost::asio::signal_set typedef.
- *
- * @par Thread Safety
- * @e Distinct @e objects: Safe.@n
- * @e Shared @e objects: Unsafe.
- *
- * @par Example
- * Performing an asynchronous wait:
- * @code
- * void handler(
- *     const boost::system::error_code& error,
- *     int signal_number)
- * {
- *   if (!error)
- *   {
- *     // A signal occurred.
- *   }
- * }
- *
- * ...
- *
- * // Construct a signal set registered for process termination.
- * boost::asio::signal_set signals(io_service, SIGINT, SIGTERM);
- *
- * // Start an asynchronous wait for one of the signals to occur.
- * signals.async_wait(handler);
- * @endcode
- *
- * @par Queueing of signal notifications
- *
- * If a signal is registered with a signal_set, and the signal occurs when
- * there are no waiting handlers, then the signal notification is queued. The
- * next async_wait operation on that signal_set will dequeue the notification.
- * If multiple notifications are queued, subsequent async_wait operations
- * dequeue them one at a time. Signal notifications are dequeued in order of
- * ascending signal number.
- *
- * If a signal number is removed from a signal_set (using the @c remove or @c
- * erase member functions) then any queued notifications for that signal are
- * discarded.
- *
- * @par Multiple registration of signals
- *
- * The same signal number may be registered with different signal_set objects.
- * When the signal occurs, one handler is called for each signal_set object.
- *
- * Note that multiple registration only works for signals that are registered
- * using Asio. The application must not also register a signal handler using
- * functions such as @c signal() or @c sigaction().
- *
- * @par Signal masking on POSIX platforms
- *
- * POSIX allows signals to be blocked using functions such as @c sigprocmask()
- * and @c pthread_sigmask(). For signals to be delivered, programs must ensure
- * that any signals registered using signal_set objects are unblocked in at
- * least one thread.
- */
-template <typename SignalSetService = signal_set_service>
-class basic_signal_set
-  : public basic_io_object<SignalSetService>
-{
-public:
-  /// Construct a signal set without adding any signals.
-  /**
-   * This constructor creates a signal set without registering for any signals.
-   *
-   * @param io_service The io_service object that the signal set will use to
-   * dispatch handlers for any asynchronous operations performed on the set.
-   */
-  explicit basic_signal_set(boost::asio::io_service& io_service)
-    : basic_io_object<SignalSetService>(io_service)
-  {
-  }
-
-  /// Construct a signal set and add one signal.
-  /**
-   * This constructor creates a signal set and registers for one signal.
-   *
-   * @param io_service The io_service object that the signal set will use to
-   * dispatch handlers for any asynchronous operations performed on the set.
-   *
-   * @param signal_number_1 The signal number to be added.
-   *
-   * @note This constructor is equivalent to performing:
-   * @code boost::asio::signal_set signals(io_service);
-   * signals.add(signal_number_1); @endcode
-   */
-  basic_signal_set(boost::asio::io_service& io_service, int signal_number_1)
-    : basic_io_object<SignalSetService>(io_service)
-  {
-    boost::system::error_code ec;
-    this->service.add(this->implementation, signal_number_1, ec);
-    boost::asio::detail::throw_error(ec, "add");
-  }
-
-  /// Construct a signal set and add two signals.
-  /**
-   * This constructor creates a signal set and registers for two signals.
-   *
-   * @param io_service The io_service object that the signal set will use to
-   * dispatch handlers for any asynchronous operations performed on the set.
-   *
-   * @param signal_number_1 The first signal number to be added.
-   *
-   * @param signal_number_2 The second signal number to be added.
-   *
-   * @note This constructor is equivalent to performing:
-   * @code boost::asio::signal_set signals(io_service);
-   * signals.add(signal_number_1);
-   * signals.add(signal_number_2); @endcode
-   */
-  basic_signal_set(boost::asio::io_service& io_service, int signal_number_1,
-      int signal_number_2)
-    : basic_io_object<SignalSetService>(io_service)
-  {
-    boost::system::error_code ec;
-    this->service.add(this->implementation, signal_number_1, ec);
-    boost::asio::detail::throw_error(ec, "add");
-    this->service.add(this->implementation, signal_number_2, ec);
-    boost::asio::detail::throw_error(ec, "add");
-  }
-
-  /// Construct a signal set and add three signals.
-  /**
-   * This constructor creates a signal set and registers for three signals.
-   *
-   * @param io_service The io_service object that the signal set will use to
-   * dispatch handlers for any asynchronous operations performed on the set.
-   *
-   * @param signal_number_1 The first signal number to be added.
-   *
-   * @param signal_number_2 The second signal number to be added.
-   *
-   * @param signal_number_3 The third signal number to be added.
-   *
-   * @note This constructor is equivalent to performing:
-   * @code boost::asio::signal_set signals(io_service);
-   * signals.add(signal_number_1);
-   * signals.add(signal_number_2);
-   * signals.add(signal_number_3); @endcode
-   */
-  basic_signal_set(boost::asio::io_service& io_service, int signal_number_1,
-      int signal_number_2, int signal_number_3)
-    : basic_io_object<SignalSetService>(io_service)
-  {
-    boost::system::error_code ec;
-    this->service.add(this->implementation, signal_number_1, ec);
-    boost::asio::detail::throw_error(ec, "add");
-    this->service.add(this->implementation, signal_number_2, ec);
-    boost::asio::detail::throw_error(ec, "add");
-    this->service.add(this->implementation, signal_number_3, ec);
-    boost::asio::detail::throw_error(ec, "add");
-  }
-
-  /// Add a signal to a signal_set.
-  /**
-   * This function adds the specified signal to the set. It has no effect if the
-   * signal is already in the set.
-   *
-   * @param signal_number The signal to be added to the set.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   */
-  void add(int signal_number)
-  {
-    boost::system::error_code ec;
-    this->service.add(this->implementation, signal_number, ec);
-    boost::asio::detail::throw_error(ec, "add");
-  }
-
-  /// Add a signal to a signal_set.
-  /**
-   * This function adds the specified signal to the set. It has no effect if the
-   * signal is already in the set.
-   *
-   * @param signal_number The signal to be added to the set.
-   *
-   * @param ec Set to indicate what error occurred, if any.
-   */
-  boost::system::error_code add(int signal_number,
-      boost::system::error_code& ec)
-  {
-    return this->service.add(this->implementation, signal_number, ec);
-  }
-
-  /// Remove a signal from a signal_set.
-  /**
-   * This function removes the specified signal from the set. It has no effect
-   * if the signal is not in the set.
-   *
-   * @param signal_number The signal to be removed from the set.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   *
-   * @note Removes any notifications that have been queued for the specified
-   * signal number.
-   */
-  void remove(int signal_number)
-  {
-    boost::system::error_code ec;
-    this->service.remove(this->implementation, signal_number, ec);
-    boost::asio::detail::throw_error(ec, "remove");
-  }
-
-  /// Remove a signal from a signal_set.
-  /**
-   * This function removes the specified signal from the set. It has no effect
-   * if the signal is not in the set.
-   *
-   * @param signal_number The signal to be removed from the set.
-   *
-   * @param ec Set to indicate what error occurred, if any.
-   *
-   * @note Removes any notifications that have been queued for the specified
-   * signal number.
-   */
-  boost::system::error_code remove(int signal_number,
-      boost::system::error_code& ec)
-  {
-    return this->service.remove(this->implementation, signal_number, ec);
-  }
-
-  /// Remove all signals from a signal_set.
-  /**
-   * This function removes all signals from the set. It has no effect if the set
-   * is already empty.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   *
-   * @note Removes all queued notifications.
-   */
-  void clear()
-  {
-    boost::system::error_code ec;
-    this->service.clear(this->implementation, ec);
-    boost::asio::detail::throw_error(ec, "clear");
-  }
-
-  /// Remove all signals from a signal_set.
-  /**
-   * This function removes all signals from the set. It has no effect if the set
-   * is already empty.
-   *
-   * @param ec Set to indicate what error occurred, if any.
-   *
-   * @note Removes all queued notifications.
-   */
-  boost::system::error_code clear(boost::system::error_code& ec)
-  {
-    return this->service.clear(this->implementation, ec);
-  }
-
-  /// Cancel all operations associated with the signal set.
-  /**
-   * This function forces the completion of any pending asynchronous wait
-   * operations against the signal set. The handler for each cancelled
-   * operation will be invoked with the boost::asio::error::operation_aborted
-   * error code.
-   *
-   * Cancellation does not alter the set of registered signals.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   *
-   * @note If a registered signal occurred before cancel() is called, then the
-   * handlers for asynchronous wait operations will:
-   *
-   * @li have already been invoked; or
-   *
-   * @li have been queued for invocation in the near future.
-   *
-   * These handlers can no longer be cancelled, and therefore are passed an
-   * error code that indicates the successful completion of the wait operation.
-   */
-  void cancel()
-  {
-    boost::system::error_code ec;
-    this->service.cancel(this->implementation, ec);
-    boost::asio::detail::throw_error(ec, "cancel");
-  }
-
-  /// Cancel all operations associated with the signal set.
-  /**
-   * This function forces the completion of any pending asynchronous wait
-   * operations against the signal set. The handler for each cancelled
-   * operation will be invoked with the boost::asio::error::operation_aborted
-   * error code.
-   *
-   * Cancellation does not alter the set of registered signals.
-   *
-   * @param ec Set to indicate what error occurred, if any.
-   *
-   * @note If a registered signal occurred before cancel() is called, then the
-   * handlers for asynchronous wait operations will:
-   *
-   * @li have already been invoked; or
-   *
-   * @li have been queued for invocation in the near future.
-   *
-   * These handlers can no longer be cancelled, and therefore are passed an
-   * error code that indicates the successful completion of the wait operation.
-   */
-  boost::system::error_code cancel(boost::system::error_code& ec)
-  {
-    return this->service.cancel(this->implementation, ec);
-  }
-
-  /// Start an asynchronous operation to wait for a signal to be delivered.
-  /**
-   * This function may be used to initiate an asynchronous wait against the
-   * signal set. It always returns immediately.
-   *
-   * For each call to async_wait(), the supplied handler will be called exactly
-   * once. The handler will be called when:
-   *
-   * @li One of the registered signals in the signal set occurs; or
-   *
-   * @li The signal set was cancelled, in which case the handler is passed the
-   * error code boost::asio::error::operation_aborted.
-   *
-   * @param handler The handler to be called when the signal occurs. Copies
-   * will be made of the handler as required. The function signature of the
-   * handler must be:
-   * @code void handler(
-   *   const boost::system::error_code& error, // Result of operation.
-   *   int signal_number // Indicates which signal occurred.
-   * ); @endcode
-   * Regardless of whether the asynchronous operation completes immediately or
-   * not, the handler will not be invoked from within this function. Invocation
-   * of the handler will be performed in a manner equivalent to using
-   * boost::asio::io_service::post().
-   */
-  template <typename SignalHandler>
-  void async_wait(BOOST_ASIO_MOVE_ARG(SignalHandler) handler)
-  {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a SignalHandler.
-    BOOST_ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check;
-
-    this->service.async_wait(this->implementation,
-        BOOST_ASIO_MOVE_CAST(SignalHandler)(handler));
-  }
-};
-
-} // namespace asio
-} // namespace boost
-
-#include <boost/asio/detail/pop_options.hpp>
-
-#endif // BOOST_ASIO_BASIC_SIGNAL_SET_HPP
diff --git a/boost/asio/basic_socket.hpp b/boost/asio/basic_socket.hpp
index 28c5be1..c991132 100644
--- a/boost/asio/basic_socket.hpp
+++ b/boost/asio/basic_socket.hpp
@@ -2,7 +2,7 @@
 // basic_socket.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // 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)
@@ -15,14 +15,16 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#include <boost/asio/detail/config.hpp>
-#include <boost/asio/basic_io_object.hpp>
-#include <boost/asio/detail/handler_type_requirements.hpp>
-#include <boost/asio/detail/throw_error.hpp>
-#include <boost/asio/error.hpp>
-#include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/push_options.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
+#include <boost/config.hpp>
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/basic_io_object.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/throw_error.hpp>
 
 namespace boost {
 namespace asio {
@@ -42,12 +44,8 @@
     public socket_base
 {
 public:
-  /// (Deprecated: Use native_handle_type.) The native representation of a
-  /// socket.
-  typedef typename SocketService::native_handle_type native_type;
-
   /// The native representation of a socket.
-  typedef typename SocketService::native_handle_type native_handle_type;
+  typedef typename SocketService::native_type native_type;
 
   /// The protocol type.
   typedef Protocol protocol_type;
@@ -86,8 +84,8 @@
     : basic_io_object<SocketService>(io_service)
   {
     boost::system::error_code ec;
-    this->get_service().open(this->get_implementation(), protocol, ec);
-    boost::asio::detail::throw_error(ec, "open");
+    this->service.open(this->implementation, protocol, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Construct a basic_socket, opening it and binding it to the given local
@@ -110,11 +108,10 @@
     : basic_io_object<SocketService>(io_service)
   {
     boost::system::error_code ec;
-    const protocol_type protocol = endpoint.protocol();
-    this->get_service().open(this->get_implementation(), protocol, ec);
-    boost::asio::detail::throw_error(ec, "open");
-    this->get_service().bind(this->get_implementation(), endpoint, ec);
-    boost::asio::detail::throw_error(ec, "bind");
+    this->service.open(this->implementation, endpoint.protocol(), ec);
+    boost::asio::detail::throw_error(ec);
+    this->service.bind(this->implementation, endpoint, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Construct a basic_socket on an existing native socket.
@@ -131,50 +128,14 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_socket(boost::asio::io_service& io_service,
-      const protocol_type& protocol, const native_handle_type& native_socket)
+      const protocol_type& protocol, const native_type& native_socket)
     : basic_io_object<SocketService>(io_service)
   {
     boost::system::error_code ec;
-    this->get_service().assign(this->get_implementation(),
-        protocol, native_socket, ec);
-    boost::asio::detail::throw_error(ec, "assign");
+    this->service.assign(this->implementation, protocol, native_socket, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
-#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-  /// Move-construct a basic_socket from another.
-  /**
-   * This constructor moves a socket from one object to another.
-   *
-   * @param other The other basic_socket object from which the move will
-   * occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_socket(io_service&) constructor.
-   */
-  basic_socket(basic_socket&& other)
-    : basic_io_object<SocketService>(
-        BOOST_ASIO_MOVE_CAST(basic_socket)(other))
-  {
-  }
-
-  /// Move-assign a basic_socket from another.
-  /**
-   * This assignment operator moves a socket from one object to another.
-   *
-   * @param other The other basic_socket object from which the move will
-   * occur.
-   *
-   * @note Following the move, the moved-from object is in the same state as if
-   * constructed using the @c basic_socket(io_service&) constructor.
-   */
-  basic_socket& operator=(basic_socket&& other)
-  {
-    basic_io_object<SocketService>::operator=(
-        BOOST_ASIO_MOVE_CAST(basic_socket)(other));
-    return *this;
-  }
-#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
   /// Get a reference to the lowest layer.
   /**
    * This function returns a reference to the lowest layer in a stack of
@@ -220,8 +181,8 @@
   void open(const protocol_type& protocol = protocol_type())
   {
     boost::system::error_code ec;
-    this->get_service().open(this->get_implementation(), protocol, ec);
-    boost::asio::detail::throw_error(ec, "open");
+    this->service.open(this->implementation, protocol, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Open the socket using the specified protocol.
@@ -246,7 +207,7 @@
   boost::system::error_code open(const protocol_type& protocol,
       boost::system::error_code& ec)
   {
-    return this->get_service().open(this->get_implementation(), protocol, ec);
+    return this->service.open(this->implementation, protocol, ec);
   }
 
   /// Assign an existing native socket to the socket.
@@ -259,13 +220,11 @@
    *
    * @throws boost::system::system_error Thrown on failure.
    */
-  void assign(const protocol_type& protocol,
-      const native_handle_type& native_socket)
+  void assign(const protocol_type& protocol, const native_type& native_socket)
   {
     boost::system::error_code ec;
-    this->get_service().assign(this->get_implementation(),
-        protocol, native_socket, ec);
-    boost::asio::detail::throw_error(ec, "assign");
+    this->service.assign(this->implementation, protocol, native_socket, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Assign an existing native socket to the socket.
@@ -279,16 +238,16 @@
    * @param ec Set to indicate what error occurred, if any.
    */
   boost::system::error_code assign(const protocol_type& protocol,
-      const native_handle_type& native_socket, boost::system::error_code& ec)
+      const native_type& native_socket, boost::system::error_code& ec)
   {
-    return this->get_service().assign(this->get_implementation(),
+    return this->service.assign(this->implementation,
         protocol, native_socket, ec);
   }
 
   /// Determine whether the socket is open.
   bool is_open() const
   {
-    return this->get_service().is_open(this->get_implementation());
+    return this->service.is_open(this->implementation);
   }
 
   /// Close the socket.
@@ -297,8 +256,7 @@
    * or connect operations will be cancelled immediately, and will complete
    * with the boost::asio::error::operation_aborted error.
    *
-   * @throws boost::system::system_error Thrown on failure. Note that, even if
-   * the function indicates an error, the underlying descriptor is closed.
+   * @throws boost::system::system_error Thrown on failure.
    *
    * @note For portable behaviour with respect to graceful closure of a
    * connected socket, call shutdown() before closing the socket.
@@ -306,8 +264,8 @@
   void close()
   {
     boost::system::error_code ec;
-    this->get_service().close(this->get_implementation(), ec);
-    boost::asio::detail::throw_error(ec, "close");
+    this->service.close(this->implementation, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Close the socket.
@@ -316,8 +274,7 @@
    * or connect operations will be cancelled immediately, and will complete
    * with the boost::asio::error::operation_aborted error.
    *
-   * @param ec Set to indicate what error occurred, if any. Note that, even if
-   * the function indicates an error, the underlying descriptor is closed.
+   * @param ec Set to indicate what error occurred, if any.
    *
    * @par Example
    * @code
@@ -336,18 +293,7 @@
    */
   boost::system::error_code close(boost::system::error_code& ec)
   {
-    return this->get_service().close(this->get_implementation(), ec);
-  }
-
-  /// (Deprecated: Use native_handle().) Get the native socket representation.
-  /**
-   * This function may be used to obtain the underlying representation of the
-   * socket. This is intended to allow access to native socket functionality
-   * that is not otherwise provided.
-   */
-  native_type native()
-  {
-    return this->get_service().native_handle(this->get_implementation());
+    return this->service.close(this->implementation, ec);
   }
 
   /// Get the native socket representation.
@@ -356,9 +302,9 @@
    * socket. This is intended to allow access to native socket functionality
    * that is not otherwise provided.
    */
-  native_handle_type native_handle()
+  native_type native()
   {
-    return this->get_service().native_handle(this->get_implementation());
+    return this->service.native(this->implementation);
   }
 
   /// Cancel all asynchronous operations associated with the socket.
@@ -405,8 +351,8 @@
   void cancel()
   {
     boost::system::error_code ec;
-    this->get_service().cancel(this->get_implementation(), ec);
-    boost::asio::detail::throw_error(ec, "cancel");
+    this->service.cancel(this->implementation, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Cancel all asynchronous operations associated with the socket.
@@ -452,7 +398,7 @@
 #endif
   boost::system::error_code cancel(boost::system::error_code& ec)
   {
-    return this->get_service().cancel(this->get_implementation(), ec);
+    return this->service.cancel(this->implementation, ec);
   }
 
   /// Determine whether the socket is at the out-of-band data mark.
@@ -468,8 +414,8 @@
   bool at_mark() const
   {
     boost::system::error_code ec;
-    bool b = this->get_service().at_mark(this->get_implementation(), ec);
-    boost::asio::detail::throw_error(ec, "at_mark");
+    bool b = this->service.at_mark(this->implementation, ec);
+    boost::asio::detail::throw_error(ec);
     return b;
   }
 
@@ -485,7 +431,7 @@
    */
   bool at_mark(boost::system::error_code& ec) const
   {
-    return this->get_service().at_mark(this->get_implementation(), ec);
+    return this->service.at_mark(this->implementation, ec);
   }
 
   /// Determine the number of bytes available for reading.
@@ -501,9 +447,8 @@
   std::size_t available() const
   {
     boost::system::error_code ec;
-    std::size_t s = this->get_service().available(
-        this->get_implementation(), ec);
-    boost::asio::detail::throw_error(ec, "available");
+    std::size_t s = this->service.available(this->implementation, ec);
+    boost::asio::detail::throw_error(ec);
     return s;
   }
 
@@ -519,7 +464,7 @@
    */
   std::size_t available(boost::system::error_code& ec) const
   {
-    return this->get_service().available(this->get_implementation(), ec);
+    return this->service.available(this->implementation, ec);
   }
 
   /// Bind the socket to the given local endpoint.
@@ -543,8 +488,8 @@
   void bind(const endpoint_type& endpoint)
   {
     boost::system::error_code ec;
-    this->get_service().bind(this->get_implementation(), endpoint, ec);
-    boost::asio::detail::throw_error(ec, "bind");
+    this->service.bind(this->implementation, endpoint, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Bind the socket to the given local endpoint.
@@ -573,7 +518,7 @@
   boost::system::error_code bind(const endpoint_type& endpoint,
       boost::system::error_code& ec)
   {
-    return this->get_service().bind(this->get_implementation(), endpoint, ec);
+    return this->service.bind(this->implementation, endpoint, ec);
   }
 
   /// Connect the socket to the specified endpoint.
@@ -604,12 +549,11 @@
     boost::system::error_code ec;
     if (!is_open())
     {
-      this->get_service().open(this->get_implementation(),
-          peer_endpoint.protocol(), ec);
-      boost::asio::detail::throw_error(ec, "connect");
+      this->service.open(this->implementation, peer_endpoint.protocol(), ec);
+      boost::asio::detail::throw_error(ec);
     }
-    this->get_service().connect(this->get_implementation(), peer_endpoint, ec);
-    boost::asio::detail::throw_error(ec, "connect");
+    this->service.connect(this->implementation, peer_endpoint, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Connect the socket to the specified endpoint.
@@ -645,15 +589,14 @@
   {
     if (!is_open())
     {
-      if (this->get_service().open(this->get_implementation(),
+      if (this->service.open(this->implementation,
             peer_endpoint.protocol(), ec))
       {
         return ec;
       }
     }
 
-    return this->get_service().connect(
-        this->get_implementation(), peer_endpoint, ec);
+    return this->service.connect(this->implementation, peer_endpoint, ec);
   }
 
   /// Start an asynchronous connect.
@@ -698,28 +641,21 @@
    * @endcode
    */
   template <typename ConnectHandler>
-  void async_connect(const endpoint_type& peer_endpoint,
-      BOOST_ASIO_MOVE_ARG(ConnectHandler) handler)
+  void async_connect(const endpoint_type& peer_endpoint, ConnectHandler handler)
   {
-    // If you get an error on the following line it means that your handler does
-    // not meet the documented type requirements for a ConnectHandler.
-    BOOST_ASIO_CONNECT_HANDLER_CHECK(ConnectHandler, handler) type_check;
-
     if (!is_open())
     {
       boost::system::error_code ec;
-      const protocol_type protocol = peer_endpoint.protocol();
-      if (this->get_service().open(this->get_implementation(), protocol, ec))
+      if (this->service.open(this->implementation,
+            peer_endpoint.protocol(), ec))
       {
         this->get_io_service().post(
-            boost::asio::detail::bind_handler(
-              BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler), ec));
+            boost::asio::detail::bind_handler(handler, ec));
         return;
       }
     }
 
-    this->get_service().async_connect(this->get_implementation(),
-        peer_endpoint, BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
+    this->service.async_connect(this->implementation, peer_endpoint, handler);
   }
 
   /// Set an option on the socket.
@@ -760,8 +696,8 @@
   void set_option(const SettableSocketOption& option)
   {
     boost::system::error_code ec;
-    this->get_service().set_option(this->get_implementation(), option, ec);
-    boost::asio::detail::throw_error(ec, "set_option");
+    this->service.set_option(this->implementation, option, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Set an option on the socket.
@@ -807,8 +743,7 @@
   boost::system::error_code set_option(const SettableSocketOption& option,
       boost::system::error_code& ec)
   {
-    return this->get_service().set_option(
-        this->get_implementation(), option, ec);
+    return this->service.set_option(this->implementation, option, ec);
   }
 
   /// Get an option from the socket.
@@ -850,8 +785,8 @@
   void get_option(GettableSocketOption& option) const
   {
     boost::system::error_code ec;
-    this->get_service().get_option(this->get_implementation(), option, ec);
-    boost::asio::detail::throw_error(ec, "get_option");
+    this->service.get_option(this->implementation, option, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Get an option from the socket.
@@ -898,8 +833,7 @@
   boost::system::error_code get_option(GettableSocketOption& option,
       boost::system::error_code& ec) const
   {
-    return this->get_service().get_option(
-        this->get_implementation(), option, ec);
+    return this->service.get_option(this->implementation, option, ec);
   }
 
   /// Perform an IO control command on the socket.
@@ -928,8 +862,8 @@
   void io_control(IoControlCommand& command)
   {
     boost::system::error_code ec;
-    this->get_service().io_control(this->get_implementation(), command, ec);
-    boost::asio::detail::throw_error(ec, "io_control");
+    this->service.io_control(this->implementation, command, ec);
+    boost::asio::detail::throw_error(ec);
   }
 
   /// Perform an IO control command on the socket.
@@ -963,338 +897,7 @@
   boost::system::error_code io_control(IoControlCommand& command,
       boost::system::error_code& ec)
   {
-    return this->get_service().io_control(
-        this->get_implementation(), command, ec);
-  }
-
-  /// Gets the non-blocking mode of the socket.
-  /**
-   * @returns @c true if the socket's synchronous operations will fail with
-   * boost::asio::error::would_block if they are unable to perform the requested
-   * operation immediately. If @c false, synchronous operations will block
-   * until complete.
-   *
-   * @note The non-blocking mode has no effect on the behaviour of asynchronous
-   * operations. Asynchronous operations will never fail with the error
-   * boost::asio::error::would_block.
-   */
-  bool non_blocking() const
-  {
-    return this->get_service().non_blocking(this->get_implementation());
-  }
-
-  /// Sets the non-blocking mode of the socket.
-  /**
-   * @param mode If @c true, the socket's synchronous operations will fail with
-   * boost::asio::error::would_block if they are unable to perform the requested
-   * operation immediately. If @c false, synchronous operations will block
-   * until complete.
-   *
-   * @throws boost::system::system_error Thrown on failure.
-   *
-   * @note The non-blocking mode has no effect on the behaviour of asynchronous
-   * operations. Asynchronous operations will never fail with the error
-   * boost::asio::error::would_block.
-   */
-  void non_blocking(bool mode)
-  {
-    boost::system::error_code ec;
-    this->get_service().non_blocking(this->get_implementation(), mode, ec);
-    boost::asio::detail::throw_error(ec, "non_blocking");
-  }
-
-  /// Sets the non-blocking mode of the socket.
-  /**
-   * @param mode If @c true, the socket's synchronous operations will fail with
-   * boost::asio::error::would_block if they are unable to perform the requested
-   * operation immediately. If @c false, synchronous operations will block
-   * until complete.
-   *
-   * @param ec Set to indicate what error occurred, if any.
-   *
-   * @note The non-blocking mode has no effect on the behaviour of asynchronous
-   * operations. Asynchronous operations will never fail with the error
-   * boost::asio::error::would_block.
-   */
-  boost::system::error_code non_blocking(
-      bool mode, boost::system::error_code& ec)
-  {
-    return this->get_service().non_blocking(
-        this->get_implementation(), mode, ec);
-  }
-
-  /// Gets the non-blocking mode of the native socket implementation.
-  /**
-   * This function is used to retrieve the non-blocking mode of the underlying
-   * native socket. This mode has no effect on the behaviour of the socket
-   * object's synchronous operations.
-   *
-   * @returns @c true if the underlying socket is in non-blocking mode and
-   * direct system calls may fail with boost::asio::error::would_block (or the
-   * equivalent system error).
-   *
-   * @note The current non-blocking mode is cached by the socket object.
-   * Consequently, the return value may be incorrect if the non-blocking mode
-   * was set directly on the native socket.
-   *
-   * @par Example
-   * This function is intended to allow the encapsulation of arbitrary
-   * non-blocking system calls as asynchronous operations, in a way that is
-   * transparent to the user of the socket object. The following example
-   * illustrates how Linux's @c sendfile system call might be encapsulated:
-   * @code template <typename Handler>
-   * struct sendfile_op
-   * {
-   *   tcp::socket& sock_;
-   *   int fd_;
-   *   Handler handler_;
-   *   off_t offset_;
-   *   std::size_t total_bytes_transferred_;
-   *
-   *   // Function call operator meeting WriteHandler requirements.
-   *   // Used as the handler for the async_write_some operation.
-   *   void operator()(boost::system::error_code ec, std::size_t)
-   *   {
-   *     // Put the underlying socket into non-blocking mode.
-   *     if (!ec)
-   *       if (!sock_.native_non_blocking())
-   *         sock_.native_non_blocking(true, ec);
-   *
-   *     if (!ec)
-   *     {
-   *       for (;;)
-   *       {
-   *         // Try the system call.
-   *         errno = 0;
-   *         int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
-   *         ec = boost::system::error_code(n < 0 ? errno : 0,
-   *             boost::asio::error::get_system_category());
-   *         total_bytes_transferred_ += ec ? 0 : n;
-   *
-   *         // Retry operation immediately if interrupted by signal.
-   *         if (ec == boost::asio::error::interrupted)
-   *           continue;
-   *
-   *         // Check if we need to run the operation again.
-   *         if (ec == boost::asio::error::would_block
-   *             || ec == boost::asio::error::try_again)
-   *         {
-   *           // We have to wait for the socket to become ready again.
-   *           sock_.async_write_some(boost::asio::null_buffers(), *this);
-   *           return;
-   *         }
-   *
-   *         if (ec || n == 0)
-   *         {
-   *           // An error occurred, or we have reached the end of the file.
-   *           // Either way we must exit the loop so we can call the handler.
-   *           break;
-   *         }
-   *
-   *         // Loop around to try calling sendfile again.
-   *       }
-   *     }
-   *
-   *     // Pass result back to user's handler.
-   *     handler_(ec, total_bytes_transferred_);
-   *   }
-   * };
-   *
-   * template <typename Handler>
-   * void async_sendfile(tcp::socket& sock, int fd, Handler h)
-   * {
-   *   sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
-   *   sock.async_write_some(boost::asio::null_buffers(), op);
-   * } @endcode
-   */
-  bool native_non_blocking() const
-  {
-    return this->get_service().native_non_blocking(this->get_implementation());
-  }
-
-  /// Sets the non-blocking mode of the native socket implementation.
-  /**
-   * This function is used to modify the non-blocking mode of the underlying
-   * native socket. It has no effect on the behaviour of the socket object's
-   * synchronous operations.
-   *
-   * @param mode If @c true, the underlying socket is put into non-blocking
-   * mode and direct system calls may fail with boost::asio::error::would_block
-   * (or the equivalent system error).
-   *
-   * @throws boost::system::system_error Thrown on failure. If the @c mode is
-   * @c false, but the current value of @c non_blocking() is @c true, this
-   * function fails with boost::asio::error::invalid_argument, as the
-   * combination does not make sense.
-   *
-   * @par Example
-   * This function is intended to allow the encapsulation of arbitrary
-   * non-blocking system calls as asynchronous operations, in a way that is
-   * transparent to the user of the socket object. The following example
-   * illustrates how Linux's @c sendfile system call might be encapsulated:
-   * @code template <typename Handler>
-   * struct sendfile_op
-   * {
-   *   tcp::socket& sock_;
-   *   int fd_;
-   *   Handler handler_;
-   *   off_t offset_;
-   *   std::size_t total_bytes_transferred_;
-   *
-   *   // Function call operator meeting WriteHandler requirements.
-   *   // Used as the handler for the async_write_some operation.
-   *   void operator()(boost::system::error_code ec, std::size_t)
-   *   {
-   *     // Put the underlying socket into non-blocking mode.
-   *     if (!ec)
-   *       if (!sock_.native_non_blocking())
-   *         sock_.native_non_blocking(true, ec);
-   *
-   *     if (!ec)
-   *     {
-   *       for (;;)
-   *       {
-   *         // Try the system call.
-   *         errno = 0;
-   *         int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
-   *         ec = boost::system::error_code(n < 0 ? errno : 0,
-   *             boost::asio::error::get_system_category());
-   *         total_bytes_transferred_ += ec ? 0 : n;
-   *
-   *         // Retry operation immediately if interrupted by signal.
-   *         if (ec == boost::asio::error::interrupted)
-   *           continue;
-   *
-   *         // Check if we need to run the operation again.
-   *         if (ec == boost::asio::error::would_block
-   *             || ec == boost::asio::error::try_again)
-   *         {
-   *           // We have to wait for the socket to become ready again.
-   *           sock_.async_write_some(boost::asio::null_buffers(), *this);
-   *           return;
-   *         }
-   *
-   *         if (ec || n == 0)
-   *         {
-   *           // An error occurred, or we have reached the end of the file.
-   *           // Either way we must exit the loop so we can call the handler.
-   *           break;
-   *         }
-   *
-   *         // Loop around to try calling sendfile again.
-   *       }
-   *     }
-   *
-   *     // Pass result back to user's handler.
-   *     handler_(ec, total_bytes_transferred_);
-   *   }
-   * };
-   *
-   * template <typename Handler>
-   * void async_sendfile(tcp::socket& sock, int fd, Handler h)
-   * {
-   *   sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
-   *   sock.async_write_some(boost::asio::null_buffers(), op);
-   * } @endcode
-   */
-  void native_non_blocking(bool mode)
-  {
-    boost::system::error_code ec;
-    this->get_service().native_non_blocking(
-        this->get_implementation(), mode, ec);
-    boost::asio::detail::throw_error(ec, "native_non_blocking");
-  }
-
-  /// Sets the non-blocking mode of the native socket implementation.
-  /**
-   * This function is used to modify the non-blocking mode of the underlying
-   * native socket. It has no effect on the behaviour of the socket object's
-   * synchronous operations.
-   *
-   * @param mode If @c true, the underlying socket is put into non-blocking
-   * mode and direct system calls may fail with boost::asio::error::would_block
-   * (or the equivalent system error).
-   *
-   * @param ec Set to indicate what error occurred, if any. If the @c mode is
-   * @c false, but the current value of @c non_blocking() is @c true, this
-   * function fails with boost::asio::error::invalid_argument, as the
-   * combination does not make sense.
-   *
-   * @par Example
-   * This function is intended to allow the encapsulation of arbitrary
-   * non-blocking system calls as asynchronous operations, in a way that is
-   * transparent to the user of the socket object. The following example
-   * illustrates how Linux's @c