From 867dae89929a11a421ec21af71d494ad0ecc1963 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 14 Oct 2010 23:26:25 +0000 Subject: SharedCore has more features now, which is cool, including a test to see if another object of the parent type has the same core, and another to clone the parent object. That one is pretty cool, it means you can now get a real copy when you want to, great for multi-threaded stuff. Also, two more classes are now SharedCore: Hash and Heap! --- src/list.h | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src/list.h') diff --git a/src/list.h b/src/list.h index 9b95983..ba1d2c4 100644 --- a/src/list.h +++ b/src/list.h @@ -24,10 +24,18 @@ namespace Bu ListLink *pPrev; }; - template + template + class List; + + template struct ListCore { + friend class List; + friend class SharedCore< + List, + ListCore + >; + private: typedef struct ListLink Link; ListCore() : pFirst( NULL ), @@ -193,8 +201,10 @@ namespace Bu */ template, typename linkalloc=std::allocator > > - class List : public SharedCore< struct ListCore > + class List : public SharedCore< + List, + ListCore + > { private: typedef struct ListLink Link; @@ -202,9 +212,9 @@ namespace Bu typedef struct ListCore Core; protected: - using SharedCore< Core >::core; - using SharedCore< Core >::_hardCopy; - using SharedCore< Core >::_allocateCore; + using SharedCore::core; + using SharedCore::_hardCopy; + using SharedCore::_allocateCore; public: struct const_iterator; @@ -215,7 +225,7 @@ namespace Bu } List( const MyType &src ) : - SharedCore< Core >( src ) + SharedCore( src ) { } -- cgit v1.2.3