Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

enable_intrusive_ptr.hpp
Go to the documentation of this file.
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 
12 
13 namespace immer {
14 
15 template <typename Deriv, typename RefcountPolicy>
17 {
18  mutable RefcountPolicy refcount_data_;
19 
20 public:
23  {}
24 
25  friend void intrusive_ptr_add_ref(const Deriv* x)
26  {
27  x->refcount_data_.inc();
28  }
29 
30  friend void intrusive_ptr_release(const Deriv* x)
31  {
32  if (x->refcount_data_.dec())
33  delete x;
34  }
35 };
36 
37 } // namespace immer
friend void intrusive_ptr_release(const Deriv *x)
friend void intrusive_ptr_add_ref(const Deriv *x)
Released under the MIT license