Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Member Function Pointers and the Fastest Possible C++ Delegates

, 5 Apr 2005
A comprehensive tutorial on member function pointers, and an implementation of delegates that generates only two ASM opcodes!
fastdelegate_hopter.zip
FastDelegateBind.hxx
FastDelegate.hxx
fastdelegate_src.zip
SOME HELPER TOOLS USED IN CREATING THE FASTDELEGATE LIBRARY

They are not very impressive, and are included only for completeness.

A. HOW TO CREATE FASTDELEGATE.H

1. Compile Hopter.cpp to form Hopter.exe
2. On the command line, type:
HOPTER FastDelegate.hxx FastDelegate.h

An explanation of what the program does is in Hopter.cpp.

B. TEST FILE USED TO DISCOVER MFP REPRESENTATION

If you have a compiler not listed in the article, compile
the 'memfuntest.cpp' file to an asm listing.
For example, with GCC you would type:

g++ -S memfuntest.cpp

Email the asm file to me.

Thanks for your interest!
-Don Clugston, 4 Nov 2004.


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Don Clugston
Engineer
Germany Germany
I'm an Australian physicist/software engineer living in Leipzig, Germany. I've published papers about windows (the glass kind), semiconductor device physics, environmental philosophy and theology, vacuum systems, and now (at CodeProject) the innards of C++. (Yes, my C.V. is a terrible mess.) I'm a major contributor to the D programming language. I can read New Testament Greek, and can speak German with a dreadful accent.
 
I have one wife, one son (pictured), and one daughter, who are all much cuter than I am.
 
"The light shines in the darkness, but the darkness has not overcome it."

| Advertise | Privacy | Mobile
Web03 | 2.8.140922.1 | Last Updated 6 Apr 2005
Article Copyright 2004 by Don Clugston
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid