Skip to content

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