forked from RosettaCommons/binder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
T07.class.hpp
109 lines (84 loc) · 1.79 KB
/
T07.class.hpp
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// Copyright (c) 2016 Sergey Lyskov <[email protected]>
//
// All rights reserved. Use of this source code is governed by a
// MIT license that can be found in the LICENSE file.
/// @file binder/test/T07.class.hpp
/// @brief Binder self-test file. Bindings of classes data members functionality.
/// @author Sergey Lyskov
#ifndef _INCLUDED_T07_class_hpp_
#define _INCLUDED_T07_class_hpp_
struct Integral
{
int i;
unsigned int ui;
long l;
unsigned long ul;
};
struct Floating_point
{
float f;
double d;
long double ld;
};
struct Arrays
{
int i__not_binded[8];
int ii_not_binded[8][8];
float f__not_binded[8];
float ff_not_binded[8][8];
};
struct Pointers_and_References
{
Pointers_and_References() = delete;
int *ip_not_binded;
float *fp_not_binded;
int &i_r;
float &f_r;
};
class Consts
{
private:
int const private_int_not_binded = 1;
static int const private_static_not_binded;
public:
Integral const public_Integral = Integral();
static Integral const static_public_Integral;
int const public_int = 1;
static int const public_static;
const int *ip_not_binded = nullptr;
const float *fp_not_binded = nullptr;
};
class Enums
{
public:
enum E1 { E1V = 2 };
enum class E2 { E2V = 4 };
enum class E3 {};
protected:
enum EP0_not_binded { EP0V };
private:
enum EP1_not_binded { EP1V };
};
class Access
{
public:
int i;
void foo_public(){};
static float foo(double) { return 1.0; }
static double a_double;
protected:
int i_protected_not_binded;
void foo_protected_not_binded(){};
private:
int i_not_binded;
void foo_private_not_binded(){};
};
struct ConstOverload
{
void foo(int) {}
void foo(int) const {}
};
#endif // _INCLUDED_T07_class_hpp_