beark / ftl

C++ template library for fans of functional programming
zlib License
992 stars 69 forks source link

monoid defined in_terms_of_plus: typo #15

Closed viboes closed 9 years ago

viboes commented 9 years ago

Hi,

there is a typo in

    template<typename M>
    struct deriving_monoid<in_terms_of_plus<M>> {
        static constexpr M id() noexcept(noexcept(M(0))) {
            return M();
        }

It should be either noexcept(M(0)) and return M(0) or noexcept(M()) and return M().

What do you intended?

splinterofchaos commented 9 years ago

I thing that it should be noexcept(M()). It would make sense to describe things like std::string this way, and std::string(0) would work, but refer to the wrong constructor.