On Wednesday, 3 April 2013 at 18:37:09 UTC, Jonathan M Davis
wrote:
... you could do something like
Verify!T verifyFoo(T param)
{
//do checks...
return Verify!T(param);
}
void foo(T param)
{
foo(verifyFoo(param));
}
void foo(Verified!T param)
{
...
}
That would be rather intrusive, but you _could_ do it if you
wanted to.
What problems do you see with this (or similar) approach? I find
it very straightforward and no overhead is really necessary.
Isn't it exactly what type system is for - enforcing static
guarantees in between different parts of application?