Implementing typestate

Ola Fosheim Grostad via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 15 23:25:58 PDT 2015


On Wednesday, 16 September 2015 at 05:51:50 UTC, Tobias Müller 
wrote:
> Ola Fosheim Grøstad <ola.fosheim.grostad+dlang at gmail.com> wrote:
>> On Tuesday, 15 September 2015 at 20:34:43 UTC, Tobias Müller 
>> wrote:
>>>> There's a Blog post somewhere but I can't find it atm.
>>> 
>>> Ok found it: > 
>>> http://pcwalton.github.io/blog/2012/12/26/typestate-is-dead/
>> 
>> But that is for runtime detection, not compile time?
>
> Not as far as I understand it.
> The marker is a type, not a value. And it's used as template 
> param.
> But you need non-copyable move-only types for it to work.

Yes... But will it prevent you from doing two open() in a row at 
compiletime?



More information about the Digitalmars-d mailing list