F
Frank Neuhaus
Hi,
say I have the following situation:
struct Foo
{
static int something();
}
struct Bar
{
static float something();
}
template<typename T> void func()
{
??? x=T::something();
};
func<Foo>();
func<Bar>();
Is there anything I can use as ??? to make x of the same type that
T::something returns? So far I believe that the only option is to use an
additional typedef in each struct... The C++0x 'auto' feature appears to
solve this issue. But is there also anything in the current C++ standard?
Thanks in advance
Frank
say I have the following situation:
struct Foo
{
static int something();
}
struct Bar
{
static float something();
}
template<typename T> void func()
{
??? x=T::something();
};
func<Foo>();
func<Bar>();
Is there anything I can use as ??? to make x of the same type that
T::something returns? So far I believe that the only option is to use an
additional typedef in each struct... The C++0x 'auto' feature appears to
solve this issue. But is there also anything in the current C++ standard?
Thanks in advance
Frank