Developers
Documentation
Guide
Reference
Examples
Glossary
Resources
Community
Vocabulary
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
immer::detail::rbts::size_t
std::size_t size_t
Definition:
bits.hpp:20
immer::detail::rbts::count_t
std::uint32_t count_t
Definition:
bits.hpp:19
immer::detail::rbts::shift_t
std::uint32_t shift_t
Definition:
bits.hpp:18
immer
Definition:
algorithm.hpp:15
immer::detail::rbts::bits_t
std::uint32_t bits_t
Definition:
bits.hpp:17
immer::detail::rbts::mask
constexpr T mask
Definition:
bits.hpp:26
immer::detail::rbts::endshift
constexpr shift_t endshift
Definition:
bits.hpp:29
immer::detail::rbts::branches
constexpr T branches
Definition:
bits.hpp:23
src
immer
detail
rbts
bits.hpp
Generated on Mon Nov 2 2020 19:11:12 for Dash Core by
1.8.14