Experimental scoped_allocator support

[SVN r77481]
This commit is contained in:
Ion Gaztañaga
2012-03-22 18:48:57 +00:00
parent c5bdec851e
commit 82fefee743
29 changed files with 1628 additions and 63 deletions

View File

@@ -1,6 +1,6 @@
# Boost.Container library documentation Jamfile --------------------------------- # Boost.Container library documentation Jamfile ---------------------------------
# #
# Copyright Ion Gaztanaga 2009-2011. Use, modification and # Copyright Ion Gaztanaga 2009-2012. Use, modification and
# distribution is subject to the Boost Software License, Version # distribution is subject to the Boost Software License, Version
# 1.0. (See accompanying file LICENSE_1_0.txt or copy at # 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt) # http://www.boost.org/LICENSE_1_0.txt)
@@ -27,6 +27,8 @@ doxygen autodoc
<doxygen:param>"PREDEFINED=\"insert_const_ref_type= const T&\" \\ <doxygen:param>"PREDEFINED=\"insert_const_ref_type= const T&\" \\
\"BOOST_CONTAINER_DOXYGEN_INVOKED\" \\ \"BOOST_CONTAINER_DOXYGEN_INVOKED\" \\
\"BOOST_RV_REF(T)=T &&\" \\ \"BOOST_RV_REF(T)=T &&\" \\
\"BOOST_RV_REF_BEG=\" \\
\"BOOST_RV_REF_END=&&\" \\
\"BOOST_COPY_ASSIGN_REF(T)=const T &\" \\ \"BOOST_COPY_ASSIGN_REF(T)=const T &\" \\
\"BOOST_RV_REF_2_TEMPL_ARGS(T,a,b)=T<a, b> &&\" \\ \"BOOST_RV_REF_2_TEMPL_ARGS(T,a,b)=T<a, b> &&\" \\
\"BOOST_RV_REF_3_TEMPL_ARGS(T,a,b,c)=T<a,b,c>T<a,b,c> &&\" \\ \"BOOST_RV_REF_3_TEMPL_ARGS(T,a,b,c)=T<a,b,c>T<a,b,c> &&\" \\

View File

@@ -1,5 +1,5 @@
[/ [/
/ Copyright (c) 2009-2011 Ion Gazta\u00F1aga / Copyright (c) 2009-2012 Ion Gazta\u00F1aga
/ /
/ Distributed under the Boost Software License, Version 1.0. (See accompanying / 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) / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -8,7 +8,7 @@
[library Boost.Container [library Boost.Container
[quickbook 1.5] [quickbook 1.5]
[authors [Gaztanaga, Ion]] [authors [Gaztanaga, Ion]]
[copyright 2009-2011 Ion Gaztanaga] [copyright 2009-2012 Ion Gaztanaga]
[id container] [id container]
[dirname container] [dirname container]
[purpose Containers library] [purpose Containers library]
@@ -37,9 +37,9 @@ In short, what does [*Boost.Container] offer?
(they can be safely placed in shared memory). (they can be safely placed in shared memory).
* The library offers new useful containers: * The library offers new useful containers:
* [classref boost::container::flat_map flat_map], * [classref boost::container::flat_map flat_map],
[classref boost::container::flat_map flat_set], [classref boost::container::flat_set flat_set],
[classref boost::container::flat_map flat_multiset] and [classref boost::container::flat_multiset flat_multiset] and
[classref boost::container::flat_map flat_multiset]: drop-in [classref boost::container::flat_multiset flat_multiset]: drop-in
replacements for standard associative containers but more memory friendly and with faster replacements for standard associative containers but more memory friendly and with faster
searches. searches.
* [classref boost::container::stable_vector stable_vector]: a std::list and std::vector hybrid * [classref boost::container::stable_vector stable_vector]: a std::list and std::vector hybrid
@@ -378,7 +378,7 @@ adequate for your needs, and that you often need to use insert and erase in the
should probably use list instead of slist.]] should probably use list instead of slist.]]
[*Boost.Container] updates the classic `slist` container with C++11 features like move semantics and placement [*Boost.Container] updates the classic `slist` container with C++11 features like move semantics and placement
insertion and implements it a bit differently for the standard C++11 `forward_list`. `forward_list` has no `size()` insertion and implements it a bit differently than the standard C++ `forward_list`. `forward_list` has no `size()`
method, so it's been designed to allow (or in practice, encourage) implementations without tracking list size method, so it's been designed to allow (or in practice, encourage) implementations without tracking list size
with every insertion/erasure, allowing constant-time with every insertion/erasure, allowing constant-time
`splice_after(iterator, forward_list &, iterator, iterator)`-based list merging. On the other hand `slist` offers `splice_after(iterator, forward_list &, iterator, iterator)`-based list merging. On the other hand `slist` offers

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2009-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2009-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2009-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2009-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,5 +1,5 @@
<!-- <!--
Copyright 2005-2011 Ion Gaztanaga Copyright 2005-2012 Ion Gaztanaga
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
--> -->

View File

@@ -1,10 +1,10 @@
->Change "insert" and "push_back"/"push_front" to catch non-const rvalues ->Change "insert" and "push_back"/"push_front" to catch non-const rvalues
->Add an example with stateful allocators ->Add an example with stateful allocators
->Add test to check convertible types in push_back/insert ->Add test to check convertible types in push_back/insert
->Add SCARY iterators.
Review allocator traits Review allocator traits
-> Explicit instantiation of simple allocator & std::allocator to detect missing allocator_traits calls
-> Avoid any rebind<>::other -> Avoid any rebind<>::other
-> Review select_on_container_copy_xxx -> Review select_on_container_copy_xxx
-> Review propagate_on_xxx -> Review propagate_on_xxx
@@ -12,13 +12,13 @@ Review allocator traits
-> Default + swap move constructors correct? -> Default + swap move constructors correct?
-> Review container documentation in swap/copy/move regarding allocators -> Review container documentation in swap/copy/move regarding allocators
Check all move constructors: swap might not be a valid idiom, allocators must be move constructed, intrusive containers are now movable Check all move constructors: swap might not be a valid idiom, allocators must be move constructed,
intrusive containers are now movable
Add and test: Add and test:
Test different propagation values and with inequal allocators Test different propagation values and with inequal allocators
propagate_on_container_move_assignment propagate_on_container_move_assignment
select_on_container_copy_construction select_on_container_copy_construction
propagate_on_container_swap propagate_on_container_swap
@@ -28,19 +28,12 @@ Test move constructors with data values and unequal allocators
An allocator should use a smart allocator not constructible from raw pointers to catch missing pointer_traits calls An allocator should use a smart allocator not constructible from raw pointers to catch missing pointer_traits calls
Review all internal container swap's to check allocator propagation is correct
Add initializer lists Add initializer lists
Write forward_list Write forward_list
Review all move constructors to test if allocator is move constructed
check move if noexcept conditions in vector, deque and stable_vector check move if noexcept conditions in vector, deque and stable_vector
Add new allocator propagation copy constructors Detect always equal or unequal allocators at compiler time. operator== returns true_type or false_type
Review all destructors (search for "~") to detect placement destruction and replace it with allocator_traits::destroy change virtual functions with pointers to avoid template instantiation for every type
All functions from base classes like vector_base, node_alloc_holder, etc., should be named with underscore or
similar to avoid namespace pollution.

View File

@@ -43,6 +43,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "list_test", "list_test.vcpr
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scoped_allocator_adaptor_test", "scoped_allocator_adaptor.vcproj", "{B4E9FB12-7D7C-4461-83A9-5EB2C78E608F}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug Debug = Debug
@@ -95,6 +99,10 @@ Global
{58CCE183-6092-48FE-A4F7-BA0D3A792632}.Debug.Build.0 = Debug|Win32 {58CCE183-6092-48FE-A4F7-BA0D3A792632}.Debug.Build.0 = Debug|Win32
{58CCE183-6092-48FE-A4F7-BA0D3A792632}.Release.ActiveCfg = Release|Win32 {58CCE183-6092-48FE-A4F7-BA0D3A792632}.Release.ActiveCfg = Release|Win32
{58CCE183-6092-48FE-A4F7-BA0D3A792632}.Release.Build.0 = Release|Win32 {58CCE183-6092-48FE-A4F7-BA0D3A792632}.Release.Build.0 = Release|Win32
{B4E9FB12-7D7C-4461-83A9-5EB2C78E608F}.Debug.ActiveCfg = Debug|Win32
{B4E9FB12-7D7C-4461-83A9-5EB2C78E608F}.Debug.Build.0 = Debug|Win32
{B4E9FB12-7D7C-4461-83A9-5EB2C78E608F}.Release.ActiveCfg = Release|Win32
{B4E9FB12-7D7C-4461-83A9-5EB2C78E608F}.Release.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection

View File

@@ -179,6 +179,9 @@
<Filter <Filter
Name="container" Name="container"
Filter=""> Filter="">
<File
RelativePath="..\..\..\..\boost\container\allocator_traits.hpp">
</File>
<File <File
RelativePath="..\..\..\..\boost\container\container_fwd.hpp"> RelativePath="..\..\..\..\boost\container\container_fwd.hpp">
</File> </File>
@@ -197,6 +200,9 @@
<File <File
RelativePath="..\..\..\..\boost\container\map.hpp"> RelativePath="..\..\..\..\boost\container\map.hpp">
</File> </File>
<File
RelativePath="..\..\..\..\boost\container\scoped_allocator.hpp">
</File>
<File <File
RelativePath="..\..\..\..\boost\container\set.hpp"> RelativePath="..\..\..\..\boost\container\set.hpp">
</File> </File>
@@ -215,19 +221,6 @@
<File <File
RelativePath="..\..\..\..\boost\container\vector.hpp"> RelativePath="..\..\..\..\boost\container\vector.hpp">
</File> </File>
<Filter
Name="allocator"
Filter="">
<File
RelativePath="..\..\..\..\boost\container\allocator\allocator_traits.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\container\allocator\memory_util.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\container\allocator\scoped_allocator.hpp">
</File>
</Filter>
<Filter <Filter
Name="detail" Name="detail"
Filter=""> Filter="">
@@ -264,6 +257,9 @@
<File <File
RelativePath="..\..\..\..\boost\container\detail\math_functions.hpp"> RelativePath="..\..\..\..\boost\container\detail\math_functions.hpp">
</File> </File>
<File
RelativePath="..\..\..\..\boost\container\allocator\memory_util.hpp">
</File>
<File <File
RelativePath="..\..\..\..\boost\container\detail\mpl.hpp"> RelativePath="..\..\..\..\boost\container\detail\mpl.hpp">
</File> </File>

View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="scoped_allocator_adaptor_test"
ProjectGUID="{B4E9FB12-7D7C-4461-83A9-5EB2C78E608F}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../Bin/Win32/Debug"
IntermediateDirectory="Debug/scoped_allocator_adaptor_test"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../.."
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
GeneratePreprocessedFile="0"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="FALSE"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib"
OutputFile="$(OutDir)/scoped_allocator_adaptor_test_d.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../../../../stage/lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/scoped_allocator_adaptor_test.pdb"
SubSystem="1"
TargetMachine="1"
FixedBaseAddress="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../../Bin/Win32/Release"
IntermediateDirectory="Release/scoped_allocator_adaptor_test"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../../../.."
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="FALSE"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib"
OutputFile="$(OutDir)/scoped_allocator_adaptor_test.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../../../../stage/lib"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{41737BCF-4312-7AC5-A066-32D75A32A2AF}">
<File
RelativePath="..\..\test\scoped_allocator_adaptor_test.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93815995-89BD-b043-5E8B-65FBE52E2AFB}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
@@ -9,7 +9,7 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp> #include <boost/container/detail/config_begin.hpp>
#include <cstddef> #include <cstddef>
#include <boost/container/allocator/allocator_traits.hpp> #include <boost/container/allocator_traits.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/integral_constant.hpp> #include <boost/type_traits/integral_constant.hpp>

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
@@ -112,10 +112,10 @@ class dummy_test_allocator
{} {}
pointer address(reference value) pointer address(reference value)
{ return pointer(addressof(value)); } { return pointer(container_detail::addressof(value)); }
const_pointer address(const_reference value) const const_pointer address(const_reference value) const
{ return const_pointer(addressof(value)); } { return const_pointer(container_detail::addressof(value)); }
pointer allocate(size_type, cvoid_ptr = 0) pointer allocate(size_type, cvoid_ptr = 0)
{ return 0; } { return 0; }

View File

@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
@@ -86,10 +86,10 @@ class expand_bwd_test_allocator
, m_offset(other.m_offset), m_allocations(0){ } , m_offset(other.m_offset), m_allocations(0){ }
pointer address(reference value) pointer address(reference value)
{ return pointer(addressof(value)); } { return pointer(container_detail::addressof(value)); }
const_pointer address(const_reference value) const const_pointer address(const_reference value) const
{ return const_pointer(addressof(value)); } { return const_pointer(container_detail::addressof(value)); }
pointer allocate(size_type , cvoid_ptr hint = 0) pointer allocate(size_type , cvoid_ptr hint = 0)
{ (void)hint; return 0; } { (void)hint; return 0; }

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
@@ -228,17 +228,17 @@ class recursive_flat_multiset
{ {
public: public:
recursive_flat_multiset(const recursive_flat_multiset &c) recursive_flat_multiset(const recursive_flat_multiset &c)
: id_(c.id_), flat_set_(c.flat_set_) : id_(c.id_), flat_multiset_(c.flat_multiset_)
{} {}
recursive_flat_multiset & operator =(const recursive_flat_multiset &c) recursive_flat_multiset & operator =(const recursive_flat_multiset &c)
{ {
id_ = c.id_; id_ = c.id_;
flat_set_= c.flat_set_; flat_multiset_= c.flat_multiset_;
return *this; return *this;
} }
int id_; int id_;
flat_multiset<recursive_flat_multiset> flat_set_; flat_multiset<recursive_flat_multiset> flat_multiset_;
friend bool operator< (const recursive_flat_multiset &a, const recursive_flat_multiset &b) friend bool operator< (const recursive_flat_multiset &a, const recursive_flat_multiset &b)
{ return a.id_ < b.id_; } { return a.id_ < b.id_; }
}; };

View File

@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
//////////////////////////////////////// ////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
@@ -201,8 +201,10 @@ void test_move()
{ {
//Now test move semantics //Now test move semantics
C original; C original;
original.emplace();
C move_ctor(boost::move(original)); C move_ctor(boost::move(original));
C move_assign; C move_assign;
move_assign.emplace();
move_assign = boost::move(move_ctor); move_assign = boost::move(move_ctor);
move_assign.swap(original); move_assign.swap(original);
} }

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
@@ -95,6 +95,26 @@ enum Test
int main() int main()
{ {
const std::size_t positions_length = 10;
std::size_t positions[positions_length];
vector<int> vector_int;
vector<int> vector_int2(positions_length);
for(std::size_t i = 0; i != positions_length; ++i){
positions[i] = 0u;
}
for(std::size_t i = 0, max = vector_int2.size(); i != max; ++i){
vector_int2[i] = i;
}
vector_int.insert(vector_int.begin(), 999);
vector_int.insert_at_ordered_positions(positions, positions_length, vector_int2.end());
for(std::size_t i = 0, max = vector_int.size(); i != max; ++i){
std::cout << vector_int[i] << std::endl;
}
return 0;
/*
recursive_vector_test(); recursive_vector_test();
{ {
//Now test move semantics //Now test move semantics
@@ -134,7 +154,8 @@ int main()
if(!boost::container::test::test_propagate_allocator<vector>()) if(!boost::container::test::test_propagate_allocator<vector>())
return 1; return 1;
return 0; return 0;
*/
} }
#include <boost/container/detail/config_end.hpp> #include <boost/container/detail/config_end.hpp>

View File

@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //