C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Parameterization of Loki's Functor pointer

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
John Dill
Guest





PostPosted: Wed Apr 28, 2004 12:36 am    Post subject: Parameterization of Loki's Functor pointer Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.