U
uvts_cvs
Hi to everybody, can someone help me?
This compiles in C++:
struct Foo
{
// Function template bar
template <class T>
void bar (T t){}
// Function bar that forwards to bar<T> [with T=int]
void bar (int i){fun<int>(i);}
};
But what if you consider in place of bar the user defined conversion
operator?
How can I express in a correct way the next chunk of code?
This doesn't compile:
struct Foo
{
// Template user defined conversion
template <class T>
operator T (){}
// I would like to forward to operator T [with T=int]
operator int (){operator int<int>();}
};
Is there a way to distinguish between operaror int and operator T [with
T=int]?
Thank you in advance,
Regards Daniele
This compiles in C++:
struct Foo
{
// Function template bar
template <class T>
void bar (T t){}
// Function bar that forwards to bar<T> [with T=int]
void bar (int i){fun<int>(i);}
};
But what if you consider in place of bar the user defined conversion
operator?
How can I express in a correct way the next chunk of code?
This doesn't compile:
struct Foo
{
// Template user defined conversion
template <class T>
operator T (){}
// I would like to forward to operator T [with T=int]
operator int (){operator int<int>();}
};
Is there a way to distinguish between operaror int and operator T [with
T=int]?
Thank you in advance,
Regards Daniele