Defined in Call signatures Return value A monadic type of the same kind Examples fn optional<double> op 12 1 auto rounded op | fn and_then auto&& v > fn optional<unsigned> return static_cast<unsigned> std ceil v 0 5 REQUIRE rounded value 13u The resulting value is because is not a and therefore is called 13 op nullopt and_then fn optional<double> op std nullopt auto empty op | fn and_then auto&& v > fn optional<unsigned> return static_cast<unsigned> std ceil v 0 5 Not called because op is empty REQUIRE not empty has_value The result is a because was already a and therefore is not called nullopt op nullopt and_then Execute a function on the value of the monadic type if the value is present Use through the fn and_then nielbloid Execute a function on the value of the monadic type if the value is present return A functor that will execute the function on the value fn auto && The function to execute on the value