Am 01.02.15 um 08:58 schrieb Marko Rauhamaa: > Paul Rubin <no.email@nospam.invalid>: > >> Marko Rauhamaa <ma...@pacujo.net> writes: >>> Stroustrup apparently has never had to deal with callbacks; his thick >>> books never made a mention of them last time I checked. >> >> C++ has function pointers just like C, > > Et tu, Brute! > > C's callbacks always use a void pointer for the "self reference." In C, > I can use void pointers and type casts idiomatically. In C++, type casts > are apostasy. > > Qt gave up on C++ when it comes to callbacks ("signals") and went for an > apocryphal metacompiler.
Yes, but only because C++ compilers were not good enough when QT came out, and later is was too late to change it to a templated system. Lookup libsigc++ http://libsigc.sourceforge.net/ which does the same using standard C++ and http://qt-project.org/doc/qt-4.8/templates.html for a reasoning of QT. In C++11 (supported by MSVC, g++, clang) there re also lambda expressions Christian -- https://mail.python.org/mailman/listinfo/python-list