Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Be grateful for Perl OO

by tall_man (Parson)
on Jan 28, 2003 at 18:09 UTC ( [id://230672]=note: print w/replies, xml ) Need Help??


in reply to Re: Be grateful for Perl OO
in thread Be grateful for Perl OO

Yes, functors created using templates would help a lot. See Modern C++ Design for some amazing things you can do with C++ templates.

Update: The basic idea is using a templated function like this:

template <class Type> double doCall(Type *instance, double (Type::*pmf)()) { return (instance->*pmf)(); }
Update 1/19/03: Transposed the return type to the proper place in the declaration. Thanks to John M. Dlugosz.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://230672]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-25 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found