Skip to content

Conversation

@GauthamBanasandra
Copy link
Contributor

The Environment class was missing the move constructor
and the move assignmnet operator.
As per the rule of five, a class must implement all the
five special member functions in order to enable the
compiler for better optimization.

Refs: https://en.cppreference.com/w/cpp/language/rule_of_three

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

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jul 6, 2019
@GauthamBanasandra GauthamBanasandra force-pushed the ctors branch 2 times, most recently from b8366b2 to f7cb4f4 Compare July 7, 2019 16:17
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your PR contains a lot of stylistic changes. Can you undo those please? We don't accept style changes as a rule and it makes code review a lot more onerous.

The classes in env.h were not adhering to the rule of five.
As per the rule of five, if a class implements any of five
special member functions, it must implement all the
five special member functions for enabling the compiler for
better optimization.

Refs: https://en.cppreference.com/w/cpp/language/rule_of_three
@GauthamBanasandra
Copy link
Contributor Author

@bnoordhuis I've made the changes that you requested. PTAL.

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member

Trott commented Jul 10, 2019

Landed in 7e69bce

@Trott Trott closed this Jul 10, 2019
Trott pushed a commit to Trott/io.js that referenced this pull request Jul 10, 2019
The classes in env.h were not adhering to the rule of five.
As per the rule of five, if a class implements any of five
special member functions, it must implement all the
five special member functions for enabling the compiler for
better optimization.

Refs: https://en.cppreference.com/w/cpp/language/rule_of_three

PR-URL: nodejs#28579
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@GauthamBanasandra GauthamBanasandra deleted the ctors branch July 10, 2019 05:13
targos pushed a commit that referenced this pull request Jul 20, 2019
The classes in env.h were not adhering to the rule of five.
As per the rule of five, if a class implements any of five
special member functions, it must implement all the
five special member functions for enabling the compiler for
better optimization.

Refs: https://en.cppreference.com/w/cpp/language/rule_of_three

PR-URL: #28579
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
This was referenced Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants