Boost logo

Boost :

Subject: Re: [boost] Math tools polynomial enhancements
From: Peter Dimov (lists_at_[hidden])
Date: 2015-10-30 17:40:33


John Maddock wrote:
> A simpler alternative might be:
>
> template <class T, size_t N>
> class polynomial;
>
> Which implements a polynomial of maximum order N. Multiplication would
> have to be mod x^N as I can't think of an error handling mechanism that
> works for both runtime and constexpr contexts?

I think that throwing an exception works in both contexts. In a constexpr
context, if the path that throws is chosen, the result is a compile-time
error.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk