January 12, 2007 Function overloading with non-D linkage? | ||||
---|---|---|---|---|
| ||||
Shouldn't be impossible to overload functions defined with non-D linkage? (From http://www.digitalmars.com/d/function.html#overloading: «Functions defined with non-D linkage cannot be overloaded.») For example: /******************************************************************************/ extern (C) int print(char c) { return printf("%c", c); } extern (C) int print(char* s) { return printf("%s", s); } void main() { print(cast(char*) "test\n\0"); } /******************************************************************************/ The compiler accepts that ("dmd -c test.d") even though there will be errors when linking. |
Copyright © 1999-2021 by the D Language Foundation