3 ms·
This reminds me of the Passkey idiom: https://arne-mertz.de/2016/10/passkey-idiom/ https://arne-mertz.de/2016/10/passkey-idiom/
by jhalstead 7y ago
This reminds me of the Passkey idiom: https://arne-mertz.de/2016/10/passkey-idiom/ https://arne-mertz.de/2016/10/passkey-idiom/
- b0sk 7y agoThis is pretty much the PassKey idiom
- akling 7y agoOh 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.