-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinherit_test.cpp
78 lines (57 loc) · 1.55 KB
/
inherit_test.cpp
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Copyright (C) 2009-2012 Simon A. Berger
*
* This file is part of papara.
*
* papara is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* papara is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with papara. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <iostream>
// #include "ivymike/sdf.h"
class test_impl1 {
public:
struct xxx {
int a;
int b;
xxx( int a_ ) : a(a_), b(0) {}
void print() {
std::cout << "impl1: " << a << " " << b << "\n";
}
};
};
class test_impl2 {
public:
struct xxx {
int8_t a;
xxx( int a_ ) : a(a_) {}
void print() {
std::cout << "impl2: " << int(a) << "\n";
}
};
};
template<typename impl_>
class test : private impl_ {
public:
using typename impl_::xxx;
};
typedef test<test_impl1> test1;
typedef test<test_impl2> test2;
int main() {
test1 x;
test1::xxx y(129);
test2::xxx z(129);
y.print();
z.print();
// ivy_mike::sdf_full sdf( std::cin, true );
}