Re: Implicit conversion with ctor like C++

2015-09-08 Thread Pierre via Digitalmars-d-learn
OK that's very clear thank you for the answer.

Re: Implicit conversion with ctor like C++

2015-09-08 Thread Meta via Digitalmars-d-learn
; //Failed : MyFunction not callable... } I saw in forum this is OK because D doesn't do implicit conversion with ctor like C++ But how can I do ? May I use alias ? Thank you for your attention. No, as far as I know, D does not support implicit construction of classes or structs. There is

Re: Implicit conversion with ctor like C++

2015-09-08 Thread Pierre via Digitalmars-d-learn
I made a mistake it's more like: //Sample class class CClass { this(string MyValue){...} } //Called function void MyFunction(CClass MyClass){} void main() { MyFunction("Hello World!"); //Failed : MyFunction not callable... }

Implicit conversion with ctor like C++

2015-09-08 Thread Pierre via Digitalmars-d-learn
this is OK because D doesn't do implicit conversion with ctor like C++ But how can I do ? May I use alias ? Thank you for your attention.