On Sat, Mar 11, 2017 at 9:23 AM Robert Ramey via Boost < boost@lists.boost.org> wrote:
On 3/11/17 7:52 AM, Steven Watanabe via Boost wrote:
AMDG
On 03/11/2017 02:00 AM, Antony Polukhin via Boost wrote:
I'd like to see an additional statefull ExceptionPolicy that remembers that an UB was triggered, but does not throw at all. Here's how it could be used:
This also requires an extra function to combine two ExceptionPolicies for binary operators. You'll run into problems with comparison operators, though, as a bool can't hold an ExceptionPolicy.
Couldn't the addressed by a variation of the "ignore exception" policy which is meant to just return?
A simple extension to log such errors could be crafted from this idea and would make a great example on how to make one's own exception policy.
What is missing from this idea?
The solution I favor is for `std::common_type` to be specialized for allowed combinations. For example, `std::common_type_t
`, would be `ExceptionPolicy` and `std::common_type_t ` would be `T`. Thus, safer types would "win out" over less safe types.
In Christ, Steven Watanabe
_______________________________________________ Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost