This is a simplified version of my type system:
#include
#include
template
class Box {
public:
Box(const T&a
c
currently need 2 implicit user conversions (const char [N]
-> std::string
-> String
) whereas only one is allowed.
You may add template constructor to Box
template
class Box {
public:
Box() = default;
Box(const Box&) = default;
Box(Box&&) default;
~Box() = default;
Box& operator=(const Box&) = default;
Box& operator=(Box&&) = default;
template ::value
&& (!std::is_same>::value
|| sizeof...(Us) != 0)>* = nullptr>
Box(U0&& u0, Us&&... us) : _value(std::forward(u0), std::forward(us)...) {}
private:
T _value;
/* ... */
};
Demo Demo2