summaryrefslogtreecommitdiffhomepage
path: root/test/bptr.cpp
blob: 99d6cd2c0032ff679db5fbd234f1607eb664ae6f (plain)
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
#include "app.hpp"
#include "compat/assert.hpp"
#include "compat/borrowed-ptr.inl"

namespace floormat {

namespace {
struct Foo {};
struct Bar : Foo {};
struct Baz {};
} // namespace

// NOLINTBEGIN(*-use-anonymous-namespace)

template struct detail_borrowed_ptr::control_block_impl<Foo>;
template struct detail_borrowed_ptr::control_block_impl<Bar>;
template struct detail_borrowed_ptr::control_block_impl<Baz>;

template bool operator==(const bptr<Foo>&, const bptr<Foo>&) noexcept;
template bool operator==(const bptr<Bar>&, const bptr<Bar>&) noexcept;
template bool operator==(const bptr<Baz>&, const bptr<Baz>&) noexcept;

template class bptr<Foo>;
template class bptr<Bar>;
template class bptr<Baz>;

template bptr<Foo> static_pointer_cast(const bptr<Foo>&) noexcept;
template bptr<Bar> static_pointer_cast(const bptr<Bar>&) noexcept;
template bptr<Baz> static_pointer_cast(const bptr<Baz>&) noexcept;

template bptr<Bar> static_pointer_cast(const bptr<Foo>&) noexcept;
template bptr<Foo> static_pointer_cast(const bptr<Bar>&) noexcept;

//template bptr<Baz> static_pointer_cast(const bptr<Bar>&) noexcept; // must fail
//template bptr<Foo> static_pointer_cast(const bptr<Baz>&) noexcept; // must fail
//template bptr<Bar> static_pointer_cast(const bptr<Baz>&) noexcept; // must fail

// NOLINTEND(*-use-anonymous-namespace)

namespace {

void test1()
{
}

} // namespace

void test_app::test_bptr()
{
    test1();
}

} // namespace floormat