Ist es möglich mit dem gcc einen inline Konstruktor zu forcen?
Von Natur aus macht der das nicht.
Idee ist folgende:
Und hier noch der aufruf dazu:
Ausgabe des compilers:
Jemand eine Idee oder vielleicht schon eine funktionierende Variante?
Mitschicken der informationen(file,line) wäre eine variante, aber mit der geb ich mich mal noch nicht zu frieden...
Von Natur aus macht der das nicht.
Idee ist folgende:
Code:
inline Exception::Exception(int code, char *message) throw() {
this->code = code;
this->message = message;
this->line = __LINE__;
this->filename = __FILE__;
}
Und hier noch der aufruf dazu:
Code:
void test() {
throw Exception(1 , "Testmessage");
}
Code:
.... /Debug/../src/inline.cpp:13: undefined reference to `Exception::Exception(int, char*)'
Jemand eine Idee oder vielleicht schon eine funktionierende Variante?
Mitschicken der informationen(file,line) wäre eine variante, aber mit der geb ich mich mal noch nicht zu frieden...