473,396 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

policy base class using static member functions

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?

Jan 19 '06 #1
0 1281

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Luca | last post by:
Hi, I have a quite complex question to ask you: I have defined a base class where I would like to have a map holding pointers to member functions defined in derived classes. To be more precise...
11
by: Roger Leigh | last post by:
The C++ book I have to hand (Liberty and Horvath, Teach yourself C++ for Linux in 21 Days--I know there are better) states that "static member functions cannot access any non-static member...
9
by: Martin Vorbrodt | last post by:
I'm designing a Matrix class of 4x4 matrices used in computer graphics. Both OpenGL and Direct3D can take a pointer to array of 16 floats which represent the values in the matrix. OGL takes it in...
0
by: Axter | last post by:
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:...
14
by: Dave Booker | last post by:
It looks like the language is trying to prevent me from doing this sort of thing. Nevertheless, the following compiles, and I'd like to know why it doesn't work the way it should: public class...
4
by: aaragon | last post by:
Hello everyone. I'm reading Andrei's Alexandrescu's book on Modern C++ Design and I decided to implemente in my research code the use of policy classes. My objective is to abstract the storage of...
6
by: noel.hunt | last post by:
I have a base class, PadRcv, with virtual functions. User code will derive from this class and possibly supply it's own functions to override the base class virtual functions. How can I test that...
2
by: Rahul | last post by:
Hi Everyone, I read in an article that over loading a base class function (ordinary, non-static non-virtual member function) hides the base class versions in the derived class. However, as in...
12
by: bgold | last post by:
Hey. I have a base class (SPRITE), and using this base class I have derived a large number of derived classes (PERSON, BULLET, MISSILE, etc.). Now, at a certain point in my program, I have a pair...
6
by: Bhawna | last post by:
I am into c++ code maintenance for last 3-4 years but recently I am put into design phase of a new project. Being a small comapany I dont have enough guidance from seniors. Currently I am into a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.