forked from changkun/modern-cpp-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2.13.alias.template.cpp
More file actions
33 lines (28 loc) · 652 Bytes
/
2.13.alias.template.cpp
File metadata and controls
33 lines (28 loc) · 652 Bytes
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
//
// 2.13.alias.template.cpp
// chapter 2 language usability
// modern cpp tutorial
//
// created by changkun at changkun.de
// https://github.com/changkun/modern-cpp-tutorial
//
#include <iostream>
#include <vector>
#include <string>
template<typename T, typename U>
class MagicType {
public:
T dark;
U magic;
};
// illegal
// template<typename T>
// typedef MagicType<std::vector<T>, std::string> FakeDarkMagic;
typedef int (*process)(void *);
using NewProcess = int(*)(void *);
template<typename T>
using TrueDarkMagic = MagicType<std::vector<T>, std::string>;
int main() {
// FakeDarkMagic<bool> me;
TrueDarkMagic<bool> you;
}