language: C++11 (gcc-4.7.2)
date: 254 days 4 hours ago
link:
visibility: public
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
#include <iostream>
#include <string>
 
using namespace std;
 
struct Uid {
  typedef int type;  
};
 
struct Name {
  typedef string type;
};
 
struct Age {
  typedef int type;
};
 
template <class T1, class T2, class T3>
class People {
private:
  typename T1::type val1;
  typename T2::type val2;
  typename T3::type val3;
public:
  template<typename T>
  void get(void) {}
};
 
int main() {
  People<Uid, Name, Age> people;
  people.get<Uid>(); //make this validate
}