If I make it explicit, then the times that that would be what I want wouldn't work.
Is there a way to add different functions to a STL class?
I.e. rewrite the push_back function with an overload?
its the difference between doing this with a std::vector/list:
Code:
std::vector<any> x;
x.push_back(10);
x.push_back('a');
and
Code:
std::vector<any> x;
x.push_back(any(10));
x.push_back(any('a'));
also, the most important part:
That no longer would work because that calls the constructor.
Otherwise, your method is perfect! So can I change a STL class?
Or best of all, can you make it explicit only in certain functions?