Boost logo

Boost-Commit :

From: phil_at_[hidden]
Date: 2008-05-02 05:07:49


Author: pbouchard
Date: 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
New Revision: 45012
URL: http://svn.boost.org/trac/boost/changeset/45012

Log:
Creating shifted_ptr folder.
Added:
   sandbox/shifted_ptr/
   sandbox/shifted_ptr/LICENSE_1_0.txt (contents, props changed)
   sandbox/shifted_ptr/README.txt (contents, props changed)
   sandbox/shifted_ptr/Shifted Pointer.vcproj (contents, props changed)
   sandbox/shifted_ptr/boost/
   sandbox/shifted_ptr/boost/detail/
   sandbox/shifted_ptr/boost/detail/intrusive_list.hpp (contents, props changed)
   sandbox/shifted_ptr/boost/detail/intrusive_stack.hpp (contents, props changed)
   sandbox/shifted_ptr/boost/detail/sh_owned_base.hpp (contents, props changed)
   sandbox/shifted_ptr/boost/detail/sh_owned_base_gcc_x86.hpp (contents, props changed)
   sandbox/shifted_ptr/boost/detail/sh_owned_base_nt.hpp (contents, props changed)
   sandbox/shifted_ptr/boost/detail/sh_owned_impl.h (contents, props changed)
   sandbox/shifted_ptr/boost/detail/sh_utility.h (contents, props changed)
   sandbox/shifted_ptr/boost/detail/shifted_ptr_base.hpp (contents, props changed)
   sandbox/shifted_ptr/boost/shifted_ptr.hpp (contents, props changed)
   sandbox/shifted_ptr/libs/
   sandbox/shifted_ptr/libs/smart_ptr/
   sandbox/shifted_ptr/libs/smart_ptr/doc/
   sandbox/shifted_ptr/libs/smart_ptr/doc/api/
   sandbox/shifted_ptr/libs/smart_ptr/example/
   sandbox/shifted_ptr/libs/smart_ptr/example/shifted_ptr_test1.cpp (contents, props changed)
   sandbox/shifted_ptr/libs/smart_ptr/example/shifted_ptr_test2.cpp (contents, props changed)

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

Added: sandbox/shifted_ptr/README.txt
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/README.txt 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,14 @@
+Unless otherwise specified, terms and conditions of use for Boost software
+and documentation are described in the accompanying license. See the file
+named LICENSE in the top-level directory.
+
+For the most current version of Boost libraries and documentation, see:
+
+ http://www.boost.org
+
+Boost documentation is in HTML format.
+
+The top-level directory (which contains this README file) should contain
+a file named index.htm with links to all documentation, including
+documentation on building boost libraries for your particular compiler
+and operating system.

Added: sandbox/shifted_ptr/Shifted Pointer.vcproj
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/Shifted Pointer.vcproj 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,579 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="Shifted Pointer"
+ ProjectGUID="{2A8158F0-75F4-4A6C-8D42-5A9B15C239D3}"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".\;..\..\boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__PRETTY_FUNCTION__=__FUNCTION__"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="false"
+ LinkLibraryDependencies="true"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories=""
+ IgnoreAllDefaultLibraries="false"
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\trunk"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\boost\detail\intrusive_list.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\boost\detail\intrusive_stack.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\boost\detail\sh_owned_base.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\boost\detail\sh_owned_base_gcc_x86.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\boost\detail\sh_owned_base_nt.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\boost\detail\sh_owned_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\boost\detail\sh_utility.h"
+ >
+ </File>
+ <File
+ RelativePath=".\boost\shifted_ptr.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\boost\detail\shifted_ptr_base.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\libs\smart_ptr\example\shifted_ptr_test2.cpp"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\annotated.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1intrusive__list-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1intrusive__list.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1intrusive__list__base-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1intrusive__list__base.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1intrusive__stack-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1intrusive__stack.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1intrusive__stack__base-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1intrusive__stack__base.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned_1_1roofof-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned_1_1roofof.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned_3_01void_01_4-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned_3_01void_01_4.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned_3_01void_01_4_1_1roofof-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned_3_01void_01_4_1_1roofof.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned__base-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned__base.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned__impl__p-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned__impl__p.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned__impl__pd-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned__impl__pd.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned__impl__pda-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1owned__impl__pda.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1set-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1set.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1shifted__ptr-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1shifted__ptr.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1shifted__ptr__base-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1shifted__ptr__base.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1shifted__ptr__base_3_01T[N]_4-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1shifted__ptr__base_3_01T[N]_4.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1shifted__ptr__base_3_01void_01_4-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classboost_1_1detail_1_1sh_1_1shifted__ptr__base_3_01void_01_4.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\classes.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\files.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\functions.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\functions_func.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\functions_rela.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\functions_type.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\functions_vars.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\globals.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\globals_defs.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\graph_legend.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\hierarchy.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\index.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\index.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\inherits.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\intrusive__list_8hpp-source.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\intrusive__list_8hpp.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\intrusive__stack_8hpp-source.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\intrusive__stack_8hpp.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\main.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\namespaceboost.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\namespaceboost_1_1detail.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\namespaceboost_1_1detail_1_1sh.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\namespacemembers.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\namespacemembers_func.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\namespaces.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__owned__base_8hpp-source.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__owned__base_8hpp.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__owned__base__gcc__x86_8hpp-source.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__owned__base__gcc__x86_8hpp.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__owned__base__nt_8hpp-source.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__owned__base__nt_8hpp.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__owned__impl_8h-source.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__owned__impl_8h.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__utility_8h-source.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\sh__utility_8h.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\shifted__ptr_8hpp-source.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\shifted__ptr_8hpp.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\shifted__ptr__base_8hpp-source.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\shifted__ptr__base_8hpp.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1intrusive__list_1_1iterator-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1intrusive__list_1_1iterator.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1intrusive__list__node-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1intrusive__list__node.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1intrusive__stack_1_1iterator-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1intrusive__stack_1_1iterator.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1intrusive__stack__node-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1intrusive__stack__node.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1rootof-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1rootof.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1rootof_3_01true_01_4-members.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\structboost_1_1detail_1_1sh_1_1rootof_3_01true_01_4.html"
+ >
+ </File>
+ <File
+ RelativePath=".\libs\smart_ptr\doc\api\tree.html"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/shifted_ptr/boost/detail/intrusive_list.hpp
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/boost/detail/intrusive_list.hpp 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,167 @@
+/**
+ @file
+ Boost intrusive_list.hpp header file.
+
+ @note
+ Copyright (c) 2008 Phil Bouchard <phil_at_[hidden]>.
+
+ 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/smart_ptr/doc/index.html for documentation.
+*/
+
+
+#ifndef BOOST_INTRUSIVE_LIST_HPP_INCLUDED
+#define BOOST_INTRUSIVE_LIST_HPP_INCLUDED
+
+
+#include <boost/detail/sh_utility.h>
+
+
+namespace boost
+{
+
+namespace detail
+{
+
+namespace sh
+{
+
+
+struct intrusive_list_node
+{
+ intrusive_list_node * next;
+ intrusive_list_node * prev;
+
+ intrusive_list_node() : next(this), prev(this)
+ {
+ }
+
+ void insert(intrusive_list_node * const p)
+ {
+ p->next = this;
+ p->prev = prev;
+
+ prev->next = p;
+ prev = p;
+ }
+
+ void erase()
+ {
+ prev->next = next;
+ next->prev = prev;
+
+ next = this;
+ prev = this;
+ }
+
+ ~intrusive_list_node()
+ {
+ erase();
+ }
+};
+
+
+class intrusive_list_base
+{
+protected:
+ intrusive_list_node impl;
+
+ void clear()
+ {
+ impl.next = & impl;
+ impl.prev = & impl;
+ }
+};
+
+
+/**
+ Static list.
+
+ Rewritten list template with explicit access to internal nodes. This
+ allows usages of tags already part of an object, used to group objects
+ together without the need of any memory allocation.
+*/
+
+class intrusive_list : protected intrusive_list_base
+{
+ typedef intrusive_list_base base;
+
+public:
+ typedef intrusive_list_node node;
+ typedef intrusive_list_node * pointer;
+ template <typename T, intrusive_list_node T::* P>
+ struct iterator;
+
+protected:
+ using base::impl;
+
+public:
+ pointer begin() { return impl.next; }
+ pointer end() { return & impl; }
+
+ bool empty() const { return impl.next == & impl; }
+
+ void push_back(pointer i)
+ {
+ end()->insert(i);
+ }
+
+ void merge(intrusive_list& x)
+ {
+ if (! x.empty())
+ {
+ x.impl.prev->next = impl.next;
+ impl.next->prev = x.impl.prev;
+
+ impl.next = x.impl.next;
+ x.impl.next->prev = & impl;
+
+ x.clear();
+ }
+ }
+};
+
+
+template <typename T, intrusive_list_node T::* P>
+ struct intrusive_list::iterator
+ {
+ typedef iterator self_type;
+ typedef intrusive_list_node node_type;
+
+ iterator() : node_() {}
+ iterator(intrusive_list::pointer __x) : node_(__x) {}
+
+ T & operator * () const { return * roofof(P, node_); }
+ T * operator -> () const { return roofof(P, node_); }
+
+ self_type & operator ++ ()
+ {
+ node_ = node_->next;
+ return * this;
+ }
+
+ self_type & operator -- ()
+ {
+ node_ = node_->prev;
+ return * this;
+ }
+
+ bool operator == (const self_type & x) const { return node_ == x.node_; }
+ bool operator != (const self_type & x) const { return node_ != x.node_; }
+
+ node_type * node_;
+ };
+
+
+} // namespace sh
+
+} // namespace detail
+
+} // namespace boost
+
+
+#endif // #ifndef BOOST_INTRUSIVE_LIST_HPP_INCLUDED

Added: sandbox/shifted_ptr/boost/detail/intrusive_stack.hpp
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/boost/detail/intrusive_stack.hpp 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,126 @@
+/**
+ @file
+ Boost intrusive_stack.hpp header file.
+
+ @note
+ Copyright (c) 2008 Phil Bouchard <phil_at_[hidden]>.
+
+ 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/smart_ptr/doc/index.html for documentation.
+*/
+
+
+#ifndef BOOST_INTRUSIVE_STACK_HPP_INCLUDED
+#define BOOST_INTRUSIVE_STACK_HPP_INCLUDED
+
+
+#include <boost/detail/sh_utility.h>
+
+
+namespace boost
+{
+
+namespace detail
+{
+
+namespace sh
+{
+
+
+struct intrusive_stack_node
+{
+ intrusive_stack_node * next;
+
+ void insert(intrusive_stack_node * const p)
+ {
+ p->next = next;
+ next = p;
+ }
+};
+
+
+class intrusive_stack_base
+{
+protected:
+ intrusive_stack_node impl;
+
+ intrusive_stack_base() { clear(); }
+
+ void clear()
+ {
+ impl.next = & impl;
+ }
+};
+
+
+/**
+ Static stack.
+
+ Rewritten stack template with explicit access to internal nodes. This
+ allows usages of tags already part of an object, used to group objects
+ together without the need of any memory allocation.
+*/
+
+class intrusive_stack : protected intrusive_stack_base
+{
+ typedef intrusive_stack_base base;
+
+public:
+ typedef intrusive_stack_node node;
+ typedef intrusive_stack_node * pointer;
+ template <typename T, intrusive_stack_node T::* P>
+ struct iterator;
+
+protected:
+ using base::impl;
+
+public:
+ pointer begin() { return impl.next; }
+ pointer end() { return & impl; }
+
+ bool empty() const { return impl.next == & impl; }
+
+ void push(pointer i)
+ {
+ end()->insert(i);
+ }
+};
+
+
+template <typename T, intrusive_stack_node T::* P>
+ struct intrusive_stack::iterator
+ {
+ typedef iterator self_type;
+ typedef intrusive_stack_node node_type;
+
+ iterator() : node_() {}
+ iterator(intrusive_stack::pointer __x) : node_(__x) {}
+
+ T & operator * () const { return * roofof(P, node_); }
+ T * operator -> () const { return roofof(P, node_); }
+
+ self_type & operator ++ ()
+ {
+ node_ = node_->next;
+ return * this;
+ }
+
+ bool operator == (const self_type & x) const { return node_ == x.node_; }
+ bool operator != (const self_type & x) const { return node_ != x.node_; }
+
+ node_type * node_;
+ };
+
+
+} // namespace sh
+
+} // namespace detail
+
+} // namespace boost
+
+
+#endif // #ifndef BOOST_INTRUSIVE_STACK_HPP_INCLUDED

Added: sandbox/shifted_ptr/boost/detail/sh_owned_base.hpp
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/boost/detail/sh_owned_base.hpp 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,88 @@
+/**
+ @file
+ Boost sh_owned_base.hpp header file.
+
+ @note
+ Copyright (c) 2008 Phil Bouchard <phil_at_[hidden]>.
+
+ 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/smart_ptr/doc/index.html for documentation.
+*/
+
+
+#ifndef BOOST_DETAIL_SP_OWNED_BASE_HPP_INCLUDED
+#define BOOST_DETAIL_SP_OWNED_BASE_HPP_INCLUDED
+
+// Me
+#define BOOST_SP_DISABLE_THREADS
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// detail/sh_owned_base.hpp
+//
+// Copyright 2008 Phil Bouchard
+//
+// 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)
+//
+
+#include <boost/config.hpp>
+
+#if defined( BOOST_SP_DISABLE_THREADS )
+
+# include <boost/detail/sh_owned_base_nt.hpp>
+
+#elif defined( BOOST_SP_USE_PTHREADS )
+
+# include <boost/detail/sh_owned_base_pt.hpp>
+
+#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
+
+# include <boost/detail/sh_owned_base_gcc_x86.hpp>
+
+//~ #elif defined( __MWERKS__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
+
+//~ # include <boost/detail/sh_owned_base_cw_x86.hpp>
+
+#elif defined( __GNUC__ ) && defined( __ia64__ ) && !defined( __INTEL_COMPILER )
+
+# include <boost/detail/sh_owned_base_gcc_ia64.hpp>
+
+#elif defined( __MWERKS__ ) && defined( __POWERPC__ )
+
+# include <boost/detail/sh_owned_base_cw_ppc.hpp>
+
+#elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) )
+
+# include <boost/detail/sh_owned_base_gcc_ppc.hpp>
+
+#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
+
+# include <boost/detail/sh_owned_base_w32.hpp>
+
+#elif !defined( BOOST_HAS_THREADS )
+
+# include <boost/detail/sh_owned_base_nt.hpp>
+
+#elif defined( BOOST_HAS_PTHREADS )
+
+# include <boost/detail/sh_owned_base_pt.hpp>
+
+#else
+
+// Use #define BOOST_DISABLE_THREADS to avoid the error
+# error Unrecognized threading platform
+
+#endif
+
+#endif // #ifndef BOOST_DETAIL_SH_OWNED_BASE_HPP_INCLUDED

Added: sandbox/shifted_ptr/boost/detail/sh_owned_base_gcc_x86.hpp
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/boost/detail/sh_owned_base_gcc_x86.hpp 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,159 @@
+#ifndef BOOST_DETAIL_SH_OWNED_BASE_GCC_X86_HPP_INCLUDED
+#define BOOST_DETAIL_SH_OWNED_BASE_GCC_X86_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// detail/sh_owned_base_gcc_x86.hpp - g++ on 486+ or AMD64
+//
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+// Copyright 2004-2005 Peter Dimov
+//
+// 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)
+//
+//
+// Lock-free algorithm by Alexander Terekhov
+//
+// Thanks to Ben Hitchings for the #weak + (#shared != 0)
+// formulation
+//
+
+#include <boost/detail/sp_owned_base_gcc_x86.hpp>
+
+#include <typeinfo>
+
+namespace boost
+{
+
+namespace detail
+{
+
+namespace sh
+{
+
+inline int atomic_exchange_and_add( int * pw, int dv )
+{
+ // int r = *pw;
+ // *pw += dv;
+ // return r;
+
+ int r;
+
+ __asm__ __volatile__
+ (
+ "lock\n\t"
+ "xadd %1, %0":
+ "=m"( *pw ), "=r"( r ): // outputs (%0, %1)
+ "m"( *pw ), "1"( dv ): // inputs (%2, %3 == %1)
+ "memory", "cc" // clobbers
+ );
+
+ return r;
+}
+
+inline void atomic_increment( int * pw )
+{
+ //atomic_exchange_and_add( pw, 1 );
+
+ __asm__
+ (
+ "lock\n\t"
+ "incl %0":
+ "=m"( *pw ): // output (%0)
+ "m"( *pw ): // input (%1)
+ "cc" // clobbers
+ );
+}
+
+inline int atomic_conditional_increment( int * pw )
+{
+ // int rv = *pw;
+ // if( rv != 0 ) ++*pw;
+ // return rv;
+
+ int rv, tmp;
+
+ __asm__
+ (
+ "movl %0, %%eax\n\t"
+ "0:\n\t"
+ "test %%eax, %%eax\n\t"
+ "je 1f\n\t"
+ "movl %%eax, %2\n\t"
+ "incl %2\n\t"
+ "lock\n\t"
+ "cmpxchgl %2, %0\n\t"
+ "jne 0b\n\t"
+ "1:":
+ "=m"( *pw ), "=&a"( rv ), "=&r"( tmp ): // outputs (%0, %1, %2)
+ "m"( *pw ): // input (%3)
+ "cc" // clobbers
+ );
+
+ return rv;
+}
+
+class owned_base : public sp_counted_base
+{
+private:
+
+ owned_base( owned_base const & );
+ owned_base & operator= ( owned_base const & );
+
+ long seg_count_; // #shifted
+ owned_base * po_;
+ owned_base ** ppo_;
+
+public:
+
+ owned_base(): seg_count_( 1 ), po_( this ), ppo_( po_ )
+ {
+ }
+
+ void add_own_copy()
+ {
+ atomic_increment( &(*ppo_)->seg_count_ );
+ }
+
+ bool add_own_lock() // true on success
+ {
+ return atomic_conditional_increment( &(*ppo_)->seg_count_ ) != 0;
+ }
+
+ void release() // nothrow
+ {
+ if( atomic_exchange_and_add( &(*ppo_)->seg_count_, -1 ) == 1 )
+ {
+ dispose();
+ }
+ }
+
+ long seg_count() const // nothrow
+ {
+ return static_cast<int const volatile &>( (*ppo_)->seg_count_ );
+ }
+
+ owned_base * owner() const // nothrow
+ {
+ return (*ppo_);
+ }
+
+ void owner(owned_base * p) // nothrow
+ {
+ (*ppo_) = p;
+ }
+};
+
+} // namespace sh
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_SH_OWNED_BASE_GCC_X86_HPP_INCLUDED

Added: sandbox/shifted_ptr/boost/detail/sh_owned_base_nt.hpp
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/boost/detail/sh_owned_base_nt.hpp 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,241 @@
+/**
+ @file
+ Boost detail/sh_owned_base_nt.hpp header file.
+
+ @note
+ Copyright (c) 2008 Phil Bouchard <phil_at_[hidden]>.
+
+ 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/smart_ptr/doc/index.html for documentation.
+*/
+
+
+#ifndef BOOST_DETAIL_SH_OWNED_BASE_NT_HPP_INCLUDED
+#define BOOST_DETAIL_SH_OWNED_BASE_NT_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <stack>
+#include <limits>
+
+// Bypassing linkage by default
+#define BOOST_SH_DISABLE_THREADS
+
+#include <boost/thread.hpp>
+#include <boost/thread/tss.hpp>
+#include <boost/type_traits/is_array.hpp>
+#include <boost/type_traits/remove_extent.hpp>
+#include <boost/type_traits/has_trivial_destructor.hpp>
+#include <boost/detail/intrusive_list.hpp>
+#include <boost/detail/intrusive_stack.hpp>
+#include <boost/detail/sh_utility.h>
+#include <boost/detail/sp_counted_base_nt.hpp>
+
+
+namespace boost
+{
+
+namespace detail
+{
+
+namespace sh
+{
+
+
+class set;
+class owned_base;
+
+
+#ifndef BOOST_SH_DISABLE_THREADS
+struct thread_specific_stack : thread_specific_ptr< std::stack<owned_base *> >
+{
+ thread_specific_stack()
+ {
+ reset(new std::stack<owned_base *>());
+ }
+};
+#endif
+
+
+/**
+ Root class of all pointees.
+*/
+
+class owned_base : public sp_counted_base
+{
+ typedef std::pair<char *, char *> segment;
+
+ intrusive_stack ptrs_;
+ intrusive_list inits_;
+
+public:
+ intrusive_list::node set_tag_;
+ intrusive_list::node init_tag_;
+
+ owned_base()
+ {
+ inits_.push_back(& init_tag_);
+ }
+
+ static bool contains(const segment & heap, void const * p)
+ {
+ return ! (static_cast<char const *>(p) < heap.first || static_cast<char const *>(p) > heap.second);
+ }
+
+ intrusive_stack * ptrs() { return & ptrs_; }
+ intrusive_list * inits() { return & inits_; }
+ intrusive_list::node * set_tag() { return & set_tag_; }
+ intrusive_list::node * init_tag() { return & init_tag_; }
+
+ static segment heap;
+#ifndef BOOST_SH_DISABLE_THREADS
+ static thread_specific_stack last;
+#else
+ static std::stack<owned_base *> * last;
+#endif
+};
+
+
+owned_base::segment owned_base::heap((char *)(std::numeric_limits<unsigned>::max)(), (char *)(std::numeric_limits<unsigned>::min)());
+
+#ifndef BOOST_SH_DISABLE_THREADS
+thread_specific_stack owned_base::last;
+#else
+std::stack<owned_base *> * owned_base::last = new std::stack<owned_base *>;
+#endif
+
+
+/**
+ Object wrapper.
+*/
+
+template <typename T>
+ class owned : public owned_base
+ {
+ typedef T data_type;
+
+ union
+ {
+ void * vp_;
+ char p_[sizeof(data_type)];
+ };
+
+ public:
+ class roofof;
+ friend class roofof;
+
+ data_type * element() { return static_cast<data_type *>(static_cast<void *>(& p_[0])); }
+
+ virtual ~owned() { dispose(); }
+ virtual void dispose() { dispose(element(), is_array<data_type>()); }
+
+ virtual void * get_deleter( std::type_info const & ti ) { return 0; } // dummy
+
+ static void * operator new (size_t n)
+ {
+ char * p = static_cast<char *>(::operator new (n));
+
+ if (p < static_cast<char *>(heap.first)) heap.first = p;
+ if (p + n > static_cast<char *>(heap.second)) heap.second = p + n;
+
+ return p;
+ }
+
+ static void operator delete (void * p)
+ {
+ ::operator delete (p);
+ }
+
+ public:
+ class roofof
+ {
+ owned<data_type> * p_;
+
+ public:
+ roofof(data_type * p) : p_(sh::roofof((data_type owned<data_type>::*)(& owned<data_type>::p_), p)) {}
+
+ operator owned<data_type> * () const { return p_; }
+ };
+
+ private:
+ template <typename U>
+ static void dispose_array(U * p, const false_type &)
+ {
+ typedef typename remove_extent<U>::type element_type;
+
+ for (element_type * i = * p; i != * p + sizeof(data_type) / sizeof(element_type); i ++)
+ dispose(i, is_array<element_type>());
+ }
+
+ template <typename U>
+ static void dispose_array(U * p, const true_type &)
+ {
+ }
+
+ template <typename U>
+ static void dispose(U * p, const false_type &)
+ {
+ p->~U();
+ }
+
+ template <typename U>
+ static void dispose(U * p, const true_type &)
+ {
+ dispose_array(p, has_trivial_destructor<data_type>());
+ }
+ };
+
+
+template <>
+ class owned<void> : public owned_base
+ {
+ typedef void data_type;
+
+ union
+ {
+ void * vp_;
+ char p_;
+ };
+
+ owned();
+
+ public:
+ class roofof;
+ friend class roofof;
+
+ data_type * element() { return & p_; }
+
+ virtual ~owned() {}
+ virtual void dispose() {}
+
+ virtual void * get_deleter( std::type_info const & ti ) {}
+
+ public:
+ class roofof
+ {
+ owned<data_type> * p_;
+
+ public:
+ roofof(data_type * p) : p_(sh::roofof((char owned<data_type>::*)(& owned<data_type>::p_), static_cast<char *>(p))) {}
+
+ operator owned<data_type> * () const { return p_; }
+ };
+ };
+
+
+} // namespace sh
+
+} // namespace detail
+
+} // namespace boost
+
+
+#endif // #ifndef BOOST_DETAIL_SH_OWNED_BASE_NT_HPP_INCLUDED

Added: sandbox/shifted_ptr/boost/detail/sh_owned_impl.h
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/boost/detail/sh_owned_impl.h 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,231 @@
+/**
+ @file
+ Boost sh_owned_impl.h header file.
+
+ @note
+ Copyright (c) 2008 Phil Bouchard <phil_at_[hidden]>.
+
+ 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/smart_ptr/doc/index.html for documentation.
+*/
+
+
+#ifndef BOOST_DETAIL_SH_OWNED_IMPL_HPP_INCLUDED
+#define BOOST_DETAIL_SH_OWNED_IMPL_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// detail/sh_owned_impl.hpp
+//
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+// Copyright 2008 Philippe Bouchard
+//
+// 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)
+//
+
+#include <boost/config.hpp>
+
+#if defined(BOOST_SP_USE_STD_ALLOCATOR) && defined(BOOST_SP_USE_QUICK_ALLOCATOR)
+# error BOOST_SP_USE_STD_ALLOCATOR and BOOST_SP_USE_QUICK_ALLOCATOR are incompatible.
+#endif
+
+#include <boost/checked_delete.hpp>
+#include <boost/detail/sh_owned_base.hpp>
+
+#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
+#include <boost/detail/quick_allocator.hpp>
+#endif
+
+#if defined(BOOST_SP_USE_STD_ALLOCATOR)
+#include <memory> // std::allocator
+#endif
+
+#include <typeinfo> // std::type_info in get_deleter
+#include <cstddef> // std::size_t
+
+namespace boost
+{
+
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+
+void sh_scalar_constructor_hook( void * px, std::size_t size, void * pn );
+void sh_scalar_destructor_hook( void * px, std::size_t size, void * pn );
+
+#endif
+
+namespace detail
+{
+
+namespace sh
+{
+
+template<class X> class owned_impl_p: public owned<X>
+{
+private:
+
+ owned_impl_p( owned_impl_p const & );
+ owned_impl_p & operator= ( owned_impl_p const & );
+
+ typedef owned_impl_p<X> this_type;
+
+public:
+
+ virtual void dispose() // nothrow
+ {
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ boost::scalar_destructor_hook( p_, sizeof(X), this );
+#endif
+ }
+
+ virtual void * get_deleter( std::type_info const & )
+ {
+ return 0;
+ }
+
+#if defined(BOOST_SP_USE_STD_ALLOCATOR)
+
+ void * operator new( std::size_t )
+ {
+ return std::allocator<this_type>().allocate( 1, static_cast<this_type *>(0) );
+ }
+
+ void operator delete( void * p )
+ {
+ std::allocator<this_type>().deallocate( static_cast<this_type *>(p), 1 );
+ }
+
+#endif
+
+#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
+
+ void * operator new( std::size_t )
+ {
+ return quick_allocator<this_type>::alloc();
+ }
+
+ void operator delete( void * p )
+ {
+ quick_allocator<this_type>::dealloc( p );
+ }
+
+#endif
+};
+
+//
+// Borland's Codeguard trips up over the -Vx- option here:
+//
+#ifdef __CODEGUARD__
+# pragma option push -Vx-
+#endif
+
+template<class P, class D> class owned_impl_pd: public owned<X>
+{
+private:
+
+ D d_; // copy constructor must not throw
+
+ owned_impl_pd( owned_impl_pd const & );
+ owned_impl_pd & operator= ( owned_impl_pd const & );
+
+ typedef owned_impl_pd<P, D> this_type;
+
+public:
+
+ // pre: d(p) must not throw
+
+ owned_impl_pd( D d ): d_(d)
+ {
+ }
+
+ virtual void dispose() // nothrow
+ {
+ d_( p_ );
+ }
+
+ virtual void * get_deleter( std::type_info const & ti )
+ {
+ return ti == typeid(D)? &d_: 0;
+ }
+
+#if defined(BOOST_SP_USE_STD_ALLOCATOR)
+
+ void * operator new( std::size_t )
+ {
+ return std::allocator<this_type>().allocate( 1, static_cast<this_type *>(0) );
+ }
+
+ void operator delete( void * p )
+ {
+ std::allocator<this_type>().deallocate( static_cast<this_type *>(p), 1 );
+ }
+
+#endif
+
+#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
+
+ void * operator new( std::size_t )
+ {
+ return quick_allocator<this_type>::alloc();
+ }
+
+ void operator delete( void * p )
+ {
+ quick_allocator<this_type>::dealloc( p );
+ }
+
+#endif
+};
+
+template<class P, class D, class A> class owned_impl_pda: public owned<X>
+{
+private:
+
+ D d_; // copy constructor must not throw
+ A a_; // copy constructor must not throw
+
+ owned_impl_pda( owned_impl_pda const & );
+ owned_impl_pda & operator= ( owned_impl_pda const & );
+
+ typedef owned_impl_pda<P, D, A> this_type;
+
+public:
+
+ // pre: d( p ) must not throw
+
+ owned_impl_pda( D d, A a ): d_( d ), a_( a )
+ {
+ }
+
+ virtual void dispose() // nothrow
+ {
+ d_( p_ );
+ }
+
+ virtual void * get_deleter( std::type_info const & ti )
+ {
+ return ti == typeid( D )? &d_: 0;
+ }
+};
+
+#ifdef __CODEGUARD__
+# pragma option pop
+#endif
+
+} // namespace sh
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_SP_OWNED_IMPL_HPP_INCLUDED

Added: sandbox/shifted_ptr/boost/detail/sh_utility.h
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/boost/detail/sh_utility.h 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,100 @@
+/**
+ @file
+ Boost sh_utility.h header file.
+
+ @note
+ Copyright (c) 2008 Phil Bouchard <phil_at_[hidden]>.
+
+ 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/smart_ptr/doc/index.html for documentation.
+*/
+
+
+#ifndef BOOST_DETAIL_SH_UTILITY_H_INCLUDED
+#define BOOST_DETAIL_SH_UTILITY_H_INCLUDED
+
+
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/type_traits/remove_volatile.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
+#include <boost/type_traits/type_with_alignment.hpp>
+
+
+namespace boost
+{
+
+namespace detail
+{
+
+namespace sh
+{
+
+
+/**
+ Block address helper.
+
+ Returns the absolute address of a non-polymorphic object.
+
+ @note
+ Expects template value given by @sa is_polymorphic<>::value.
+*/
+
+template <bool>
+ struct rootof
+ {
+ template <typename U>
+ static void * get(U * a_p)
+ {
+ typedef typename remove_const<typename remove_volatile<U>::type>::type unqualified_type;
+
+ return static_cast<void *>(const_cast<unqualified_type *>(a_p));
+ }
+ };
+
+
+/**
+ Block address helper.
+
+ Returns the absolute address of a polymorphic object.
+*/
+
+template <>
+ struct rootof<true>
+ {
+ template <typename U>
+ static void * get(U * a_p)
+ {
+ typedef typename remove_const<typename remove_volatile<U>::type>::type unqualified_type;
+
+ return dynamic_cast<void *>(const_cast<unqualified_type *>(a_p));
+ }
+ };
+
+
+/**
+ Class member upshift.
+
+ Finds the address of a class given member credentials.
+*/
+
+template <typename T, typename U>
+ T * roofof(U T::* q, U * p)
+ {
+ typedef typename remove_const<typename remove_volatile<U>::type>::type unqualified_type;
+
+ return static_cast<T *>(static_cast<void *>(static_cast<char *>(static_cast<void *>(const_cast<unqualified_type *>(p))) - ptrdiff_t(static_cast<char *>(static_cast<void *>(const_cast<unqualified_type *>(& ((T *)(0)->* q)))) - (char *)(0))));
+ }
+
+
+} // namespace sh
+
+} // namespace detail
+
+} // namespace boost
+
+
+#endif // #ifndef BOOST_DETAIL_SH_UTILITY_H_INCLUDED

Added: sandbox/shifted_ptr/boost/detail/shifted_ptr_base.hpp
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/boost/detail/shifted_ptr_base.hpp 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,344 @@
+/**
+ @file
+ Boost shifted_ptr_base.hpp header file.
+
+ @note
+ Copyright (c) 2003 - 2008 Phil Bouchard <phil_at_[hidden]>.
+
+ 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/smart_ptr/doc/index.html for documentation.
+*/
+
+
+#ifndef BOOST_SHIFTED_PTR_HPP
+#define BOOST_SHIFTED_PTR_HPP
+
+
+#include <boost/detail/sh_utility.h>
+#include <boost/detail/sh_owned_base.hpp>
+
+
+namespace boost
+{
+
+namespace detail
+{
+
+namespace sh
+{
+
+
+/**
+ Smart pointer optimized for speed and memory usage.
+
+ This class represents a basic smart pointer interface.
+*/
+
+template <typename T>
+ class shifted_ptr_base
+ {
+ typedef T element_type;
+ template <typename> friend class shifted_ptr_base;
+
+ protected:
+ element_type * po_;
+
+ public:
+ shifted_ptr_base() : po_(0)
+ {
+ }
+
+ template <typename V>
+ shifted_ptr_base(detail::sh::owned<V> * p) : po_(p->element())
+ {
+ }
+
+ template <typename V>
+ shifted_ptr_base(shifted_ptr_base<V> const & p) : po_(p.share())
+ {
+ }
+
+ shifted_ptr_base(shifted_ptr_base<element_type> const & p) : po_(p.share())
+ {
+ }
+
+ template <typename V>
+ shifted_ptr_base & operator = (detail::sh::owned<V> * p)
+ {
+ reset(p->element());
+
+ return * this;
+ }
+
+ template <typename V>
+ shifted_ptr_base & operator = (shifted_ptr_base<V> const & p)
+ {
+ if (p.po_ != po_)
+ {
+ reset(p.share());
+ }
+ return * this;
+ }
+
+ shifted_ptr_base & operator = (shifted_ptr_base<element_type> const & p)
+ {
+ return operator = <element_type>(p);
+ }
+
+ element_type & operator * () const
+ {
+ return * po_;
+ }
+
+ element_type * operator -> () const
+ {
+ return po_;
+ }
+
+ element_type * get() const
+ {
+ return po_;
+ }
+
+ element_type * share() const
+ {
+ if (po_)
+ {
+ header()->add_ref_copy();
+ }
+ return po_;
+ }
+
+ void reset(element_type * p = 0)
+ {
+ if (po_)
+ {
+ header()->release();
+ }
+ po_ = p;
+ }
+
+ ~shifted_ptr_base()
+ {
+ if (po_)
+ {
+ header()->release();
+ }
+ }
+
+
+ protected:
+ detail::sh::owned_base * header() const
+ {
+ detail::sh::owned_base * p = (owned<element_type> *) (typename owned<element_type>::roofof) static_cast<element_type *>(rootof<is_polymorphic<element_type>::value>::get(po_));
+ return p;
+ }
+ };
+
+
+#if !defined(_MSC_VER)
+template <typename T, size_t N>
+ class shifted_ptr_base<T [N]>
+ {
+ typedef T element_type[N];
+ template <typename> friend class shifted_ptr_base;
+
+ protected:
+ element_type * po_;
+
+ public:
+ shifted_ptr_base() : po_(0)
+ {
+ }
+
+ template <typename V>
+ shifted_ptr_base(detail::sh::owned<V> * p) : po_(p->element())
+ {
+ }
+
+ template <typename V>
+ shifted_ptr_base(shifted_ptr_base<V> const & p) : po_(p.share())
+ {
+ }
+
+ shifted_ptr_base(shifted_ptr_base<element_type> const & p) : po_(p.share())
+ {
+ }
+
+ template <typename V>
+ shifted_ptr_base & operator = (detail::sh::owned<V> * p)
+ {
+ reset(p->element());
+
+ return * this;
+ }
+
+ template <typename V>
+ shifted_ptr_base & operator = (shifted_ptr_base<V> const & p)
+ {
+ if (p.po_ != po_)
+ {
+ reset(p.share());
+ }
+ return * this;
+ }
+
+ shifted_ptr_base & operator = (shifted_ptr_base<element_type> const & p)
+ {
+ return operator = <element_type>(p);
+ }
+
+ T & operator [] (std::size_t n)
+ {
+ return ** (po_ + n);
+ }
+
+ T const & operator [] (std::size_t n) const
+ {
+ return ** (po_ + n);
+ }
+
+ element_type * get() const
+ {
+ return po_;
+ }
+
+ element_type * share() const
+ {
+ if (po_)
+ {
+ header()->add_ref_copy();
+ }
+ return po_;
+ }
+
+ void reset(element_type * p = 0)
+ {
+ if (po_)
+ {
+ header()->release();
+ }
+ po_ = p;
+ }
+
+ ~shifted_ptr_base()
+ {
+ if (po_)
+ {
+ header()->release();
+ }
+ }
+
+
+ protected:
+ detail::sh::owned_base * header() const
+ {
+ return (owned<element_type> *) (typename owned<element_type>::roofof) static_cast<element_type *>(rootof<is_polymorphic<element_type>::value>::get(po_));
+ }
+ };
+#endif
+
+
+template <>
+ class shifted_ptr_base<void>
+ {
+ typedef void element_type;
+ template <typename> friend class shifted_ptr_base;
+
+ protected:
+ element_type * po_;
+
+ public:
+ shifted_ptr_base() : po_(0)
+ {
+ }
+
+ template <typename V>
+ shifted_ptr_base(detail::sh::owned<V> * p) : po_(p->element())
+ {
+ }
+
+ template <typename V>
+ shifted_ptr_base(shifted_ptr_base<V> const & p) : po_(p.share())
+ {
+ }
+
+ shifted_ptr_base(shifted_ptr_base<element_type> const & p) : po_(p.share())
+ {
+ }
+
+ template <typename V>
+ shifted_ptr_base & operator = (detail::sh::owned<V> * p)
+ {
+ reset(p->element());
+
+ return * this;
+ }
+
+ template <typename V>
+ shifted_ptr_base & operator = (shifted_ptr_base<V> const & p)
+ {
+ if (p.po_ != po_)
+ {
+ reset(p.share());
+ }
+ return * this;
+ }
+
+ shifted_ptr_base & operator = (shifted_ptr_base<element_type> const & p)
+ {
+ return operator = <element_type>(p);
+ }
+
+ element_type * get() const
+ {
+ return po_;
+ }
+
+ element_type * share() const
+ {
+ if (po_)
+ {
+ header()->add_ref_copy();
+ }
+ return po_;
+ }
+
+ void reset(element_type * p = 0)
+ {
+ if (po_)
+ {
+ header()->release();
+ }
+ po_ = p;
+ }
+
+ ~shifted_ptr_base()
+ {
+ if (po_)
+ {
+ header()->release();
+ }
+ }
+
+
+ protected:
+ detail::sh::owned_base * header() const
+ {
+ return (owned<element_type> *) (owned<element_type>::roofof) static_cast<element_type *>(rootof<is_polymorphic<element_type>::value>::get(po_));
+ }
+ };
+
+
+} // namespace sh
+
+} // namespace detail
+
+} // namespace boost
+
+
+#endif

Added: sandbox/shifted_ptr/boost/shifted_ptr.hpp
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/boost/shifted_ptr.hpp 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,311 @@
+/**
+ @file
+ Boost shifted_ptr.hpp header file.
+
+ @author
+ Copyright (c) 2008 Phil Bouchard <phil_at_[hidden]>.
+
+ @note
+ 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/smart_ptr/doc/index.html for documentation.
+
+
+ Thanks to: Steven Watanabe <watanabesj_at_[hidden]>
+*/
+
+
+#ifndef BOOST_DETAIL_SH_RTCMM_H_INCLUDED
+#define BOOST_DETAIL_SH_RTCMM_H_INCLUDED
+
+
+#if defined(_MSC_VER)
+#pragma warning( push )
+#pragma warning( disable : 4355 )
+
+#include <new.h>
+#endif
+
+#include <boost/type_traits/add_pointer.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#include <boost/detail/intrusive_list.hpp>
+#include <boost/detail/intrusive_stack.hpp>
+#include <boost/detail/sh_utility.h>
+#include <boost/detail/shifted_ptr_base.hpp>
+
+
+namespace boost
+{
+
+namespace detail
+{
+
+namespace sh
+{
+
+
+class owned_base;
+
+
+/**
+ Set header.
+*/
+
+class set
+{
+ long count_;
+ mutable set * redir_;
+
+ intrusive_list includes_;
+ intrusive_list elements_;
+
+public:
+ intrusive_list::node tag_;
+
+
+ set() : count_(1), redir_(this)
+ {
+ includes_.push_back(& tag_);
+ }
+
+ bool release()
+ {
+ set * p = redir();
+
+ if (-- p->count_ == 0)
+ {
+ for (intrusive_list::iterator<owned_base, & owned_base::set_tag_> i; i = p->elements_.begin(), i != p->elements_.end(); )
+ {
+ i->add_ref_copy();
+ delete &* i;
+ }
+
+ for (intrusive_list::iterator<set, & set::tag_> i = p->includes_.begin(), j; j = i, ++ j, i != p->includes_.end(); i = j)
+ if (&* i != this && &* i != p)
+ delete &* i;
+
+ if (p != this)
+ delete p;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ set * redir() const
+ {
+ if (redir_ == this) return redir_;
+ else return redir_ = redir_->redir();
+ }
+
+ void redir(set * p)
+ {
+ if (redir_ != p->redir())
+ {
+ redir_ = p->redir();
+ redir_->count_ += count_;
+ redir_->includes_.merge(includes_);
+ redir_->elements_.merge(elements_);
+ }
+ }
+
+ intrusive_list * elements() const
+ {
+ return & redir()->elements_;
+ }
+};
+
+
+
+
+/**
+ Deterministic memory manager of constant complexity.
+*/
+
+template <typename T, template <typename> class U = shifted_ptr_base>
+ class shifted_ptr : public U<T>
+ {
+ //template <typename, template <typename> class> friend class shifted_ptr;
+
+ using U<T>::share;
+
+
+ union
+ {
+ set * ps_;
+ intrusive_stack::node pn_;
+ };
+
+ public:
+ typedef T element_type;
+
+
+ shifted_ptr() : ps_(0)
+ {
+ if (! owned_base::contains(owned_base::heap, this))
+ ps_ = new set();
+ else
+ owned_base::last->top()->ptrs()->push(& pn_);
+ }
+
+ template <typename V>
+ shifted_ptr(owned<V> * p) : U<T>(p)
+ {
+ if (! owned_base::contains(owned_base::heap, this))
+ {
+ ps_ = new set();
+
+ init(p);
+ }
+ else
+ {
+ owned_base::last->top()->ptrs()->push(& pn_);
+ owned_base::last->top()->inits()->merge(* p->inits());
+ }
+ }
+
+ template <typename V>
+ shifted_ptr(shifted_ptr<V> const & p) : U<T>(p)
+ {
+ if (! owned_base::contains(owned_base::heap, this))
+ ps_ = new set();
+ else
+ owned_base::last->top()->ptrs()->push(& pn_);
+
+ ps_->redir(p.ps_);
+ }
+
+ shifted_ptr(shifted_ptr<T> const & p) : U<T>(p)
+ {
+ if (! owned_base::contains(owned_base::heap, this))
+ ps_ = new set();
+ else
+ owned_base::last->top()->ptrs()->push(& pn_);
+
+ ps_->redir(p.ps_);
+ }
+
+ template <typename V>
+ shifted_ptr & operator = (owned<V> * p)
+ {
+ release();
+ init(p);
+ U<T>::operator = (p);
+
+ return * this;
+ }
+
+ template <typename V>
+ shifted_ptr & operator = (shifted_ptr<V> const & p)
+ {
+ if (p.po_ != U<T>::po_)
+ {
+ if (ps_->redir() != p.ps_->redir())
+ {
+ release();
+ ps_->redir(p.ps_);
+ }
+ U<T>::operator = (p);
+ }
+ return * this;
+ }
+
+ shifted_ptr & operator = (shifted_ptr<T> const & p)
+ {
+ return operator = <T>(p);
+ }
+
+ void reset()
+ {
+ release();
+ }
+
+ ~shifted_ptr()
+ {
+ release(true);
+ }
+
+ private:
+ void release(bool d = false)
+ {
+ if (! owned_base::contains(owned_base::heap, this))
+ {
+ if (ps_->release())
+ {
+ U<T>::po_ = 0;
+
+ if (! d)
+ new (ps_) set();
+ else
+ delete ps_;
+ }
+ else
+ {
+ U<T>::reset();
+
+ if (! d)
+ ps_ = new set();
+ }
+ }
+ else if (! d)
+ U<T>::reset();
+ }
+
+ void init(owned_base * p)
+ {
+ for (intrusive_list::iterator<owned_base, & owned_base::init_tag_> i = p->inits()->begin(), j; j = i, ++ j, i != p->inits()->end(); i = j)
+ {
+ ps_->elements()->push_back(i->set_tag());
+
+ for (intrusive_stack::iterator<shifted_ptr, & shifted_ptr::pn_> m = i->ptrs()->begin(), n; n = m, ++ n, m != i->ptrs()->end(); m = n)
+ m->ps_ = ps_;
+ }
+ }
+ };
+
+
+#define TEMPLATE_DECL(z, n, text) , typename T ## n
+#define ARGUMENT_DECL(z, n, text) BOOST_PP_COMMA_IF(n) T ## n const & t ## n
+#define PARAMETER_DECL(z, n, text) BOOST_PP_COMMA_IF(n) t ## n
+
+#define MAKE_SHIFTED_PTR(z, n, text) \
+ template <typename T BOOST_PP_REPEAT(n, TEMPLATE_DECL, 0)> \
+ inline owned<T> * new_sh(BOOST_PP_REPEAT(n, ARGUMENT_DECL, 0)) \
+ { \
+ typedef typename add_pointer<T>::type pointer_type; \
+ typedef typename remove_const<typename remove_volatile<T>::type>::type unqualified_type; \
+ \
+ owned<T> * p = new owned<T>(); \
+ owned_base::last->push(p); \
+ pointer_type q = reinterpret_cast<pointer_type>(new (const_cast<unqualified_type *>(p->element())) T(BOOST_PP_REPEAT(n, PARAMETER_DECL, 0))); \
+ owned_base::last->pop(); \
+ \
+ return (owned<T> *) (typename owned<T>::roofof) q; \
+ }
+
+BOOST_PP_REPEAT(10, MAKE_SHIFTED_PTR, 0)
+
+
+} // namespace sh
+
+} // namespace detail
+
+using detail::sh::shifted_ptr;
+using detail::sh::new_sh;
+
+} // namespace boost
+
+
+#if defined(_MSC_VER)
+#pragma warning( pop )
+#endif
+
+
+#endif // #ifndef BOOST_DETAIL_SH_RTCMM_H_INCLUDED

Added: sandbox/shifted_ptr/libs/smart_ptr/example/shifted_ptr_test1.cpp
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/libs/smart_ptr/example/shifted_ptr_test1.cpp 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,64 @@
+/**
+ @file
+ shifted_ptr_test2.cpp
+
+ @note
+ Memory manager handling heap deallocations in constant time.
+*/
+
+#include <iostream>
+
+#include <boost/shifted_ptr.hpp>
+
+
+using namespace std;
+using namespace boost;
+
+
+struct A
+{
+ int i;
+ shifted_ptr<A> p;
+
+ A(int i = 0) : i(i)
+ {
+ std::cout << __FUNCTION__ << ": " << i << std::endl;
+ }
+
+ ~A()
+ {
+ std::cout << __FUNCTION__ << ": " << i << std::endl;
+ }
+};
+
+
+int main()
+{
+ shifted_ptr<A> p = new_sh<A>(7);
+ shifted_ptr<A> q = new_sh<A>(8);
+ shifted_ptr<A> r = new_sh<A>(9);
+
+ shifted_ptr<void> t = new_sh<A>(10);
+ shifted_ptr<int const volatile> v = new_sh<int const volatile>(11);
+
+ p->p = p;
+ q = r;
+ v = new_sh<int const volatile>(12);
+
+ cout << "p->i = " << p->i << endl;
+ cout << "q->i = " << q->i << endl;
+ cout << "r->i = " << r->i << endl;
+ cout << "* v = " << * v << endl;
+
+ // The following don't work with MSVC:
+#if ! defined(_MSC_VER)
+ shifted_ptr<A[5]> s = new_sh<A[5]>();
+ shifted_ptr<char[9]> u = new_sh<char[9]>();
+
+ u[4] = 'Z';
+
+ cout << "u[4] = " << u[4] << endl;
+#endif
+
+ cout << "Done." << endl;
+}

Added: sandbox/shifted_ptr/libs/smart_ptr/example/shifted_ptr_test2.cpp
==============================================================================
--- (empty file)
+++ sandbox/shifted_ptr/libs/smart_ptr/example/shifted_ptr_test2.cpp 2008-05-02 05:07:47 EDT (Fri, 02 May 2008)
@@ -0,0 +1,66 @@
+/**
+ @file
+ shifted_ptr_test2.cpp
+
+ @author
+ Steven Watanabe <watanabesj_at_[hidden]>
+*/
+
+#include <boost/shifted_ptr.hpp>
+
+#include <vector>
+#include <iostream>
+
+
+static int c;
+
+using boost::shifted_ptr;
+using boost::new_sh;
+
+struct node {
+ node() {
+ ++c;
+ }
+ ~node() {
+ --c;
+ }
+ shifted_ptr<node> prior;
+ shifted_ptr<node> next;
+};
+
+struct list {
+public:
+ list() {}
+ void clear() {
+ front.reset();
+ back.reset();
+ }
+ void insert() {
+ if(front.get() == 0) {
+ back = new_sh<node>();
+ } else {
+ back->next = new_sh<node>();
+ back->next->prior = back;
+ back = back->next;
+ }
+ }
+ ~list()
+ {
+ }
+private:
+ shifted_ptr<node> front;
+ shifted_ptr<node> back;
+};
+
+int main() {
+ {
+ list l;
+ for(int j = 0; j < 1; ++j) {
+ for(int i = 0; i < 1000; ++i) {
+ l.insert();
+ }
+ l.clear();
+ }
+ }
+ std::cout << c << std::endl;
+}


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