Skip to content

src: make deleted functions public in node.h#25764

Closed
gengjiawen wants to merge 1 commit into
nodejs:masterfrom
gengjiawen:refactor_node.h
Closed

src: make deleted functions public in node.h#25764
gengjiawen wants to merge 1 commit into
nodejs:masterfrom
gengjiawen:refactor_node.h

Conversation

@gengjiawen

Copy link
Copy Markdown
Member

Expert from Effective Modern C++ Items 11: Prefer deleted functions to private undefined ones

By convention, deleted functions are declared public, not private. There’s a reason for that. When client code tries to use a member function, C++ checks accessibility before deleted status. When client code tries to use a deleted private function, some compilers complain only about the function being private, even though the function’s accessibility doesn’t really affect whether it can be used. It’s worth bearing this in mind when revising legacy code to replace private-and-not-defined member functions with deleted ones, because making the new functions public will generally result in better error messages.

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Comment thread src/node.h Outdated
@addaleax

Copy link
Copy Markdown
Member

@danbev

danbev commented Jan 31, 2019

Copy link
Copy Markdown
Contributor

Landed in 0dfd5a5.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants