I am not sure if you have considered this possibility: I find it much more generic to provide "free functions" to decouple the extension of functionality from the core of a class than the intrusive way via member methods.
This way, the standard std::epected doesn't have to be replaced or updated by a proposal, and its use can be made even more useful.
The "pipe" operator|() can be used as a convenient way to concatenate things, and the syntax looks and feels as natural as the "dot" operator:
I am not sure if you have considered this possibility: I find it much more generic to provide "free functions" to decouple the extension of functionality from the core of a class than the intrusive way via member methods. This way, the standard
std::epected
doesn't have to be replaced or updated by a proposal, and its use can be made even more useful.The "pipe"
operator|()
can be used as a convenient way to concatenate things, and the syntax looks and feels as natural as the "dot" operator:This would also apply to your proposal for monadic operations for
std::optional
.