1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <utility>
using POD1 = std::pair<unsigned, unsigned>;
template<typename T>
class LargeConfig
{
public:
// methods
static const POD1 POD_ONES[];
static T ManyTs[];
};
template<typename T>
const POD1 LargeConfig<T>::POD_ONES[] =
{
{ 0U, 1U}, // instance 1
{ 1U, 1U}, // instance 2
};
template<typename T>
T LargeConfig<T>::ManyTs[] =
{
T(), // instance 1
T() // instance 2
};
int main()
{
std::cout << LargeConfig<int>::ManyTs[0]
<< LargeConfig<int>::POD_ONES[0].second;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
g++ -std=c++1z -O2 -Wall -pedantic-errors -pthread main.cpp && ./a.out
01