ptal / expected

What did you expect?
113 stars 18 forks source link

[Monads] Generalize the value_or algorithm #16

Closed viboes closed 10 years ago

viboes commented 10 years ago

boost/expected/algorithms/value_or.hpp contains a function that can be generalized to other monads, as it is the case of expected<T>, optional<T> and future<T>.

The first question is in which namespace this function must be defined. The second is if it is worth defining a default for classes that or forward the call to a member function value_or.

viboes commented 10 years ago

https://github.com/ptal/Boost.Expected/commit/f3cac1977c91b3697fbc988f52c0b6a387adb5af