On Wed, 29 May 2013 08:43:44 -0400, Jakob Ovrum <jakobov...@gmail.com>
wrote:
On Wednesday, 29 May 2013 at 12:40:39 UTC, Dicebot wrote:
Why something like this is not usable?
-----------------------
int tmp;
try
{
tmp = ...;
}
catch(..)
{
}
const(int) i = tmp;
-----------------------
Not really pretty but nothing crazy.
const(int) i = tmp; // fails when the type has mutable indirection.
Everything mutable and immutable (and const, or inout) is implicitly
convertible to const. The above should work for any type of tmp.
Can you cite specific code that is failing?
-Steve