Skip to content

Add operator== for vec and element #131

@sebsjames

Description

@sebsjames

I.e. this:

        //! == an element. Return true if every element is equal to the element
        constexpr bool operator==(const S rhs) const noexcept
        {
            auto _element_fails = [rhs](S a, S b) -> S { return a + (b == rhs ? S{0} : S{1}); };
            return std::accumulate (this->begin(), this->end(), S{0}, _element_fails) == S{0} ? true : false;
        }

Add it to vec and vvec and consider also operator!= element

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