 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
John Dill Guest
|
Posted: Wed Apr 28, 2004 12:36 am Post subject: Parameterization of Loki's Functor pointer |
|
|
I have been wondering about the parameterization of Loki's Functor
pointer and find that it is perhaps more restrained than it could be.
One problem with Loki's Functor is that is has no error handling of
null pointers. So if you use a Functor which has not been
initialized, you have problems. But SmartPtr includes a policy
template for handling this very issue. Why not add another
parameterization of Functor with a checking policy and use a SmartPtr
with a DestructiveCopy to parameterize the pointer. Then you can
parameterize the error handling of empty functors in exactly the same
way as SmartPtr. Is this a good idea?
It also seems that people desire different behavior for null pointer
functors. One wants to interpret it as an error, and another a no-op.
Any ideas on how this can be parameterized into Functor? Should this
difference in behavior be designed as a separate class, a policy, a
flag, ...?
Thanks,
John
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|