Re:The C++ Type Loophole (C++14)
by chombier on Thursday July 29, 2021 @03:52AM
(#27993985)
I believe this trick (auto constexpr definition using friend injection) was first described in this post https://b.atch.se/posts/non-constant-constant-expressions/
[ Parent
| on HN ]
you are correct. (DISCLAIMER: I am the author of what you are referring to)
Hey :) I remember thinking at the time this could be used to implement typestate in c++ in order to get a rust-like ownership system.
Do you (or anyone else) know if this has been done so far?
Sadly I never finished that blog series due to severe suicidal depression (ended up being hospitalized for several months), but I do have a toy implementation of that laying around somewhere.
Currently abroad for my primary profession (fashion model), but as soon as this current job is finished and I'm back home I could look for it and ping you.
Any preferred channel where I can reach you, or do you prefer me replying here?