safe_numerics icon indicating copy to clipboard operation
safe_numerics copied to clipboard

Consider defaulting template parameters for exception_policy class

Open correaa opened this issue 3 months ago • 0 comments

From the documentation

using logging_exception_policy = exception_policy<
    log_runtime_exception,    // arithmetic error
    ignore_exception,         // implementation defined behavior
    ignore_exception,         // undefined behavior
    ignore_exception          // uninitialized value
>;

It would make it less verbose to default the last three template parameters, in which case the example will look like this:

using logging_exception_policy = exception_policy<
    log_runtime_exception,    // arithmetic error
>;

making use cases like this simpler: https://godbolt.org/z/Yqa51dE7b

correaa avatar Oct 03 '25 21:10 correaa