Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

bits.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 
11 #include <cstdint>
12 
13 namespace immer {
14 namespace detail {
15 namespace rbts {
16 
17 using bits_t = std::uint32_t;
18 using shift_t = std::uint32_t;
19 using count_t = std::uint32_t;
20 using size_t = std::size_t;
21 
22 template <bits_t B, typename T=count_t>
23 constexpr T branches = T{1} << B;
24 
25 template <bits_t B, typename T=size_t>
26 constexpr T mask = branches<B, T> - 1;
27 
28 template <bits_t B, bits_t BL>
29 constexpr shift_t endshift = shift_t{BL} - shift_t{B};
30 
31 } // namespace rbts
32 } // namespace detail
33 } // namespace immer
std::size_t size_t
Definition: bits.hpp:20
std::uint32_t count_t
Definition: bits.hpp:19
std::uint32_t shift_t
Definition: bits.hpp:18
std::uint32_t bits_t
Definition: bits.hpp:17
constexpr T mask
Definition: bits.hpp:26
constexpr shift_t endshift
Definition: bits.hpp:29
constexpr T branches
Definition: bits.hpp:23
Released under the MIT license