Q
Qi
What I want to do is,
template <typename T>
void process(const T & value);
UndeterminedType generate();
"generate" may return value in various types, which is unknown when it's
called. What's determined is that all types are already known and
defined.
So I know "generate" can return a value in type A, B or C, but I don't
know which one it exactly is.
The result from "generate" is only used to feed "process", I don't need
to store it. But it will be good if I can store it.
Seems "auto" keyword in C++0x is introduced to solve that problem.
My question is, how to do the equivalence in non-0x C++?
The reason I won't use 0x is seems current compilers can't support it
well. VC only supports "auto" from version 10 while I'm using 9!
template <typename T>
void process(const T & value);
UndeterminedType generate();
"generate" may return value in various types, which is unknown when it's
called. What's determined is that all types are already known and
defined.
So I know "generate" can return a value in type A, B or C, but I don't
know which one it exactly is.
The result from "generate" is only used to feed "process", I don't need
to store it. But it will be good if I can store it.
Seems "auto" keyword in C++0x is introduced to solve that problem.
My question is, how to do the equivalence in non-0x C++?
The reason I won't use 0x is seems current compilers can't support it
well. VC only supports "auto" from version 10 while I'm using 9!