Re: templates and storing pointers to member functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Haupt <mhaupt@xxxxxxxxx> writes:

> what I would like to do is create a map<s, f> mapping some symbol type
> to functions (the latter are member functions of classes).

This is not actually a question about gcc.  It is a question about C++.
I recommend trying a C++ language group.

As far as I know what you are trying to do is impossible in C++.  It's
fundamentally a type-unsafe operation, since once an object is in the
map there is no way to know the type of function pointer.  So you can
only do it via a cast to void* or something similar.  But C++ is a
complicated language and I'm prepared to be surprised.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux