I'm trying to output the full type of a typedef in the build log of Visual Studio; even for possibly failing typedefs, f.e. when a partial specialisation is missing. My specific version is 2019 but i also tried and failed with 2010 and 2015.
The only possible solution for this i could find is here but it doesn't work in Visual Studio.
Here's the testcode:
template<typename T>
struct Printer;
template <typename T>
struct ST;
template <>
struct ST<int&> {
typedef int T;
};
template <typename T>
struct S {
Printer<typename ST<T>::T> t;
};
int main() {
typedef int& intref;
S<intref> testi;
typedef float& floatref;
S<floatref> testf;
typedef short& shortref;
Printer<shortref> testsi;
}
For this example, i'd like to see somewhere an output of
- "int" for the existing specialization
- "float&" for the missing specialization
- "short&" or "short int&" for the simple case