Developing a plan for D2.0: Getting everything on the table

Michel Fortin michel.fortin at michelf.com
Thu Jul 16 04:03:39 PDT 2009


On 2009-07-14 16:46:12 -0400, "Lars T. Kyllingstad" 
<public at kyllingen.NOSPAMnet> said:

> I don't think it should be this simple. If I do this:
> 
>    class Vector
>    {
>        this (size_t length) { ... }
>    }
> 
> I don't want to be able to write this:
> 
>    Vector v = 3;

I agree. Constructors which can be used for implicit casting should be 
explicitly identified. Perhaps this way?

	class A
	{
		alias this(uint i) { ... }
	}


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list