Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64984 - in trunk/libs: interprocess/doc interprocess/proj interprocess/proj/vc7ide interprocess/test intrusive/doc intrusive/example intrusive/proj/vc7ide intrusive/proj/vc7ide/_intrusivelib intrusive/proj/vc7ide/any_test intrusive/proj/vc7ide/avl_multiset intrusive/proj/vc7ide/avl_set intrusive/proj/vc7ide/custom_bucket_traits intrusive/proj/vc7ide/default_hook intrusive/proj/vc7ide/external_value_traits intrusive/proj/vc7ide/function_hook intrusive/proj/vc7ide/list intrusive/proj/vc7ide/make_functions intrusive/proj/vc7ide/multiset intrusive/proj/vc7ide/recursive intrusive/proj/vc7ide/set intrusive/proj/vc7ide/sg_multiset intrusive/proj/vc7ide/sg_set intrusive/proj/vc7ide/slist intrusive/proj/vc7ide/splay_multiset intrusive/proj/vc7ide/splay_set intrusive/proj/vc7ide/stateful_value_traits intrusive/proj/vc7ide/treap_multiset intrusive/proj/vc7ide/treap_set intrusive/proj/vc7ide/unordered_multiset intrusive/proj/vc7ide/unordered_set intrusive/proj/vc7ide/virtual_base intrusive/test
From: igaztanaga_at_[hidden]
Date: 2010-08-24 13:13:25


Author: igaztanaga
Date: 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
New Revision: 64984
URL: http://svn.boost.org/trac/boost/changeset/64984

Log:
More changes for Boost 1.45
Added:
   trunk/libs/intrusive/example/doc_function_hooks.cpp (contents, props changed)
   trunk/libs/intrusive/example/doc_recursive.cpp (contents, props changed)
   trunk/libs/intrusive/example/doc_recursive_member.cpp (contents, props changed)
   trunk/libs/intrusive/proj/vc7ide/function_hook/
   trunk/libs/intrusive/proj/vc7ide/function_hook/function_hook.vcproj (contents, props changed)
   trunk/libs/intrusive/proj/vc7ide/recursive/
   trunk/libs/intrusive/proj/vc7ide/recursive/recursive.vcproj (contents, props changed)
   trunk/libs/intrusive/test/function_hook_test.cpp (contents, props changed)
   trunk/libs/intrusive/test/recursive_test.cpp (contents, props changed)
Text files modified:
   trunk/libs/interprocess/doc/Jamfile.v2 | 1
   trunk/libs/interprocess/doc/interprocess.qbk | 64 +++++++++-----
   trunk/libs/interprocess/proj/to-do.txt | 44 ++++++++++
   trunk/libs/interprocess/proj/vc7ide/memory_algorithm_test.vcproj | 3
   trunk/libs/interprocess/proj/vc7ide/stable_vector_test.vcproj | 2
   trunk/libs/interprocess/test/memory_algorithm_test_template.hpp | 16 ++-
   trunk/libs/intrusive/doc/intrusive.qbk | 170 +++++++++++++++++++++++++++++++--------
   trunk/libs/intrusive/proj/vc7ide/Intrusive.sln | 18 +++
   trunk/libs/intrusive/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj | 12 ++
   trunk/libs/intrusive/proj/vc7ide/any_test/any_test.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/avl_multiset/avl_multiset.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/avl_set/avl_set.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/custom_bucket_traits/custom_bucket_traits.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/default_hook/default_hook.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/external_value_traits/external_value_traits.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/list/list.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/make_functions/make_functions.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/multiset/multiset.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/set/set.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/sg_multiset/sg_multiset.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/sg_set/sg_set.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/slist/slist.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/splay_multiset/splay_multiset.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/splay_set/splay_set.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/stateful_value_traits/stateful_value_traits.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/to-do.txt | 1
   trunk/libs/intrusive/proj/vc7ide/treap_multiset/treap_multiset.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/treap_set/treap_set.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/unordered_set/unordered_set.vcproj | 2
   trunk/libs/intrusive/proj/vc7ide/virtual_base/virtual_base.vcproj | 2
   trunk/libs/intrusive/test/generic_assoc_test.hpp | 4
   trunk/libs/intrusive/test/list_test.cpp | 3
   trunk/libs/intrusive/test/smart_ptr.hpp | 3
   34 files changed, 287 insertions(+), 96 deletions(-)

Modified: trunk/libs/interprocess/doc/Jamfile.v2
==============================================================================
--- trunk/libs/interprocess/doc/Jamfile.v2 (original)
+++ trunk/libs/interprocess/doc/Jamfile.v2 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -44,6 +44,7 @@
       interprocess
    :
         <xsl:param>boost.root=../../../..
+ <xsl:param>boost.libraries=../../../../libs/libraries.htm
         <xsl:param>toc.max.depth=1
         <xsl:param>toc.section.depth=2
         <xsl:param>chunk.first.sections=1

Modified: trunk/libs/interprocess/doc/interprocess.qbk
==============================================================================
--- trunk/libs/interprocess/doc/interprocess.qbk (original)
+++ trunk/libs/interprocess/doc/interprocess.qbk 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -8,7 +8,7 @@
 [library Boost.Interprocess
     [quickbook 1.4]
     [authors [Gaztanaga, Ion]]
- [copyright 2005- 2008 Ion Gaztanaga]
+ [copyright 2005- 2010 Ion Gaztanaga]
     [id interprocess]
     [dirname interprocess]
     [purpose Interprocess communication utilities]
@@ -311,6 +311,33 @@
 
 [endsect]
 
+[section:permissions Permissions]
+
+Named resources offered by [*Boost.Interprocess] must cope with platform-dependant
+permission issues also present when creating files. If a programmer wants to
+shared shared memory, memory mapped files or named synchronization mechanisms
+(mutexes, semaphores, etc...) between users, it's necessary to specify
+those permissions. Sadly, traditional UNIX and Windows permissions are very
+different and [*Boost.Interprocess] does not try to standardize permissions,
+but does not ignore them.
+
+All named resource creation functions take an optional
+[classref boost::interprocess::permissions permissions object] that can be
+configured with platform-dependant permissions.
+
+Since each mechanism can be emulated through diferent mechanisms
+(a semaphore might be implement using mapped files or native semaphores)
+permissions types could vary when the implementation of a named resource
+changes (eg.: in Windows mutexes require `synchronize permissions`, but
+that's not the case of files).
+To avoid this, [*Boost.Interprocess] relies on file-like permissions,
+requiring file read-write-delete permissions to open named synchronization mechanisms
+(mutex, semaphores, etc.) and appropiate read or read-write-delete permissions for
+shared memory. This approach has two advantages: it's similar to the UNIX philosophy
+and the programmer does not need to know how the named resource is implemented.
+
+[endsect]
+
 [endsect]
 
 [section:sharedmemorybetweenprocesses Sharing memory between processes]
@@ -611,7 +638,7 @@
 
 Sharing memory between services and user applications is also different. To share memory
 between services and user applications the name of the shared memory must start with the
-global namespace prefix `"Global\"`. This global namespace enables processes on multiple
+global namespace prefix `"Global\\"`. This global namespace enables processes on multiple
 client sessions to communicate with a service application. The server component can create
 the shared memory in the global namespace. Then a client session can use the "Global\" prefix
 to open that memory.
@@ -5214,7 +5241,6 @@
 This is the default allocation algorithm in [*Boost.Interprocess] managed memory
 segments.
                                                                                                                                
-
 [endsect]
 
 [endsect]
@@ -6524,28 +6550,6 @@
 
 [endsect]
 
-[section:thanks_to_license_notes License notes]
-
-[*Boost.Interprocess] STL containers are based on the SGI STL library implementation:
-
-Copyright (c) 1996,1997 Silicon Graphics Computer Systems, Inc. Permission to use,
-copy, modify, distribute and sell this software and its documentation for any
-purpose is hereby granted without fee, provided that the above copyright notice
-appear in all copies and that both that copyright notice and this permission
-notice appear in supporting documentation. Silicon Graphics makes no representations
-about the suitability of this software for any purpose. It is provided "as is"
-without express or implied warranty.
-
-Copyright (c) 1994 Hewlett-Packard Company Permission to use, copy, modify,
-distribute and sell this software and its documentation for any purpose is hereby
-granted without fee, provided that the above copyright notice appear in all copies
-and that both that copyright notice and this permission notice appear in supporting
-documentation. Hewlett-Packard Company makes no representations about the suitability
-of this software for any purpose. It is provided "as is" without express or implied
-warranty.
-
-[endsect]
-
 [endsect]
 
 [section:release_notes Release Notes]
@@ -6569,10 +6573,20 @@
   [@https://svn.boost.org/trac/boost/ticket/4218 #4218],
   [@https://svn.boost.org/trac/boost/ticket/4230 #4230],
   [@https://svn.boost.org/trac/boost/ticket/4230 #4352],
+ [@https://svn.boost.org/trac/boost/ticket/4230 #4352],
+ [@https://svn.boost.org/trac/boost/ticket/4524 #4524],
+ [@https://svn.boost.org/trac/boost/ticket/4557 #4557].
+
+* Added support for standard rvalue reference move semantics
+ (tested on GCC 4.5 and VC10).
+
+* Permissions can be detailed for interprocess named resources.
 
 * `mapped_region::flush` initiates disk flushing but does not guarantee it's completed
    when returns, since it is not portable.
 
+* FreeBSD and MacOS now use posix semaphores to implement named semaphores and mutex.
+
 [endsect]
 
 [section:release_notes_boost_1_41_00 Boost 1.41 Release]

Modified: trunk/libs/interprocess/proj/to-do.txt
==============================================================================
--- trunk/libs/interprocess/proj/to-do.txt (original)
+++ trunk/libs/interprocess/proj/to-do.txt 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -1,4 +1,46 @@
--> add private_read_only to mapped_region to support MAP_PRIVATE plus PROT_READ
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga. 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/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+//////////////////////////////////////////////////////////////////////////////
+Platform conformance
+//////////////////////////////////////////////////////////////////////////////
+
+//////////
+FreeBSD
+//////////
+
+Tested until FreeBSD 9
+
+Shared memory: FreeBSD < 7 filesystem semantics
+
+ HISTORY
+ The shm_open() and shm_unlink() functions first appeared in FreeBSD 4.3.
+ The functions were reimplemented as system calls using shared memory
+ objects directly rather than files in FreeBSD 7.0.
+
+ BUG: MAP_PRIVATE requires read-write access to shared memory object (mapped files work fine)
+
+Named semaphore: _POSIX_SEMAPHORES not defined. Limited named semaphore support (short names)
+Process shared: _POSIX_THREAD_PROCESS_SHARED not defined
+
+//////////
+Linux 2.6
+//////////
+
+All Fine
+
+
+
+
+
 
 -> add contiguous_elements option to burst allocation
 

Modified: trunk/libs/interprocess/proj/vc7ide/memory_algorithm_test.vcproj
==============================================================================
--- trunk/libs/interprocess/proj/vc7ide/memory_algorithm_test.vcproj (original)
+++ trunk/libs/interprocess/proj/vc7ide/memory_algorithm_test.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -72,6 +72,7 @@
                         CharacterSet="2">
                         <Tool
                                 Name="VCCLCompilerTool"
+ GlobalOptimizations="TRUE"
                                 AdditionalIncludeDirectories="../../../.."
                                 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
                                 RuntimeLibrary="2"
@@ -80,7 +81,7 @@
                                 UsePrecompiledHeader="0"
                                 WarningLevel="4"
                                 Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="0"/>
+ DebugInformationFormat="3"/>
                         <Tool
                                 Name="VCCustomBuildTool"/>
                         <Tool

Modified: trunk/libs/interprocess/proj/vc7ide/stable_vector_test.vcproj
==============================================================================
--- trunk/libs/interprocess/proj/vc7ide/stable_vector_test.vcproj (original)
+++ trunk/libs/interprocess/proj/vc7ide/stable_vector_test.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -72,6 +72,8 @@
                         CharacterSet="2">
                         <Tool
                                 Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="0"
                                 AdditionalIncludeDirectories="../../../.."
                                 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
                                 RuntimeLibrary="2"

Modified: trunk/libs/interprocess/test/memory_algorithm_test_template.hpp
==============================================================================
--- trunk/libs/interprocess/test/memory_algorithm_test_template.hpp (original)
+++ trunk/libs/interprocess/test/memory_algorithm_test_template.hpp 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -501,17 +501,23 @@
 
    //Now test all allocated memory is zero
    //Allocate memory
+ const char *first_addr = 0;
    for(int i = 0; true; ++i){
       void *ptr = a.allocate(i, std::nothrow);
       if(!ptr)
          break;
+ if(i == 0){
+ first_addr = (char*)ptr;
+ }
+ std::size_t memsize = a.size(ptr);
       buffers.push_back(ptr);
- }
 
- //Test allocated memory is zero
- for(int i = 0, max = buffers.size(); i < max; ++i){
- for(int j = 0; j < i; ++j){
- if(static_cast<char*>(buffers[i])[j]) return false;
+ for(int j = 0; j < (int)memsize; ++j){
+ if(static_cast<char*>((char*)ptr)[j]){
+ std::cout << "Zero memory test failed. in buffer " << i
+ << " byte " << j << " first address " << (void*) first_addr << " offset " << ((char*)ptr+j) - (char*)first_addr << " memsize: " << memsize << std::endl;
+ return false;
+ }
       }
    }
 

Modified: trunk/libs/intrusive/doc/intrusive.qbk
==============================================================================
--- trunk/libs/intrusive/doc/intrusive.qbk (original)
+++ trunk/libs/intrusive/doc/intrusive.qbk 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2007-2009 Ion Gaztanaga
+ / Copyright (c) 2007-2010 Ion Gaztanaga
  /
  / 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)
@@ -8,7 +8,7 @@
 [library Boost.Intrusive
     [quickbook 1.4]
     [authors [Krzikalla, Olaf], [Gaztanaga, Ion]]
- [copyright 2005 Olaf Krzikalla, 2006-2009 Ion Gaztanaga]
+ [copyright 2005 Olaf Krzikalla, 2006-2010 Ion Gaztanaga]
     [id intrusive]
     [dirname intrusive]
     [purpose Intrusive containers]
@@ -198,7 +198,7 @@
    swapping can be used to implement move capabilities. To ease the implementation of
    copy constructors and assignment operators of classes storing [*Boost.Intrusive]
    containers, [*Boost.Intrusive] offers special cloning functions. See
- [link intrusive.clone_from Cloning [*Boost.Intrusive] containers] section for more information.
+ [link intrusive.clone_from Cloning Boost.Intrusive containers] section for more information.
 
 * Analyzing the thread safety of a program that uses containers is harder with intrusive containers, because
    the container might be modified indirectly without an explicit call to a container member.
@@ -246,7 +246,10 @@
 Every class to be inserted in an intrusive container, needs to contain a hook that
 will offer the necessary data and resources to be insertable in the container.
 With [*Boost.Intrusive] you just choose the hook to be a public base class or
-a public member of the class to be inserted.
+a public member of the class to be inserted. [*Boost.Intrusive] also offers
+more flexible hooks for advanced users, as explained in the chapter
+[link intrusive.function_hooks Using function hooks], but usually base or member
+hooks are good enough for most users.
 
 [section:usage_base_hook Using base hooks]
 
@@ -451,6 +454,7 @@
 
 [endsect]
 
+
 [endsect]
 
 [section:usage_when When to use?]
@@ -2147,7 +2151,7 @@
 
 [endsect]
 
-[section:clone_from Cloning [*Boost.Intrusive] containers]
+[section:clone_from Cloning Boost.Intrusive containers]
 
 As previously mentioned, [*Boost.Intrusive] containers are [*non-copyable and non-assignable], because
 intrusive containers don't allocate memory at all. To implement a copy-constructor or assignment operator,
@@ -2190,6 +2194,105 @@
 
 [endsect]
 
+[section:function_hooks Using function hooks]
+
+A programmer might find that base or member hooks are not flexible enough in some situations.
+In some applications it would be optimal to put a hook deep inside a member of a class or just outside the class.
+[*Boost.Intrusive] has an easy option to allow such cases: [classref boost::intrusive::function_hook function_hook].
+
+This option is similar to [classref boost::intrusive::member_hook member_hook] or
+[classref boost::intrusive::base_hook base_hook], but the programmer can specify a function
+object that tells the container how to obtain a hook from a value and vice versa.
+The programmer just needs to define the following function object:
+
+[c++]
+
+ //This functor converts between value_type and a hook_type
+ struct Functor
+ {
+ //Required types
+ typedef /*impl-defined*/ hook_type;
+ typedef /*impl-defined*/ hook_ptr;
+ typedef /*impl-defined*/ const_hook_ptr;
+ typedef /*impl-defined*/ value_type;
+ typedef /*impl-defined*/ pointer;
+ typedef /*impl-defined*/ const_pointer;
+ //Required static functions
+ static hook_ptr to_hook_ptr (value_type &value);
+ static const_hook_ptr to_hook_ptr(const value_type &value);
+ static pointer to_value_ptr(hook_ptr n);
+ static const_pointer to_value_ptr(const_hook_ptr n);
+ };
+
+Converting from values to hooks is generally easy, since most hooks are
+in practice members or base classes of class data members. The inverse operation
+is a bit more complicated, but [*Boost.Intrusive] offers a bit of help with the function
+[funcref boost::intrusive::get_parent_from_member get_parent_from_member],
+which allows easy conversions from the address of a data member to the address of
+the parent holding that member. Let's see a little example of
+[classref boost::intrusive::function_hook function_hook]:
+
+[import ../example/doc_function_hooks.cpp]
+[doc_function_hooks]
+
+[endsect]
+
+
+[section:recursive Recursive Boost.Intrusive containers]
+
+[*Boost.Intrusive] containers can be used to define recursive structures very easily,
+allowing complex data structures with very low overhead. Let's see an example:
+
+[import ../example/doc_recursive.cpp]
+[doc_recursive]
+
+Recursive data structures using [*Boost.Intrusive] containers must avoid using hook deduction to avoid early type
+instantiation:
+
+[c++]
+
+ //This leads to compilation error (Recursive is instantiated by
+ //'list' to deduce hook properties (pointer type, tag, safe-mode...)
+ class Recursive
+ { //...
+
+ list< Recursive > l;
+ //...
+ };
+
+ //Ok, programmer must specify the hook type to avoid early Recursive instantiation
+ class Recursive
+ { //...
+ list< Recursive, base_hook<BaseHook> > l;
+ //...
+ };
+
+
+Member hooks are not suitable for recursive structures:
+
+[c++]
+
+ class Recursive
+ {
+ private:
+ Recursive(const Recursive&);
+ Recursive & operator=(const Recursive&);
+
+ public:
+ list_member_hook<> memhook;
+ list< Recursive, member_hook<Recursive, list_member_hook<>, &Recursive::memhook> > children;
+ };
+
+Specifying `&Recursive::memhook` (that is, the offset between memhook and Recursive) provokes an early
+instantiation of `Recursive`. To define recursive structures using member hooks, a programmer should use
+[classref ::boost::interprocess::function_hook function_hook]:
+
+[import ../example/doc_recursive_member.cpp]
+[doc_recursive_member]
+
+[endsect]
+
+
 [section:using_smart_pointers Using smart pointers with Boost.Intrusive containers]
 
 [*Boost.Intrusive] hooks can be configured to use other pointers than raw pointers.
@@ -3313,7 +3416,7 @@
 
 When designing [*Boost.Intrusive] the following guidelines have been taken into account:
 
-[section: Boost.Intrusive in performance sensitive environments]
+[section:performance_sensitive Boost.Intrusive in performance sensitive environments]
 
 [*Boost.Intrusive] should be a valuable tool in performance sensitive environments,
 and following this guideline, [*Boost.Intrusive] has been designed to offer well
@@ -3327,7 +3430,7 @@
 
 [endsect]
 
-[section: Boost.Intrusive in space constrained environments]
+[section:space_constrained Boost.Intrusive in space constrained environments]
 
 [*Boost.Intrusive] should be useful in space constrained environments,
 and following this guideline [*Boost.Intrusive] separates node algorithms
@@ -3344,7 +3447,7 @@
 
 [endsect]
 
-[section: Boost.Intrusive as a basic building block]
+[section:basic_building_block Boost.Intrusive as a basic building block]
 
 [*Boost.Intrusive] can be a basic building block to build more complex containers
 and this potential has motivated many design decisions. For example, the ability
@@ -3358,7 +3461,7 @@
 
 [endsect]
 
-[section: Extending Boost.Intrusive]
+[section:extending_intrusive Extending Boost.Intrusive]
 
 [*Boost.Intrusive] offers a wide range of containers but also allows the
 construction of custom containers reusing [*Boost.Intrusive] elements.
@@ -3728,6 +3831,28 @@
 
 [section:release_notes Release Notes]
 
+[section:release_notes_boost_1_45_00 Boost 1.45 Release]
+
+* Added `function_hook` option.
+* Fixed bugs
+ [@https://svn.boost.org/trac/boost/ticket/3668 #3668],
+ [@https://svn.boost.org/trac/boost/ticket/3339 #3688],
+ [@https://svn.boost.org/trac/boost/ticket/3698 #3698],
+ [@https://svn.boost.org/trac/boost/ticket/3706 #3706],
+ [@https://svn.boost.org/trac/boost/ticket/3721 #3721].
+ [@https://svn.boost.org/trac/boost/ticket/3729 #3729],
+ [@https://svn.boost.org/trac/boost/ticket/3746 #3746],
+ [@https://svn.boost.org/trac/boost/ticket/3781 #3781],
+ [@https://svn.boost.org/trac/boost/ticket/3829 #3829],
+ [@https://svn.boost.org/trac/boost/ticket/3840 #3840],
+ [@https://svn.boost.org/trac/boost/ticket/3339 #3339],
+ [@https://svn.boost.org/trac/boost/ticket/3419 #3419],
+ [@https://svn.boost.org/trac/boost/ticket/3431 #3431],
+ [@https://svn.boost.org/trac/boost/ticket/4021 #4021],
+
+[endsect]
+
+
 [section:release_notes_boost_1_40_00 Boost 1.40 Release]
 
 * Code cleanup in tree_algorithms.hpp and avl_tree_algorithms.hpp
@@ -3849,29 +3974,4 @@
 
 [endsect]
 
-[xinclude autodoc.xml]
-
-[section:license_notices License notices]
-
-Most of the internal implementation of red-black trees is based on that of SGI STL stl_tree.h file:
-
-['Copyright (c) 1996,1997 Silicon Graphics Computer Systems, Inc.
-Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Silicon Graphics makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.]
-
-['Copyright (c) 1994 Hewlett-Packard Company
-Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Hewlett-Packard Company makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.]
-
-The tree destruction algorithm is based on Julienne Walker and The EC Team code:
-
-['This code is in the public domain. Anyone may
-use it or change it in any way that they see
-fit. The author assumes no responsibility for
-damages incurred through use of the original
-code or any variations thereof.]
-
-['It is requested, but not required, that due
-credit is given to the original author and
-anyone who has modified the code through
-a header comment, such as this one.]
-
-[endsect]
+[xinclude autodoc.xml]
\ No newline at end of file

Added: trunk/libs/intrusive/example/doc_function_hooks.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/intrusive/example/doc_function_hooks.cpp 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -0,0 +1,76 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2010-2010
+//
+// 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/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+//[doc_function_hooks
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/parent_from_member.hpp>
+
+using namespace boost::intrusive;
+
+struct MyClass
+{
+ int dummy;
+ //This internal type has a member hook
+ struct InnerNode
+ {
+ int dummy;
+ list_member_hook<> hook;
+ } inner;
+};
+
+//This functor converts between MyClass and InnerNode's member hook
+struct Functor
+{
+ //Required types
+ typedef list_member_hook<> hook_type;
+ typedef hook_type* hook_ptr;
+ typedef const hook_type* const_hook_ptr;
+ typedef MyClass value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+
+ //Required static functions
+ static hook_ptr to_hook_ptr (value_type &value)
+ { return &value.inner.hook; }
+ static const_hook_ptr to_hook_ptr(const value_type &value)
+ { return &value.inner.hook; }
+ static pointer to_value_ptr(hook_ptr n)
+ {
+ return get_parent_from_member<MyClass>
+ (get_parent_from_member<MyClass::InnerNode>(n, &MyClass::InnerNode::hook)
+ ,&MyClass::inner
+ );
+ }
+ static const_pointer to_value_ptr(const_hook_ptr n)
+ {
+ return get_parent_from_member<MyClass>
+ (get_parent_from_member<MyClass::InnerNode>(n, &MyClass::InnerNode::hook)
+ ,&MyClass::inner
+ );
+ }
+};
+
+//Define a list that will use the hook accessed through the function object
+typedef list< MyClass, function_hook< Functor> > List;
+
+int main()
+{
+ MyClass n;
+ List l;
+ //Insert the node in both lists
+ l.insert(l.begin(), n);
+ assert(l.size() == 1);
+ return 0;
+}
+//]
+
+#include <boost/intrusive/detail/config_end.hpp>

Added: trunk/libs/intrusive/example/doc_recursive.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/intrusive/example/doc_recursive.cpp 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -0,0 +1,53 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// 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/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_recursive
+#include <boost/intrusive/list.hpp>
+#include <cassert>
+
+using namespace boost::intrusive;
+
+typedef list_base_hook<> BaseHook;
+
+//A recursive class
+class Recursive : public BaseHook
+{
+ private:
+ Recursive(const Recursive&);
+ Recursive & operator=(const Recursive&);
+
+ public:
+ Recursive() : BaseHook(), children(){}
+ list< Recursive, base_hook<BaseHook> > children;
+};
+
+int main()
+{
+ Recursive f, f2;
+ //A recursive list of Recursive
+ list< Recursive, base_hook<BaseHook> > l;
+
+ //Insert a node in parent list
+ l.insert(l.begin(), f);
+
+ //Insert a node in child list
+ l.begin()->children.insert(l.begin()->children.begin(), f2);
+
+ //Objects properly inserted
+ assert(l.size() == l.begin()->children.size());
+ assert(l.size() == 1);
+
+ //Clear both lists
+ l.begin()->children.clear();
+ l.clear();
+ return 0;
+}
+//]

Added: trunk/libs/intrusive/example/doc_recursive_member.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/intrusive/example/doc_recursive_member.cpp 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -0,0 +1,86 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2010-2010
+//
+// 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/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+//[doc_recursive_member
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/parent_from_member.hpp>
+
+using namespace boost::intrusive;
+
+class Recursive;
+
+//Declaration of the functor that converts betwen the Recursive
+//class and the hook
+struct Functor
+{
+ //Required types
+ typedef list_member_hook<> hook_type;
+ typedef hook_type* hook_ptr;
+ typedef const hook_type* const_hook_ptr;
+ typedef Recursive value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+
+ //Required static functions
+ static hook_ptr to_hook_ptr (value_type &value);
+ static const_hook_ptr to_hook_ptr(const value_type &value);
+ static pointer to_value_ptr(hook_ptr n);
+ static const_pointer to_value_ptr(const_hook_ptr n);
+};
+
+//Define the recursive class
+class Recursive
+{
+ private:
+ Recursive(const Recursive&);
+ Recursive & operator=(const Recursive&);
+
+ public:
+ Recursive() : hook(), children() {}
+ list_member_hook<> hook;
+ list< Recursive, function_hook< Functor> > children;
+};
+
+//Definition of Functor functions
+inline Functor::hook_ptr Functor::to_hook_ptr (Functor::value_type &value)
+ { return &value.hook; }
+inline Functor::const_hook_ptr Functor::to_hook_ptr(const Functor::value_type &value)
+ { return &value.hook; }
+inline Functor::pointer Functor::to_value_ptr(Functor::hook_ptr n)
+ { return get_parent_from_member<Recursive>(n, &Recursive::hook); }
+inline Functor::const_pointer Functor::to_value_ptr(Functor::const_hook_ptr n)
+ { return get_parent_from_member<Recursive>(n, &Recursive::hook); }
+
+int main()
+{
+ Recursive f, f2;
+ //A recursive list of Recursive
+ list< Recursive, function_hook< Functor> > l;
+
+ //Insert a node in parent list
+ l.insert(l.begin(), f);
+
+ //Insert a node in child list
+ l.begin()->children.insert(l.begin()->children.begin(), f2);
+
+ //Objects properly inserted
+ assert(l.size() == l.begin()->children.size());
+ assert(l.size() == 1);
+
+ //Clear both lists
+ l.begin()->children.clear();
+ l.clear();
+ return 0;
+}
+//]
+
+#include <boost/intrusive/detail/config_end.hpp>

Modified: trunk/libs/intrusive/proj/vc7ide/Intrusive.sln
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/Intrusive.sln (original)
+++ trunk/libs/intrusive/proj/vc7ide/Intrusive.sln 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -91,13 +91,19 @@
         ProjectSection(ProjectDependencies) = postProject
         EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recursive", "recursive\recursive.vcproj", "{7679B41B-F2B4-9176-CB81-35449467B435}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "function_hook", "function_hook\function_hook.vcproj", "{761A79B4-9968-CB81-F02B-2A4497345475}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
 Global
         GlobalSection(SolutionConfiguration) = preSolution
                 Debug = Debug
                 Release = Release
         EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
         GlobalSection(ProjectConfiguration) = postSolution
                 {977B61B4-9968-497C-9F0B-24A8145473B8}.Debug.ActiveCfg = Debug|Win32
                 {977B61B4-9968-497C-9F0B-24A8145473B8}.Debug.Build.0 = Debug|Win32
@@ -191,6 +197,14 @@
                 {16E09E95-F4A2-C971-BC76-9BA407191C59}.Debug.Build.0 = Debug|Win32
                 {16E09E95-F4A2-C971-BC76-9BA407191C59}.Release.ActiveCfg = Release|Win32
                 {16E09E95-F4A2-C971-BC76-9BA407191C59}.Release.Build.0 = Release|Win32
+ {7679B41B-F2B4-9176-CB81-35449467B435}.Debug.ActiveCfg = Debug|Win32
+ {7679B41B-F2B4-9176-CB81-35449467B435}.Debug.Build.0 = Debug|Win32
+ {7679B41B-F2B4-9176-CB81-35449467B435}.Release.ActiveCfg = Release|Win32
+ {7679B41B-F2B4-9176-CB81-35449467B435}.Release.Build.0 = Release|Win32
+ {761A79B4-9968-CB81-F02B-2A4497345475}.Debug.ActiveCfg = Debug|Win32
+ {761A79B4-9968-CB81-F02B-2A4497345475}.Debug.Build.0 = Debug|Win32
+ {761A79B4-9968-CB81-F02B-2A4497345475}.Release.ActiveCfg = Release|Win32
+ {761A79B4-9968-CB81-F02B-2A4497345475}.Release.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(ExtensibilityGlobals) = postSolution
         EndGlobalSection

Modified: trunk/libs/intrusive/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -157,6 +157,9 @@
                                 RelativePath="..\..\..\..\..\boost\intrusive\options.hpp">
                         </File>
                         <File
+ RelativePath="..\..\..\..\..\boost\intrusive\parent_from_member.hpp">
+ </File>
+ <File
                                 RelativePath="..\..\..\..\..\boost\intrusive\pointer_plus_bits.hpp">
                         </File>
                         <File
@@ -374,6 +377,9 @@
                                 RelativePath="..\..\..\example\doc_external_value_traits.cpp">
                         </File>
                         <File
+ RelativePath="..\..\..\example\doc_function_hooks.cpp">
+ </File>
+ <File
                                 RelativePath="..\..\..\example\doc_how_to_use.cpp">
                         </File>
                         <File
@@ -395,6 +401,12 @@
                                 RelativePath="..\..\..\example\doc_rbtree_algorithms.cpp">
                         </File>
                         <File
+ RelativePath="..\..\..\example\doc_recursive.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_recursive_member.cpp">
+ </File>
+ <File
                                 RelativePath="..\..\..\example\doc_set.cpp">
                         </File>
                         <File

Modified: trunk/libs/intrusive/proj/vc7ide/any_test/any_test.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/any_test/any_test.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/any_test/any_test.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -27,7 +27,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/avl_multiset/avl_multiset.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/avl_multiset/avl_multiset.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/avl_multiset/avl_multiset.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -25,7 +25,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/avl_set/avl_set.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/avl_set/avl_set.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/avl_set/avl_set.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -24,7 +24,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/custom_bucket_traits/custom_bucket_traits.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/custom_bucket_traits/custom_bucket_traits.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/custom_bucket_traits/custom_bucket_traits.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -27,7 +27,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/default_hook/default_hook.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/default_hook/default_hook.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/default_hook/default_hook.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -27,7 +27,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/external_value_traits/external_value_traits.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/external_value_traits/external_value_traits.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/external_value_traits/external_value_traits.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -27,7 +27,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Added: trunk/libs/intrusive/proj/vc7ide/function_hook/function_hook.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/intrusive/proj/vc7ide/function_hook/function_hook.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="function_hook"
+ ProjectGUID="{761A79B4-9968-CB81-F02B-2A4497345475}"
+ RootNamespace="function_hook"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="FALSE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/function_hook.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/function_hook.pdb"
+ GenerateMapFile="TRUE"
+ SubSystem="1"
+ 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>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/function_hook.exe"
+ LinkIncremental="1"
+ 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="{4C737FF1-7AB5-3764-A066-252B75A372FF}">
+ <File
+ RelativePath="..\..\..\test\function_hook_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Modified: trunk/libs/intrusive/proj/vc7ide/list/list.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/list/list.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/list/list.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -27,7 +27,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/make_functions/make_functions.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/make_functions/make_functions.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/make_functions/make_functions.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -27,7 +27,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/multiset/multiset.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/multiset/multiset.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/multiset/multiset.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -24,7 +24,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Added: trunk/libs/intrusive/proj/vc7ide/recursive/recursive.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/intrusive/proj/vc7ide/recursive/recursive.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="recursive"
+ ProjectGUID="{7679B41B-F2B4-9176-CB81-35449467B435}"
+ RootNamespace="recursive"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="FALSE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/recursive.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/recursive.pdb"
+ GenerateMapFile="TRUE"
+ SubSystem="1"
+ 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>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/recursive.exe"
+ LinkIncremental="1"
+ 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="{4F537F31-AB85-7644-A616-25727F35FA5F}">
+ <File
+ RelativePath="..\..\..\test\recursive_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Modified: trunk/libs/intrusive/proj/vc7ide/set/set.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/set/set.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/set/set.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -24,7 +24,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/sg_multiset/sg_multiset.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/sg_multiset/sg_multiset.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/sg_multiset/sg_multiset.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -25,7 +25,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/sg_set/sg_set.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/sg_set/sg_set.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/sg_set/sg_set.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -24,7 +24,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/slist/slist.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/slist/slist.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/slist/slist.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -24,7 +24,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/splay_multiset/splay_multiset.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/splay_multiset/splay_multiset.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/splay_multiset/splay_multiset.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -25,7 +25,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/splay_set/splay_set.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/splay_set/splay_set.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/splay_set/splay_set.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -24,7 +24,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/stateful_value_traits/stateful_value_traits.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/stateful_value_traits/stateful_value_traits.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/stateful_value_traits/stateful_value_traits.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -27,7 +27,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/to-do.txt
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/to-do.txt (original)
+++ trunk/libs/intrusive/proj/vc7ide/to-do.txt 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -14,3 +14,4 @@
 -> Non-array buckets
 -> Document incremental<> option better
 -> Assure stable order for optimize_multikey and inverse order otherwise
+-> add an option to unordered containers to get O(1) traversal and begin()/end() even with very low load factors

Modified: trunk/libs/intrusive/proj/vc7ide/treap_multiset/treap_multiset.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/treap_multiset/treap_multiset.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/treap_multiset/treap_multiset.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -24,7 +24,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/treap_set/treap_set.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/treap_set/treap_set.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/treap_set/treap_set.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -24,7 +24,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -25,7 +25,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/unordered_set/unordered_set.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/unordered_set/unordered_set.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/unordered_set/unordered_set.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -25,7 +25,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/intrusive/proj/vc7ide/virtual_base/virtual_base.vcproj
==============================================================================
--- trunk/libs/intrusive/proj/vc7ide/virtual_base/virtual_base.vcproj (original)
+++ trunk/libs/intrusive/proj/vc7ide/virtual_base/virtual_base.vcproj 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -27,7 +27,7 @@
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
                                 RuntimeLibrary="5"
- DisableLanguageExtensions="TRUE"
+ DisableLanguageExtensions="FALSE"
                                 TreatWChar_tAsBuiltInType="TRUE"
                                 ForceConformanceInForLoopScope="TRUE"
                                 UsePrecompiledHeader="0"

Added: trunk/libs/intrusive/test/function_hook_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/intrusive/test/function_hook_test.cpp 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -0,0 +1,152 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2010-2010
+//
+// 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/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/parent_from_member.hpp>
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/functional/hash.hpp>
+
+using namespace boost::intrusive;
+
+struct MyClass
+{
+ MyClass() : order(0) {}
+ int order;
+
+ //This internal type has two hooks
+ struct InnerNode : public list_base_hook<>, public slist_base_hook<>
+ , public set_base_hook<>, public unordered_set_base_hook<>
+ {
+ list_member_hook<> listhook;
+ slist_member_hook<> slisthook;
+ set_member_hook<> sethook;
+ unordered_set_member_hook<> usethook;
+ } inner;
+
+ friend bool operator < (const MyClass &l, const MyClass &r)
+ { return l.order < r.order; }
+ friend bool operator == (const MyClass &l, const MyClass &r)
+ { return l.order == r.order; }
+ friend std::size_t hash_value(const MyClass &value)
+ { return std::size_t(value.order); }
+};
+
+//This functor converts between MyClass and the InnerNode member hook
+#define InnerMemberHook(TAG, HOOKTYPE, MEMBERNAME)\
+ struct InnerMemberHookFunctor##TAG \
+ {\
+ typedef HOOKTYPE hook_type;\
+ typedef hook_type* hook_ptr;\
+ typedef const hook_type* const_hook_ptr;\
+ typedef MyClass value_type;\
+ typedef value_type* pointer;\
+ typedef const value_type* const_pointer;\
+ \
+ static hook_ptr to_hook_ptr (value_type &value)\
+ { return &value.inner.MEMBERNAME; }\
+ static const_hook_ptr to_hook_ptr(const value_type &value)\
+ { return &value.inner.MEMBERNAME; }\
+ static pointer to_value_ptr(hook_ptr n)\
+ {\
+ return get_parent_from_member<MyClass>\
+ (get_parent_from_member<MyClass::InnerNode>(n, &MyClass::InnerNode::MEMBERNAME)\
+ ,&MyClass::inner\
+ );\
+ }\
+ static const_pointer to_value_ptr(const_hook_ptr n)\
+ {\
+ return get_parent_from_member<MyClass>\
+ (get_parent_from_member<MyClass::InnerNode>(n, &MyClass::InnerNode::MEMBERNAME)\
+ ,&MyClass::inner\
+ );\
+ }\
+ };\
+//
+
+
+//This functor converts between MyClass and the InnerNode base hook
+#define InnerBaseHook(TAG, HOOKTYPE)\
+ struct InnerBaseHookFunctor##TAG \
+ {\
+ typedef HOOKTYPE hook_type;\
+ typedef hook_type* hook_ptr;\
+ typedef const hook_type* const_hook_ptr;\
+ typedef MyClass value_type;\
+ typedef value_type* pointer;\
+ typedef const value_type* const_pointer;\
+ \
+ static hook_ptr to_hook_ptr (value_type &value)\
+ { return &value.inner; }\
+ static const_hook_ptr to_hook_ptr(const value_type &value)\
+ { return &value.inner; }\
+ static pointer to_value_ptr(hook_ptr n)\
+ {\
+ return get_parent_from_member<MyClass>(static_cast<MyClass::InnerNode*>(n),&MyClass::inner);\
+ }\
+ static const_pointer to_value_ptr(const_hook_ptr n)\
+ {\
+ return get_parent_from_member<MyClass>(static_cast<const MyClass::InnerNode*>(n),&MyClass::inner);\
+ }\
+ };\
+//
+
+//List
+InnerMemberHook(List, list_member_hook<>, listhook)
+InnerBaseHook(List, list_base_hook<>)
+//Slist
+InnerMemberHook(Slist, slist_member_hook<>, slisthook)
+InnerBaseHook(Slist, slist_base_hook<>)
+//Set
+InnerMemberHook(Set, set_member_hook<>, sethook)
+InnerBaseHook(Set, set_base_hook<>)
+//Unordered Set
+InnerMemberHook(USet, unordered_set_member_hook<>, usethook)
+InnerBaseHook(USet, unordered_set_base_hook<>)
+
+//Define containers
+typedef list < MyClass, function_hook< InnerMemberHookFunctorList> > CustomListMember;
+typedef list < MyClass, function_hook< InnerBaseHookFunctorList > > CustomListBase;
+typedef slist< MyClass, function_hook< InnerMemberHookFunctorSlist> > CustomSlistMember;
+typedef slist< MyClass, function_hook< InnerBaseHookFunctorSlist > > CustomSlistBase;
+typedef set < MyClass, function_hook< InnerMemberHookFunctorSet> > CustomSetMember;
+typedef set < MyClass, function_hook< InnerBaseHookFunctorSet > > CustomSetBase;
+typedef unordered_set< MyClass, function_hook< InnerMemberHookFunctorUSet> > CustomUSetMember;
+typedef unordered_set< MyClass, function_hook< InnerBaseHookFunctorUSet > > CustomUSetBase;
+
+int main()
+{
+ MyClass n;
+ CustomListBase listbase;
+ CustomListMember listmember;
+ CustomSlistBase slistbase;
+ CustomSlistMember slistmember;
+ CustomSetBase setbase;
+ CustomSetMember setmember;
+ CustomUSetBase::bucket_type buckets[1];
+ CustomUSetBase usetbase(CustomUSetBase::bucket_traits(buckets, 1));
+ CustomUSetMember usetmember(CustomUSetMember::bucket_traits(buckets, 1));
+
+ listbase.insert(listbase.begin(), n);
+ listmember.insert(listmember.begin(), n);
+ slistbase.insert(slistbase.begin(), n);
+ slistmember.insert(slistmember.begin(), n);
+ setbase.insert(n);
+ setmember.insert(n);
+ usetbase.insert(n);
+ usetmember.insert(n);
+
+ return 0;
+}
+
+#include <boost/intrusive/detail/config_end.hpp>

Modified: trunk/libs/intrusive/test/generic_assoc_test.hpp
==============================================================================
--- trunk/libs/intrusive/test/generic_assoc_test.hpp (original)
+++ trunk/libs/intrusive/test/generic_assoc_test.hpp 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -402,9 +402,9 @@
       
       for(vec_iterator it(--values.end()); true; --it){
          testset.push_front(*it);
- if(it == values.begin()){
+ if(it == values.begin()){
             break;
- }
+ }
       }
       BOOST_TEST(testset.size() == values.size());
       TEST_INTRUSIVE_SEQUENCE_EXPECTED(values, testset.begin());

Modified: trunk/libs/intrusive/test/list_test.cpp
==============================================================================
--- trunk/libs/intrusive/test/list_test.cpp (original)
+++ trunk/libs/intrusive/test/list_test.cpp 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -10,10 +10,8 @@
 // See http://www.boost.org/libs/intrusive for documentation.
 //
 /////////////////////////////////////////////////////////////////////////////
-
 #include <boost/intrusive/detail/config_begin.hpp>
 #include <boost/intrusive/list.hpp>
-
 #include <boost/intrusive/detail/pointer_to_other.hpp>
 #include "itestvalue.hpp"
 #include "smart_ptr.hpp"
@@ -500,4 +498,3 @@
 
    return boost::report_errors();
 }
-#include <boost/intrusive/detail/config_end.hpp>

Added: trunk/libs/intrusive/test/recursive_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/intrusive/test/recursive_test.cpp 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -0,0 +1,71 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2010
+//
+// 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/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/intrusive/avl_set.hpp>
+#include <boost/intrusive/sg_set.hpp>
+#include <boost/intrusive/splay_set.hpp>
+#include <boost/intrusive/treap_set.hpp>
+#include <cassert>
+
+using namespace boost::intrusive;
+
+typedef list_base_hook<> ListBaseHook;
+typedef slist_base_hook<> SListBaseHook;
+typedef set_base_hook<> SetBaseHook;
+typedef unordered_set_base_hook<> USetBaseHook;
+
+class Foo;
+typedef unordered_set<Foo, base_hook<USetBaseHook> > USet;
+
+class Foo : public ListBaseHook, public SListBaseHook, public SetBaseHook, public USetBaseHook
+{
+ USet::bucket_type buckets[1];
+ Foo(const Foo &);
+ Foo & operator=(const Foo &);
+
+ public:
+ Foo() : uset_children(USet::bucket_traits(buckets, 1))
+ {}
+ list <Foo, base_hook<ListBaseHook> > list_children;
+ slist<Foo, base_hook<SListBaseHook> > slist_children;
+ set <Foo, base_hook<SetBaseHook> > set_children;
+ USet uset_children;
+};
+
+void instantiate()
+{
+ list< Foo, base_hook<ListBaseHook> > list_; list_.clear();
+ slist< Foo, base_hook<SListBaseHook> > slist_; slist_.clear();
+ set< Foo, base_hook<SetBaseHook> > set_; set_.clear();
+
+ USet::bucket_type buckets[1];
+ USet unordered_set_(USet::bucket_traits(buckets, 1)); unordered_set_.clear();
+}
+int main()
+{
+ instantiate();
+
+ //A small test with list
+ {
+ Foo f, f2;
+ list< Foo, base_hook<ListBaseHook> > l;
+ l.insert(l.begin(), f);
+ l.begin()->list_children.insert(l.begin()->list_children.begin(), f2);
+ assert(l.size() == l.begin()->list_children.size());
+ l.begin()->list_children.clear();
+ l.clear();
+ }
+ return 0;
+}

Modified: trunk/libs/intrusive/test/smart_ptr.hpp
==============================================================================
--- trunk/libs/intrusive/test/smart_ptr.hpp (original)
+++ trunk/libs/intrusive/test/smart_ptr.hpp 2010-08-24 13:13:19 EDT (Tue, 24 Aug 2010)
@@ -13,6 +13,7 @@
 
 #include <boost/iterator.hpp>
 #include <boost/intrusive/pointer_plus_bits.hpp>
+#include <boost/pointer_cast.hpp>
 
 #if (defined _MSC_VER) && (_MSC_VER >= 1200)
 # pragma once
@@ -312,7 +313,7 @@
 //!Simulation of static_cast between pointers. Never throws.
 template<class T, class U>
 inline smart_ptr<T>
- static_pointer_cast(smart_ptr<U> const & r)
+ static_pointer_cast(const smart_ptr<U> & r)
 {
    return smart_ptr<T>(r, detail::static_cast_tag());
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk