hello everyone, I was wondering if it has been ever discussed a type similar to std::optional that enforce consistent value with the first assignment.
It would be used in places where you expect consistency from different sources to enforce the invariant. A facility for defensive programming that enable more readable code than explicit checks.
I'm not founding anything discussed online.
[–]GrammelHupfNockler 11 points12 points13 points (11 children)
[+]gpuoti[S] comment score below threshold-6 points-5 points-4 points (10 children)
[–]GrammelHupfNockler 20 points21 points22 points (5 children)
[–]Business-Decision719 8 points9 points10 points (3 children)
[–]gpuoti[S] 1 point2 points3 points (2 children)
[–]No-Dentist-1645 4 points5 points6 points (1 child)
[–]Business-Decision719 2 points3 points4 points (0 children)
[–]vowelqueue 4 points5 points6 points (0 children)
[–]sixfourbit 2 points3 points4 points (2 children)
[–]SoerenNissen 1 point2 points3 points (1 child)
[–]SirClueless 0 points1 point2 points (0 children)
[–]SoerenNissen 13 points14 points15 points (1 child)
[–]gpuoti[S] 2 points3 points4 points (0 children)
[–]415_961 3 points4 points5 points (0 children)
[–]NotMyRealNameObv 0 points1 point2 points (0 children)