object_threadsafe
object_threadsafe copied to clipboard
Corrections constructor
2 correction:
- std::forward
- make_safe instead constructor
A few words why is it better to use make_safe instead constructor?
Template parameter in the constructor sometimes causes a compilation error. Since the compiler cannot distinguish 2 constructors.
template<class B> 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