DMD 1.025 and 2.009 releases
"Jérôme M. Berger"
jeberger at free.fr
Tue Jan 1 13:11:18 PST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jarrett Billingsley wrote:
> "Walter Bright" <newshound1 at digitalmars.com> wrote in message
> news:fle8mi$1j24$2 at digitalmars.com...
>> ???? (noshiika) wrote:
>>
>> Replace:
>>
>>> const(C) c;
>>> c = new C(1); // error
>> with:
>>
>> const(C) c = new C(1);
>
> Solve:
>
> const(C) c;
>
> if(someCondition)
> c = new C(1);
> else
> c = new C(2);
>
Untested:
const(C) c = (delegate const(C) () {
if (someCondition)
return new C(1);
else
return new C(2);
})();
Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
| mailto:jeberger at free.fr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeberger at jabber.fr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFHeqxwd0kWM4JG3k8RAmbAAKCogrgIIj0/6oNi4WfoM5PkLcPawgCgjvR6
5kpZYty6ulyuKkbKSUXTeto=
=TqPW
-----END PGP SIGNATURE-----
More information about the Digitalmars-d-announce
mailing list