Coverage Report

Created: 2026-01-09 06:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/immer/immer/transience/no_transience_policy.hpp
Line
Count
Source
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
/*!
14
 * Disables any special *transience* tracking.  To be used when
15
 * *reference counting* is available instead.
16
 */
17
struct no_transience_policy
18
{
19
    template <typename>
20
    struct apply
21
    {
22
        struct type
23
        {
24
            struct edit
25
            {};
26
27
            struct owner
28
            {
29
0
                operator edit() const { return {}; }
Unexecuted instantiation: immer::no_transience_policy::apply<immer::heap_policy<immer::cpp_heap> >::type::owner::operator immer::no_transience_policy::apply<immer::heap_policy<immer::cpp_heap> >::type::edit() const
Unexecuted instantiation: immer::no_transience_policy::apply<immer::free_list_heap_policy<immer::cpp_heap, 1024ul> >::type::owner::operator immer::no_transience_policy::apply<immer::free_list_heap_policy<immer::cpp_heap, 1024ul> >::type::edit() const
30
            };
31
32
            struct ownee
33
            {
34
3.12M
                ownee& operator=(edit) { return *this; };
immer::no_transience_policy::apply<immer::heap_policy<immer::cpp_heap> >::type::ownee::operator=(immer::no_transience_policy::apply<immer::heap_policy<immer::cpp_heap> >::type::edit)
Line
Count
Source
34
2.15M
                ownee& operator=(edit) { return *this; };
immer::no_transience_policy::apply<immer::free_list_heap_policy<immer::cpp_heap, 1024ul> >::type::ownee::operator=(immer::no_transience_policy::apply<immer::free_list_heap_policy<immer::cpp_heap, 1024ul> >::type::edit)
Line
Count
Source
34
961k
                ownee& operator=(edit) { return *this; };
35
840k
                bool can_mutate(edit) const { return false; }
immer::no_transience_policy::apply<immer::heap_policy<immer::cpp_heap> >::type::ownee::can_mutate(immer::no_transience_policy::apply<immer::heap_policy<immer::cpp_heap> >::type::edit) const
Line
Count
Source
35
641k
                bool can_mutate(edit) const { return false; }
immer::no_transience_policy::apply<immer::free_list_heap_policy<immer::cpp_heap, 1024ul> >::type::ownee::can_mutate(immer::no_transience_policy::apply<immer::free_list_heap_policy<immer::cpp_heap, 1024ul> >::type::edit) const
Line
Count
Source
35
199k
                bool can_mutate(edit) const { return false; }
36
195M
                bool owned() const { return false; }
immer::no_transience_policy::apply<immer::heap_policy<immer::cpp_heap> >::type::ownee::owned() const
Line
Count
Source
36
163M
                bool owned() const { return false; }
immer::no_transience_policy::apply<immer::free_list_heap_policy<immer::cpp_heap, 1024ul> >::type::ownee::owned() const
Line
Count
Source
36
31.7M
                bool owned() const { return false; }
37
            };
38
39
            static owner noone;
40
        };
41
    };
42
};
43
44
template <typename HP>
45
typename no_transience_policy::apply<HP>::type::owner
46
    no_transience_policy::apply<HP>::type::noone = {};
47
48
} // namespace immer