Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections constructor #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Corrections constructor #3

wants to merge 1 commit into from

Conversation

sv-91
Copy link

@sv-91 sv-91 commented Oct 11, 2019

2 correction:

  1. std::forward
  2. make_safe instead constructor

@AlexeyAB
Copy link
Owner

A few words why is it better to use make_safe instead constructor?

@sv-91
Copy link
Author

sv-91 commented Oct 11, 2019

Template parameter in the constructor sometimes causes a compilation error. Since the compiler cannot distinguish 2 constructors.

template
A(B &&)

and

A(const A&)

https://mpark.github.io/programming/2014/06/07/beware-of-perfect-forwarding-constructors/

Instead of this method, you can try sfinae

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.

2 participants