Skip to content

Cannot result in a constant expression errors #52

@vladipus

Description

@vladipus

Binary operators like:

template <typename B, typename I, unsigned int F, bool R>
constexpr inline fixed<B, I, F, R> operator+(const fixed<B, I, F, R>& x, const fixed<B, I, F, R>& y) noexcept
{
return fixed<B, I, F, R>(x) += y;
}

are defined as constexpr but the += operator is never constexpr which results in a "cannot result in a constant expression" error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions