I have written a simple class template:
template <class T>
class my_class
{
public:
my_class(T value)
: my_Value(value)
{
}
private:
T my_Value;
};
Now I can use this template in a simple function signature like: my_function(my_class<std::string> my_string)
When I want to call the function I can easily use it:
auto my_instance = my_class<std::string>("my value");
my_function(my_instance);
But what I want to realize is a function call like this:
my_function("my value")
My class template should implicit do the conversion to the type of the template for me. I think I need some kind of operator overload.
std:optional can do this for example.