Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > policy base class using static member functions

Reply
Thread Tools

policy base class using static member functions

 
 
Axter
Guest
Posts: n/a
 
      01-19-2006
I'm currently working on the following policy base smart pointer:
http://code.axter.com/smart_ptr.h

Before working on the above code, I read the following links:
http://www.open-std.org/jtc1/sc22/wg...2004/n1681.pdf
http://www.cuj.com/documents/s=8890/...r/alexandr.htm

I notice the above links only talk about using policy base logic via
direct inheritance and multiple inheritance.

In the smart_ptr class I used a static member function interface to
pull in the policy logic.
This allows me to declare a smart pointer like this:
smart_ptr<Shape, deep_copy_policy, clone_function_allocator_policy>
pShape;
Instead of like this:

smart_ptr<Shape, deep_copy_policy<Shape> ,
clone_function_allocator_policy<Shape> > pShape;

or worse:

smart_ptr<Shape, deep_copy_policy<Shape,
clone_function_allocator_policy<Shape> > > pShape;

Can any one see anything wrong with using the static member function
method, or any pros to using inheritance method that I would loose by
using static member function method?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
overloading non-template member functions with template member functions Hicham Mouline C++ 1 04-24-2009 07:47 AM
overloading non-template member functions with template member functions Hicham Mouline C++ 0 04-23-2009 11:42 AM
policy base class using static member functions Axter C++ 0 01-19-2006 09:10 PM
Can Derived class static member access protected member from base class? Siemel Naran C++ 4 01-12-2005 06:46 PM
Static member functions in Abstract Base Class yan C++ 1 02-11-2004 03:42 PM



Advertisments