News for hackers. Stuff that matters.
Re:C++ Patterns: The Badge by akling on Wednesday June 12, 2019 @02:24AM (#20162218)
Oh wow, that's so similar! So similar in fact, that I must have seen this blog post at some point and internalized the idea :)

The improvement that Badge<T> makes is the <T> part; you don't need to look up the PassKey declaration to see who can construct PassKeys, it's encoded right there in the type instead.

I do like how PassKey makes the copy ctor private. I think we can improve on that and delete both the copy and move ctors in Badge.

There are no comments on this comment yet.