Skip to content

Incorrect Assignment Operator Overload for erasure<false, ...>::operator= #69

Description

@kukuzuochuantou

In include/function2/function2.hpp, the following assignment operator overload appears to have an issue:

C++
template
constexpr erasure&
operator=(erasure<true, OtherConfig, property_t> right) noexcept {
invoke_table_ = right.invoke_table_;
view_ = right.view_;
return *this;
}
Problem:
This operator overload accepts an owning erasure (erasure<true, ...>) as the right-hand side, but assigns its internal pointer (view_ = right.view_) to the non-owning erasure (erasure<false, ...>).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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