assert() vs. enforce(), invariant() vs. ... ?

John Colvin john.loughran.colvin at gmail.com
Fri Aug 30 03:56:37 PDT 2013


On Friday, 30 August 2013 at 06:34:58 UTC, Jacob Carlborg wrote:
> On 2013-08-29 23:16, Joseph Rushton Wakeling wrote:
>
>> No, I mean std.typecons.Proxy:
>> http://dlang.org/phobos/std_typecons.html#.Proxy
>>
>> The point is that std.typecons.Proxy _just_ wraps the 
>> underlying type;
>> it doesn't, so far as I can see, allow you to define extra 
>> functionality
>> that must be implemented whenever a public method of the 
>> underlying type
>> is called.
>
> Oh, that Proxy. What's the point of it? The example looks like 
> just an "alias this".

alias this, but without implicit conversion. It just implements 
all the op**** functions (including opDispatch).


More information about the Digitalmars-d mailing list