Disappointing inflexibility of argument passing in D
Carl Sturtivant
sturtivant at gmail.com
Tue Feb 11 07:10:56 PST 2014
D has opAssign, making defining implicit conversions from any
type to a new type possible on assignment, so where is the
analogue (say opPass) for passing an argument to a function?
void f( Data d, Data2 d2) { ..... }
void main() {
//conversions from string part of the definitions of Data,
Data2
f( "hello", "bonjour"); //no way to do this --- disappointing
}
See
http://forum.dlang.org/thread/agstjpezerwlgdhphclk@forum.dlang.org
More information about the Digitalmars-d
mailing list