/src/immer/immer/refcount/no_refcount_policy.hpp
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // immer: immutable data structures for C++ |
3 | | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente |
4 | | // |
5 | | // This software is distributed under the Boost Software License, Version 1.0. |
6 | | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt |
7 | | // |
8 | | |
9 | | #pragma once |
10 | | |
11 | | namespace immer { |
12 | | |
13 | | struct disowned |
14 | | {}; |
15 | | |
16 | | /*! |
17 | | * Disables reference counting, to be used with an alternative garbage |
18 | | * collection strategy like a `gc_heap`. |
19 | | */ |
20 | | struct no_refcount_policy |
21 | | { |
22 | 11.5M | no_refcount_policy(){}; |
23 | 0 | no_refcount_policy(disowned) {} |
24 | | |
25 | 20.2M | void inc() {} |
26 | 5.82M | bool dec() { return false; } |
27 | 16.9M | bool unique() { return false; } |
28 | | }; |
29 | | |
30 | | } // namespace immer |