forked from RosettaCommons/binder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
T10.inheritance.hpp
73 lines (56 loc) · 1.18 KB
/
T10.inheritance.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
// -*- 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/T10.inheritance.hpp
/// @brief Binder self-test file. Bindings tests for class hierarchy’s.
/// @author Sergey Lyskov
#ifndef _INCLUDED_T10_inheritance_hpp_
#define _INCLUDED_T10_inheritance_hpp_
#include <memory>
#include <string>
class Base
{
protected:
virtual void foo_protected() {}
int data;
public:
void foo() {}
void maybe() {}
virtual void f_v() {}
virtual void f_v_2() {}
};
class Derived : public Base
{
public:
using Base::data;
using Base::foo_protected;
};
class Delete : public Base
{
public:
Delete() = delete;
void maybe() = delete;
};
class A : public std::enable_shared_from_this<A>
{
};
class B : public std::string
{
public:
B(B const &) = default;
};
class X : public Base
{
public:
void f_v() final override {}
};
class Y final : public X
{
public:
void f_v_2() override {}
};
#endif // _INCLUDED_T10_inheritance_hpp_