what about { "_ZN8VConsole8VConsolelsEPKc", (uint_32)(VConsole::VConsole (VConsole::VConsole::*)(const char *))(&VConsole::VConsole::operator <<) } * mgenov (n=mgenov@212.25.39.48) has joined ##c++ loufoque: Modules.cpp:88: error: expected primary-expression before ')' token and several more errors * Ifsc-usp has quit (Client Quit) * Gambit-- (n=god@unaffiliated/gambit-) has joined ##c++ oh, wait. bad copying Modules.cpp:88: error: address of overloaded function with no contextual type information * zap0 has quit ("bye") * W_o_r[l]d (n=Psico@151.73.100.104) has joined ##c++ mmiikkee12: so it doesn't work with just casting * aalhamad_ has quit ("Leaving") loufoque: apparently not mmiikkee12: that's why you must use an intermediate variable like I showed you above (I named it 'p') Works for me. * Jason__ has quit ("Leaving") * Davidbrcz1 (n=davidcom@ANantes-151-1-123-213.w86-203.abo.wanadoo.fr) has joined ##c++ loufoque: can you do that outside of a function? Oh you mean casting twice in a row? geordi: namespace VConsole { struct VConsole { VConsole& operator<<(const char *str) {} }; } int main() { long a = (long)(VConsole::VConsole (VConsole::VConsole::*)(const char *))(&VConsole::VConsole::operator<<); } no return statement in function returning non-void geordi: namespace VConsole { struct VConsole { VConsole& operator<<(const char *str) { return *this; } }; } int main() { long a = (long)(VConsole::VConsole (VConsole::VConsole::*)(const char *))(&VConsole::VConsole::operator<<); } invalid cast from type 'VConsole::VConsole (VConsole::VConsole::*)(const char*)' to type 'long int' geordi: namespace VConsole { struct VConsole { VConsole& operator<<(const char *str) { return *this; } }; } int main() { long a = (long)(VConsole::VConsole (VConsole::VConsole*)(const char *))(&VConsole::VConsole::operator<<); } 'type name' declared as function returning a function geordi: namespace VConsole { struct VConsole { VConsole& operator<<(const char *str) { return *this; } }; } int main() { long a = reinterpret_cast((VConsole::VConsole (VConsole::VConsole::*)(const char *))(&VConsole::VConsole::operator<<)); } invalid cast from type 'VConsole::VConsole (VConsole::VConsole::*)(const char*)' to type 'long int' so it doesn't want to convert a pointer to member to a long int * SnakeChompEx has quit (Read error: 110 (Connection timed out)) * Davidbrcz1 (n=davidcom@ANantes-151-1-123-213.w86-203.abo.wanadoo.fr) has left ##c++ * eroc (n=core@189.130.169.80) has joined ##c++ geordi: namespace VConsole { struct VConsole { VConsole& operator<<(const char *str) { return *this; } }; } int main() { long a = reinterpret_cast(static_cast(&VConsole::VConsole::operator<<)); } invalid cast from type 'VConsole::VConsole& (VConsole::VConsole::*)(const char*)' to type 'long int' * SnakeChompXP has quit (Success) geordi: namespace VConsole { struct VConsole { VConsole& operator<<(const char *str) { return *this; } }; } int main() { long a = reinterpret_cast((VConsole::VConsole (*)(const char *))(&VConsole::VConsole::operator<<)); } converting from 'VConsole::VConsole& (VConsole::VConsole::*)(const char*)' to 'VConsole::VConsole (*)(const char*)' geordi: namespace VConsole { struct VConsole { VConsole& operator<<(const char *str) { return *this; } }; } int main() { long a = reinterpret_cast((VConsole::VConsole& (*)(const char *))(&VConsole::VConsole::operator<<)); }