Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54416 - in sandbox/monotonic: boost/object_model boost/object_model/type libs/monotonic/test libs/monotonic/test/clones libs/object_model/test
From: christian.schladetsch_at_[hidden]
Date: 2009-06-27 18:43:36


Author: cschladetsch
Date: 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
New Revision: 54416
URL: http://svn.boost.org/trac/boost/changeset/54416

Log:
added clones Tests
Added:
   sandbox/monotonic/libs/monotonic/test/clones/ (props changed)
   sandbox/monotonic/libs/monotonic/test/clones/clones.vcproj (contents, props changed)
   sandbox/monotonic/libs/monotonic/test/clones/main.cpp (contents, props changed)
Text files modified:
   sandbox/monotonic/boost/object_model/forward_declarations.hpp | 20 +++--
   sandbox/monotonic/boost/object_model/object.hpp | 75 ++++++++++++++++++++
   sandbox/monotonic/boost/object_model/registry.hpp | 2
   sandbox/monotonic/boost/object_model/type/builtins.hpp | 3
   sandbox/monotonic/boost/object_model/type/number.hpp | 2
   sandbox/monotonic/boost/object_model/type/traits.hpp | 11 ++
   sandbox/monotonic/libs/monotonic/test/monotonic.sln | 8 ++
   sandbox/monotonic/libs/object_model/test/basic_tests.cpp | 138 +++++++++++++++++++++++++++++++++++++--
   8 files changed, 237 insertions(+), 22 deletions(-)

Modified: sandbox/monotonic/boost/object_model/forward_declarations.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/forward_declarations.hpp (original)
+++ sandbox/monotonic/boost/object_model/forward_declarations.hpp 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -22,6 +22,8 @@
 
         /// a type number
         struct number;
+
+ struct any;
 }
 
 /// a unique identifier of an object
@@ -74,31 +76,31 @@
         struct registry;
 }
 
-template <class T>
+template <class T = type::any>
 struct const_object;
 
-template <class T>
+template <class T = type::any>
 struct const_reference;
 
-template <class T>
+template <class T = type::any>
 struct const_pointer;
 
-template <class T>
+template <class T = type::any>
 struct mutable_object;
 
-template <class T>
+template <class T = type::any>
 struct mutable_reference;
 
-template <class T>
+template <class T = type::any>
 struct mutable_pointer;
 
-template <class T>
+template <class T = type::any>
 struct object;
 
-template <class T>
+template <class T = type::any>
 struct pointer;
 
-template <class T>
+template <class T = type::any>
 struct reference;
 
 /// storage for a specific type

Modified: sandbox/monotonic/boost/object_model/object.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/object.hpp (original)
+++ sandbox/monotonic/boost/object_model/object.hpp 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -16,10 +16,51 @@
 BOOST_OM_BEGIN
 
 /// an object with a specific type
-template <class T>
-struct object : generic::object
+template <>
+struct object<type::any> : generic::object
+{
+ object()
+ {
+ }
+
+ template <class Other>
+ object(object<Other> const &other) : generic::object(other)
+ {
+ }
+ object(const generic::object &obj) : generic::object(obj)
+ {
+ }
+ object& operator=(object const &other)
+ {
+ generic::object::operator=(other);
+ return *this;
+ }
+};
+
+/// work in progress... would like (not need) some way to allow free-standing
+/// object<T>'s to be able to dereference themselves without having the owning registry
+struct impl
+{
+ struct abstract_object
+ {
+ // go through the registry to get to the storage base
+ virtual generic::object_base &deref() = 0;
+ };
+
+
+ template <class Derived, class T, class Reg>
+ struct object_base
+ {
+
+ };
+};
+
+template <class T>//, class Reg = type::none>
+struct object : generic::object// : impl::object_base<object<T,Reg>, T, Reg>
 {
         typedef type::traits<T> traits;
+ //scoped_ptr<impl::abstract_object<Reg> > ptr;
+ //impl::abstract_object<Reg> *ptr;
 
         typedef typename traits::reference_type (*deref_fun)(generic::object &);
         typedef typename traits::const_reference_type (*const_deref_fun)(const generic::object &);
@@ -31,8 +72,29 @@
 public:
         object() : deref(0), const_deref(0) {}
 
- object(const generic::object &obj, deref_fun d, const_deref_fun c) : generic::object(obj), deref(d), const_deref(c)
+ object(const object<type::any> &obj)
+ {
+ *this = obj;
+ }
+
+ object(const generic::object &obj, deref_fun d, const_deref_fun c)
+ : deref(d), const_deref(c)
+ {
+ *this = obj;
+ }
+
+ object& operator=(object const &other)
+ {
+ generic::object::operator=(other);
+ return *this;
+ }
+
+ object& operator=(object<type::any> const &other)
         {
+ if (!other.is_type<T>())
+ throw type_mismatch();
+ generic::object::operator=(other);
+ return *this;
         }
 
         typename traits::reference_type get_reference()
@@ -46,11 +108,18 @@
         {
                 return get_reference();
         }
+
         typename traits::pointer_type operator->()
         {
                 return &get_reference();
         }
 
+ template <class Label>
+ void set(const Label &label, generic::object obj)
+ {
+ //impl->setter(*this, label, obj);
+ }
+
 };
 
 BOOST_OM_END

Modified: sandbox/monotonic/boost/object_model/registry.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/registry.hpp (original)
+++ sandbox/monotonic/boost/object_model/registry.hpp 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -231,7 +231,9 @@
         void add_builtins()
         {
                 register_class<void>();
+ register_class<bool>();
                 register_class<int>();
+ register_class<float>();
                 register_class<vector_type>();
         }
         void clear()

Modified: sandbox/monotonic/boost/object_model/type/builtins.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/type/builtins.hpp (original)
+++ sandbox/monotonic/boost/object_model/type/builtins.hpp 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -20,7 +20,10 @@
 
 BOOST_OBJECT_MODEL_TRAITS_NUM_STORE(void, boost::object_model::type::number::Void, void_storage);
 BOOST_OBJECT_MODEL_TRAITS_NUM(int, boost::object_model::type::number::Int);
+BOOST_OBJECT_MODEL_TRAITS_NUM(bool, boost::object_model::type::number::Bool);
 BOOST_OBJECT_MODEL_TRAITS_NUM(float, boost::object_model::type::number::Float);
+BOOST_OBJECT_MODEL_TRAITS_NUM(type::any, boost::object_model::type::number::Any);
+BOOST_OBJECT_MODEL_TRAITS_NUM(type::none, boost::object_model::type::number::None);
 
 #include <boost/object_model/detail/postfix.hpp>
 

Modified: sandbox/monotonic/boost/object_model/type/number.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/type/number.hpp (original)
+++ sandbox/monotonic/boost/object_model/type/number.hpp 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -20,6 +20,7 @@
                 enum builtins
                 {
                         None,
+ Any,
                         Void,
                         
                         Object,
@@ -28,6 +29,7 @@
                         Property,
                         Class,
 
+ Bool,
                         Int,
                         Float,
                         String,

Modified: sandbox/monotonic/boost/object_model/type/traits.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/type/traits.hpp (original)
+++ sandbox/monotonic/boost/object_model/type/traits.hpp 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -27,8 +27,17 @@
                 typedef Storage const &const_reference_type;
         };
 
+ struct any { };
+ struct none { };
 }
 
+#ifdef BOOST_OBJECT_MODEL_MAIN
+# define BOOST_OBJECT_MODEL_DEFINE_NAME(T, NAME) \
+ const char * traits<T>::name = NAME;
+#else
+# define BOOST_OBJECT_MODEL_DEFINE_NAME(T, NAME)
+#endif
+
 #define BOOST_OBJECT_MODEL_TRAITS_NUM_STORE_NAME(T,N,S,NAME) \
         BOOST_OM_BEGIN \
         namespace type \
@@ -39,7 +48,7 @@
                         BOOST_STATIC_CONSTANT(number::value_type, type_number = N); \
                         static const char *name; \
                 }; \
- const char * traits<T>::name = NAME; \
+ BOOST_OBJECT_MODEL_DEFINE_NAME(T,NAME); \
         } \
         BOOST_OM_END
 

Added: sandbox/monotonic/libs/monotonic/test/clones/clones.vcproj
==============================================================================
--- (empty file)
+++ sandbox/monotonic/libs/monotonic/test/clones/clones.vcproj 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="clones"
+ ProjectGUID="{36FA062B-37D3-49FF-A470-DDEDEBB7DE01}"
+ RootNamespace="clones"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="$(ProjectDir)/../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ 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="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ 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="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\main.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/monotonic/libs/monotonic/test/clones/main.cpp
==============================================================================
--- (empty file)
+++ sandbox/monotonic/libs/monotonic/test/clones/main.cpp 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,80 @@
+
+#include <iostream>
+#include <vector>
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/monotonic/allocator.hpp>
+
+using namespace std;
+using namespace boost;
+
+struct type_number
+{
+ int value;
+ enum
+ {
+ None = 0,
+ Base = 1,
+ Derived = 2,
+ };
+ type_number(int n = None) : value(n) { }
+};
+
+struct base
+{
+ type_number type;
+
+ explicit base(type_number t) : type(t) { }
+ virtual ~base() { }
+
+ virtual base *clone() const = 0;
+};
+
+struct derived : base
+{
+ int num;
+ explicit derived(int n) : base(type_number::Derived), num(n) { }
+
+ base *clone() const
+ {
+ return new derived(num);
+ }
+};
+
+struct clone_allocator
+{
+ template< class U >
+ static U* allocate_clone( const U& r )
+ {
+ return r.clone();
+ }
+
+ template< class U >
+ static void deallocate_clone( const U* clone )
+ {
+ if (clone)
+ clone->U::~U();
+ }
+};
+
+int main()
+{
+ typedef ptr_vector<base, clone_allocator, monotonic::allocator<int> > vec;
+ // why ptr_vector<..> p(n) resize the vector to have n default-constructed elements?
+ // it only reserves n elements at the moment...
+ //vec bases(1);
+ //bases[0] = derived(42); // throws out of range error
+
+ //vec bases;
+ //bases.resize(1); // doesnt work because it cannot instantiate an abstract class
+ //bases[0] = derived(42);
+
+ vec bases;
+ bases.push_back(new derived(42));
+
+ vec copy = bases;
+ BOOST_ASSERT(copy.size() == 1);
+ BOOST_ASSERT(copy.at(0).type.value == type_number::Derived);
+ return 0;
+}
+
+//EOF

Modified: sandbox/monotonic/libs/monotonic/test/monotonic.sln
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/monotonic.sln (original)
+++ sandbox/monotonic/libs/monotonic/test/monotonic.sln 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -7,6 +7,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "object_model", "..\..\object_model\src\object_model.vcproj", "{E557E90C-C695-4A7B-B5A6-2F133AF88563}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clones", "clones\clones.vcproj", "{36FA062B-37D3-49FF-A470-DDEDEBB7DE01}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -31,6 +33,12 @@
                 {E557E90C-C695-4A7B-B5A6-2F133AF88563}.Release|Win32.Build.0 = Release|Win32
                 {E557E90C-C695-4A7B-B5A6-2F133AF88563}.ReleaseSym|Win32.ActiveCfg = ReleaseSym|Win32
                 {E557E90C-C695-4A7B-B5A6-2F133AF88563}.ReleaseSym|Win32.Build.0 = ReleaseSym|Win32
+ {36FA062B-37D3-49FF-A470-DDEDEBB7DE01}.Debug|Win32.ActiveCfg = Debug|Win32
+ {36FA062B-37D3-49FF-A470-DDEDEBB7DE01}.Debug|Win32.Build.0 = Debug|Win32
+ {36FA062B-37D3-49FF-A470-DDEDEBB7DE01}.Release|Win32.ActiveCfg = Release|Win32
+ {36FA062B-37D3-49FF-A470-DDEDEBB7DE01}.Release|Win32.Build.0 = Release|Win32
+ {36FA062B-37D3-49FF-A470-DDEDEBB7DE01}.ReleaseSym|Win32.ActiveCfg = Release|Win32
+ {36FA062B-37D3-49FF-A470-DDEDEBB7DE01}.ReleaseSym|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Modified: sandbox/monotonic/libs/object_model/test/basic_tests.cpp
==============================================================================
--- sandbox/monotonic/libs/object_model/test/basic_tests.cpp (original)
+++ sandbox/monotonic/libs/object_model/test/basic_tests.cpp 2009-06-27 18:43:34 EDT (Sat, 27 Jun 2009)
@@ -12,6 +12,8 @@
 #define BOOST_TEST_MODULE basic_test test
 #include <boost/test/unit_test.hpp>
 
+#define BOOST_OBJECT_MODEL_MAIN
+
 #include <string>
 #include <boost/object_model/object.hpp>
 #include <boost/object_model/dictionary.hpp>
@@ -24,12 +26,40 @@
 #include <boost/object_model/string.hpp>
 #include <boost/object_model/registry.hpp>
 
-#include <boost/monotonic/allocator.hpp>
-
 using namespace std;
 using namespace boost;
 namespace om = boost::object_model;
 
+BOOST_AUTO_TEST_CASE(test_any)
+{
+ om::registry<> reg;
+ reg.add_builtins();
+ om::object<> obj = reg.create<int>(42);
+ BOOST_ASSERT(obj.is_type<int>());
+ BOOST_ASSERT(reg.deref<int>(obj) == 42);
+
+ //obj.set("foo", om::null_object);
+}
+
+BOOST_AUTO_TEST_CASE(test_type_mismatch)
+{
+ om::registry<> reg;
+ reg.add_builtins();
+ bool caught = false;
+ try
+ {
+ om::object<> obj = reg.create<float>(42);
+ om::object<int> num = obj;
+ }
+ catch (om::type_mismatch)
+ {
+ caught = true;
+ }
+ BOOST_ASSERT(caught);
+}
+
+#include <boost/monotonic/allocator.hpp>
+
 struct mono_reg : om::system_traits<monotonic::allocator<char> > { };
 
 BOOST_AUTO_TEST_CASE(test_monotonic)
@@ -62,8 +92,7 @@
         reg.register_class<void>();
         reg.register_class<int>();
 
- om::string<> text;//
- //text = om::type::make_specifier<int>().to_string(reg);
+// om::string<> text = om::type::make_specifier<int>().to_string(reg);
 }
 
 BOOST_AUTO_TEST_CASE(test_values)
@@ -179,24 +208,115 @@
         om::object<Foo> foo = reg.create<Foo>();
         BOOST_ASSERT(foo.exists());
         BOOST_ASSERT(foo.is_type<Foo>());
-
         BOOST_ASSERT(reg.has_method(foo, "grok"));
+ BOOST_ASSERT(reg.has_method(foo, "spam"));
 
+ // invoke foo::grok using a stack
         om::object<vector> stack = reg.create<vector>();
         reg.get_method(foo, "grok").invoke(foo, *stack);
         BOOST_ASSERT(stack->size() == 1);
         BOOST_ASSERT(stack->at(0).is_type<int>());
         BOOST_ASSERT(reg.deref<int>(stack->at(0)) == 42);
 
+ // invoke foo::spam using the same stack
         reg.get_method(foo, "spam").invoke(foo, *stack);
         BOOST_ASSERT(stack->size() == 1);
         BOOST_ASSERT(stack->at(0).is_type<int>());
         BOOST_ASSERT(reg.deref<int>(stack->at(0)) == 42*2);
+}
+
+#include <boost/spirit/core.hpp>
+#include <boost/spirit/actor.hpp>
+
+BOOST_AUTO_TEST_CASE(test_basic_parser)
+{
+ return;
+
+ using namespace boost::spirit;
+ chlit<> plus('+');
+ chlit<> minus('-');
+ chlit<> times('*');
+ chlit<> divide('/');
+ chlit<> oppar('(');
+ chlit<> clpar(')');
+ chlit<> opbrace('{');
+ chlit<> clbrace('}');
+
+ rule<> constant;
+ rule<> ident;
+ rule<> op;
+ rule<> sequence;
+ rule<> continuation;
+
+ constant = int_p;
+ op = plus || minus || times || divide;
+ ident = +range_p('a','z');
+ sequence = *(constant || op || ident);
+ continuation = opbrace >> sequence >> clbrace;
+
+ bool p0 = parse("1", constant, space_p).full;
+ bool p7 = parse("1 2", constant >> constant, space_p).full;
+ bool p4 = parse("+", op, space_p).full;
+ bool p5 = parse("+ +", op >> op, space_p).full;
+ bool p6 = parse("+ +", *op, space_p).full;
+ bool p2 = parse("1 2 +", *constant >> op, space_p).full;
+ bool p1 = parse("1 2", *constant, space_p).full;
+ bool p3 = parse("a b + 1 2 *", sequence, space_p).full;
+
+ BOOST_ASSERT(p0);
+ BOOST_ASSERT(p1);
+ BOOST_ASSERT(p2);
+ BOOST_ASSERT(p3);
 
- //BOOST_ASSERT(foo.get_class().has_method("bar"));
- //BOOST_ASSERT(foo.get_class().has_method("spam"));
- //BOOST_ASSERT(foo.get_class().has_field("num"));
- //BOOST_ASSERT(foo.get_class().has_field("str"));
 }
 
+struct nil { };
+
+template <class Tr>
+struct reg;
+
+template <class T, class Reg = nil>
+struct obj
+{
+ //typedef
+ obj()
+ {
+
+ }
+
+ template <class Reg2>
+ obj(obj<T, Reg2> const &q)
+ {
+ //getter = q.getter;
+ }
+
+ T &get()
+ {
+ throw;
+ }
+};
+
+template <class Tr>
+struct reg
+{
+ template <class T>
+ T &get(int number)
+ {
+ static int n = 42;
+ return n;
+ }
+};
+
+struct traits
+{
+
+};
+
+BOOST_AUTO_TEST_CASE(test_abstract)
+{
+ obj<int> n = obj<int, reg<traits> >();
+// *n = 42;
+}
+
+
 //EOF


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