Skip to content

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

@qq1174159858

Description

@qq1174159858

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, ...>).

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