-
-
Save abhi1010/0bd5e4d910e4d8a7672e to your computer and use it in GitHub Desktop.
typename usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class T1> | |
struct OuterStruct | |
{ | |
T1 mValue; | |
struct InnerStruct | |
{ | |
T1 mValue; | |
}; | |
}; | |
template <class T2> | |
struct InnerStruct_Wrapper | |
{ | |
OuterStruct<T2>::InnerStruct mUsingInner; | |
}; | |
int main(int argc, char* argv[]) | |
{ | |
InnerStruct_Wrapper<int> wrapper; | |
OuterStruct<int>::InnerStruct innerStrct; | |
innerStrct.mValue = std::numeric_limits<int>::max(); | |
wrapper.mUsingInner = innerStrct; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment