policy base class using static member functions

A

Axter

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/wg21/docs/papers/2004/n1681.pdf
http://www.cuj.com/documents/s=8890/cujexp0310alexandr/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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top