Monthly Read Posts in Sep 2018
Programming Language
Strong types for strong interfaces
How to add a type wrapper for built-in types.
Besides using phantom template parameter to avoid alias, one can also use private inheritance:
1 | class NamedType |
Passing strong types by reference – First attempt
This post is the sequal of the above post.
The main problem the post tryies to solve is: how to make copy of NamedType
values cheap.
However, I am conservative on using reference-wrapper as the solution, because doing this has to expose the lifetime of the wrapped object to public; after all, reference-wrapper is only a point per se.