Boost logo

Boost Users :

From: John Maddock (jz.maddock_at_[hidden])
Date: 2019-08-06 07:52:07


On 06/08/2019 06:46, Frédéric via Boost-users wrote:
> Hi,
>
> I think that some rational constructors can be marked noexcept.
> In particular:
> - default constructor: rational()
> - constructor from integer: rational(const T& n, typename
> enable_if_c<...>::type const* = 0)

Careful: they would have to be conditionally noexcept to support
multiprecision types which may throw on those operations (memory
allocation).

>
> Concerning the constructor with numerator and denominator, if the
> denominator is always not null, it could be noexcept but I guess we
> cannot enforce not null unless we use some kind of gsl::not_null.
>
> Your thoughts?
>
> Thanks,
>
> F
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net