Created
June 6, 2019 00:06
-
-
Save gabrielschulhof/339051cc41716c532c05fce8326cbf59 to your computer and use it in GitHub Desktop.
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
#include <stdio.h> | |
template <int x_init, int y_init> | |
class HasStructures { | |
public: | |
struct InnerStruct { | |
InnerStruct(): x(x_init), y(y_init) {} | |
int x; | |
int y; | |
}; | |
static InnerStruct item; | |
}; | |
template <int x_init, int y_init> | |
HasStructures<x_init, y_init>::InnerStruct HasStructures::item; | |
int main() { | |
printf("%d, %d\n", HasStructures<5, 6>::item.x, HasStructures<5, 6>::item.y); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment