The purpose of the exception monad is to simulate exception handling in template metaprograms. All values are considered as monadic values to simplify the integration of compile-time exceptions into metaprograms that were originally not perpared for them, and as a result, to make compile time exception handling similar to run-time exception handling. Values with exception_tag
as their tag are considered error values, while other values are considered normal results.
<mpllibs/metamonad/exception.hpp>
exception_tag
return
's logic: identity operationbind
's logic: when the first argument is an exception, return it as it is, otherwise pass the first argument to the second and return the result of it.Copyright Abel Sinkovics (abel at elte dot hu) 2011. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt