Thanks to visit codestin.com
Credit goes to github.com

Skip to content

if (this != &rhs) in unique ptr #3538

@DenisYaroshevskiy

Description

@DenisYaroshevskiy

Hi

This this != _STD addressof(_Right) seems redundant

if (this != _STD addressof(_Right)) {

I can't say I understand what are you trying to enable if away, tbh though - but this seems like a less specialized version of the previous assignment.

Here is libc++ - no check
https://github.com/llvm/llvm-project/blob/93a2feccbc909230b6a091f5836b92739bd12941/libcxx/include/__memory/unique_ptr.h#L231

Can you maybe delete it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedSomething works now, yay!performanceMust go faster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions