\hypertarget{bits_8h_source}{}\doxysection{bits.\+h} \label{bits_8h_source}\index{kblib/bits.h@{kblib/bits.h}} \mbox{\hyperlink{bits_8h}{Go to the documentation of this file.}} \begin{DoxyCode}{0} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00001}00001 \textcolor{comment}{/* *****************************************************************************}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00002}00002 \textcolor{comment}{ * kblib is a general utility library for C++14 and C++17, intended to provide}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00003}00003 \textcolor{comment}{ * performant high-\/level abstractions and more expressive ways to do simple}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00004}00004 \textcolor{comment}{ * things.}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00005}00005 \textcolor{comment}{ *}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 2021 killerbee}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00007}00007 \textcolor{comment}{ *}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00008}00008 \textcolor{comment}{ * This program is free software: you can redistribute it and/or modify}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00009}00009 \textcolor{comment}{ * it under the terms of the GNU General Public License as published by}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00010}00010 \textcolor{comment}{ * the Free Software Foundation, either version 3 of the License, or}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00011}00011 \textcolor{comment}{ * (at your option) any later version.}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00012}00012 \textcolor{comment}{ *}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00013}00013 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00014}00014 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00015}00015 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00016}00016 \textcolor{comment}{ * GNU General Public License for more details.}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00017}00017 \textcolor{comment}{ *}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00018}00018 \textcolor{comment}{ * You should have received a copy of the GNU General Public License}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00019}00019 \textcolor{comment}{ * along with this program. If not, see .}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00020}00020 \textcolor{comment}{ * ****************************************************************************/}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00021}00021 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00031}00031 \textcolor{preprocessor}{\#ifndef KBLIB\_BITS\_H}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00032}00032 \textcolor{preprocessor}{\#define KBLIB\_BITS\_H}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00033}00033 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00034}00034 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00035}00035 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00036}00036 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00037}00037 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00038}00038 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00039}00039 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00040}00040 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00041}00041 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00042}00042 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00043}00043 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00044}00044 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{fakestd_8h}{fakestd.h}}"{}}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00045}00045 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{simple_8h}{simple.h}}"{}}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00046}00046 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{stats_8h}{stats.h}}"{}}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00047}00047 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{tdecl_8h}{tdecl.h}}"{}}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00048}00048 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{traits_8h}{traits.h}}"{}}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00049}00049 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00050}00050 \textcolor{keyword}{namespace }\mbox{\hyperlink{tdecl_8h_a4b5c574c663a392148218cd4410fd7a1}{KBLIB\_NS}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00051}00051 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00052}00052 \textcolor{keyword}{template} <\textcolor{keyword}{typename} Int>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00053}\mbox{\hyperlink{namespacekblib_aa29cd1999efff7dd9b8d9aa8ab468109}{00053}} \textcolor{keyword}{constexpr} \textcolor{keywordtype}{int} \mbox{\hyperlink{namespacekblib_aa29cd1999efff7dd9b8d9aa8ab468109}{bits\_of}} = std::numeric\_limits::digits;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00054}00054 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00055}00055 \textcolor{preprocessor}{\#if KBLIB\_USE\_CXX17}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00056}00056 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00057}\mbox{\hyperlink{namespacekblib_1_1detail__bits}{00057}} \textcolor{keyword}{namespace }detail\_bits \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00058}00058 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00059}00059 \textcolor{keyword}{template} <\textcolor{keyword}{typename} Key, \textcolor{keyword}{typename} Value>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00060}\mbox{\hyperlink{classkblib_1_1detail__bits_1_1trie__node}{00060}} \textcolor{keyword}{class }\mbox{\hyperlink{classkblib_1_1detail__bits_1_1trie__node}{trie\_node}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00061}00061 std::unique\_ptr> children;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00062}00062 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} storage[\textcolor{keyword}{sizeof}(Value)]\{\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00063}00063 \textcolor{keywordtype}{bool} \mbox{\hyperlink{structkblib_1_1exists}{exists}} = \textcolor{keyword}{false};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00064}00064 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00065}00065 \textcolor{keyword}{template} <\textcolor{keyword}{typename}... Args>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00066}00066 \textcolor{keyword}{auto} create(Args\&\&... args) \textcolor{keyword}{noexcept}(} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00067}00067 std::is\_nothrow\_constructible::value) -\/> Value\& \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00068}00068 clear();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00069}00069 \textcolor{comment}{// This variable must exist for exception safety. exists should not be}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00070}00070 \textcolor{comment}{// set to true if an exception is thrown.}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00071}00071 \textcolor{keyword}{auto} v = *\textcolor{keyword}{new} (storage) Value(args...);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00072}00072 \mbox{\hyperlink{structkblib_1_1exists}{exists}} = \textcolor{keyword}{true};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00073}00073 \textcolor{keywordflow}{return} *v;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00074}00074 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00075}00075 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00076}00076 \textcolor{keyword}{auto} clear() \textcolor{keyword}{noexcept} -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00077}00077 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structkblib_1_1exists}{exists}}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00078}00078 \mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}()-\/>\string~Value();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00079}00079 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00080}00080 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00081}00081 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00082}00082 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00083}00083 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}() \textcolor{keyword}{noexcept} -\/> Value\& \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00084}00084 assert(\mbox{\hyperlink{structkblib_1_1exists}{exists}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00085}00085 \textcolor{keywordflow}{return} *\textcolor{keyword}{reinterpret\_cast<}Value*\textcolor{keyword}{>}(storage);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00086}00086 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00087}00087 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}() \textcolor{keyword}{const} \textcolor{keyword}{noexcept} -\/> \textcolor{keyword}{const} Value\& \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00088}00088 assert(\mbox{\hyperlink{structkblib_1_1exists}{exists}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00089}00089 \textcolor{keywordflow}{return} *\textcolor{keyword}{reinterpret\_cast<}Value*\textcolor{keyword}{>}(storage);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00090}00090 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00091}00091 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00092}00092 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00093}00093 \} \textcolor{comment}{// namespace detail\_bits}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00094}00094 \textcolor{comment}{/*}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00095}00095 \textcolor{comment}{template }} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00096}00096 \textcolor{comment}{class bit\_trie \{}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00097}00097 \textcolor{comment}{ public:}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00098}00098 \textcolor{comment}{ using value\_type = Value;}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00099}00099 \textcolor{comment}{ using key\_type = Key;}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00100}00100 \textcolor{comment}{ using mapped\_type = Value;}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00101}00101 \textcolor{comment}{}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00102}00102 \textcolor{comment}{ static\_assert(std::is\_integral::value,}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00103}00103 \textcolor{comment}{ "{}key\_type must be an integral type."{});}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00104}00104 \textcolor{comment}{ static\_assert(std::is\_nothrow\_destructible::value,}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00105}00105 \textcolor{comment}{ "{}mapped\_type must be nothrow destructible."{});}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00106}00106 \textcolor{comment}{}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00107}00107 \textcolor{comment}{ void insert(key\_type, const mapped\_type\&);}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00108}00108 \textcolor{comment}{ void insert(key\_type, mapped\_type\&\&);}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00109}00109 \textcolor{comment}{}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00110}00110 \textcolor{comment}{ private:}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00111}00111 \textcolor{comment}{ std::array> roots;}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00112}00112 \textcolor{comment}{\};//*/}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00113}00113 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00114}00114 \textcolor{keyword}{template} <\textcolor{keyword}{typename} Key, Key key\_range, \textcolor{keyword}{typename} Value>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00115}\mbox{\hyperlink{classkblib_1_1compact__bit__trie}{00115}} \textcolor{keyword}{class }\mbox{\hyperlink{classkblib_1_1compact__bit__trie}{compact\_bit\_trie}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00116}00116 \textcolor{keyword}{public}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00117}\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{00117}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00118}\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_a8d5d09ab8d00bfb68f3dff213ce45e21}{00118}} Key \mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_a8d5d09ab8d00bfb68f3dff213ce45e21}{prefix}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00119}\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_af093b39b3733cf20409a371fa2ee1668}{00119}} std::uint16\_t \mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_af093b39b3733cf20409a371fa2ee1668}{bits}} : \mbox{\hyperlink{namespacekblib_a5633a966716e66c8230d039c7615e393}{filg2}}(key\_range);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00120}00120 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00121}00121 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00122}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{00122}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{value\_type}} = Value;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00123}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ab0fb6be77b2a0ddeaf19997eda3ff47b}{00123}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ab0fb6be77b2a0ddeaf19997eda3ff47b}{mapped\_type}} = Value;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00124}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{00124}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} = \mbox{\hyperlink{namespacekblib_af6581571367a6b54af65b1174c2f416f}{uint\_smallest\_t}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00125}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ab7fb4a6fd96e98dcb2574a1e5df2a969}{00125}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ab7fb4a6fd96e98dcb2574a1e5df2a969}{difference\_type}} = \mbox{\hyperlink{namespacekblib_a54235123af1b79489fb0484fc64318ff}{int\_smallest\_t}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00126}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a55044b72a9698af15ee924502ade0bac}{00126}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a55044b72a9698af15ee924502ade0bac}{reference}} = \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{value\_type}}\&;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00127}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ad2885caecbf3683403e8066a6a332e35}{00127}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ad2885caecbf3683403e8066a6a332e35}{const\_reference}} = \textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{value\_type}}\&;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00128}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a4e8c6b8e6d8a09516abcc2726fa79b97}{00128}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a4e8c6b8e6d8a09516abcc2726fa79b97}{pointer}} = \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{value\_type}}*;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00129}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a4dbe4d3856529be40c81d9f31b58ea58}{00129}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a4dbe4d3856529be40c81d9f31b58ea58}{const\_pointer}} = \textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{value\_type}}*;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00130}00130 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00131}00131 \textcolor{keyword}{template} <\textcolor{keyword}{typename} V>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00132}00132 \textcolor{keyword}{class }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{iterator\_t}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00133}00133 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00134}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac3e54b578159f78d0537d8ee364a1eb6}{00134}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{iterator}} = \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{iterator\_t}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00135}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a624f3df6b0095ab11e04dc7bdac9bf50}{00135}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{const\_iterator}} = \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{iterator\_t}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00136}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_aa137ffb8d005de07b93a215130e59179}{00136}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_aa137ffb8d005de07b93a215130e59179}{reverse\_iterator}} = std::reverse\_iterator;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00137}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_af5b1fb298bddc03548be79cf8298ad7f}{00137}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_af5b1fb298bddc03548be79cf8298ad7f}{const\_reverse\_iterator}} = std::reverse\_iterator;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00138}00138 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00139}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a96f9b0b136be615f466a022ddeddd904}{00139}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a96f9b0b136be615f466a022ddeddd904}{bitset\_type}} = std::bitset>;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00140}00140 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00141}00141 \textcolor{keyword}{static\_assert}(std::is\_integral::value, \textcolor{stringliteral}{"{}Key must be an integral type."{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00142}00142 \textcolor{keyword}{static\_assert}(std::is\_unsigned::value, \textcolor{stringliteral}{"{}Key must be unsigned."{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00143}00143 \textcolor{keyword}{static\_assert}(std::is\_nothrow\_destructible::value,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00144}00144 \textcolor{stringliteral}{"{}mapped\_type must be nothrow destructible."{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00145}00145 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00146}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a52cd2ba0611206555c454aad9d378d9e}{00146}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a52cd2ba0611206555c454aad9d378d9e}{at}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key) \textcolor{keyword}{const} \textcolor{keyword}{noexcept}(\textcolor{keyword}{false})} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00147}00147 -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ad2885caecbf3683403e8066a6a332e35}{const\_reference}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00148}00148 \textcolor{keywordflow}{if} (empty()) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00149}00149 \textcolor{keywordflow}{throw} std::out\_of\_range(\textcolor{stringliteral}{"{}searched in an empty compact\_bit\_trie"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00150}00150 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00151}00151 \textcolor{keywordflow}{if} (key.bits > bits\_of) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00152}00152 \textcolor{keywordflow}{throw} std::invalid\_argument(\textcolor{stringliteral}{"{}key prefix longer than key length"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00153}00153 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00154}00154 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} node = 1;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00155}00155 \textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a96f9b0b136be615f466a022ddeddd904}{bitset\_type}} search = key.prefix;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00156}00156 \textcolor{keywordtype}{int} idx = 0;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00157}00157 \textcolor{keywordflow}{while} (node and idx < key.bits) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00158}00158 \textcolor{keywordflow}{if} (\textcolor{keyword}{auto} val = storage[node].val) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00159}00159 \textcolor{keywordflow}{return} values[val];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00160}00160 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00161}00161 node = storage[node].children[search[idx++]];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00162}00162 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00163}00163 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00164}00164 \textcolor{keywordflow}{throw} std::out\_of\_range(\textcolor{stringliteral}{"{}key not found in compact\_bit\_trie"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00165}00165 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00166}00166 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00167}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a56d3be5d89e4505a80059b64934e9d32}{00167}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a56d3be5d89e4505a80059b64934e9d32}{at}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key) \textcolor{keyword}{noexcept}(\textcolor{keyword}{false}) -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a55044b72a9698af15ee924502ade0bac}{reference}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00168}00168 \textcolor{keywordflow}{if} (empty()) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00169}00169 \textcolor{keywordflow}{throw} std::out\_of\_range(\textcolor{stringliteral}{"{}searched in an empty compact\_bit\_trie"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00170}00170 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00171}00171 \textcolor{keywordflow}{if} (key.bits > bits\_of) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00172}00172 \textcolor{keywordflow}{throw} std::invalid\_argument(\textcolor{stringliteral}{"{}key prefix longer than key length"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00173}00173 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00174}00174 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} node = 1;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00175}00175 \textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a96f9b0b136be615f466a022ddeddd904}{bitset\_type}} search = key.prefix;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00176}00176 \textcolor{keywordtype}{int} idx = 0;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00177}00177 \textcolor{keywordflow}{while} (node and idx < key.bits) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00178}00178 \textcolor{keywordflow}{if} (\textcolor{keyword}{auto} val = storage[node].val) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00179}00179 \textcolor{keywordflow}{return} values[val];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00180}00180 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00181}00181 node = storage[node].children[search[idx++]];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00182}00182 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00183}00183 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00184}00184 \textcolor{keywordflow}{throw} std::out\_of\_range(\textcolor{stringliteral}{"{}key not found in compact\_bit\_trie"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00185}00185 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00186}00186 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00187}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_aa8651dc68a5ca934571fafc16c3fa4b1}{00187}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_aa8651dc68a5ca934571fafc16c3fa4b1}{find\_deep}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key, \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} depth = -\/1) const} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00188}00188 noexcept(false) -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ad2885caecbf3683403e8066a6a332e35}{const\_reference}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00189}00189 \textcolor{keywordflow}{if} (empty()) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00190}00190 \textcolor{keywordflow}{throw} std::out\_of\_range(\textcolor{stringliteral}{"{}searched in an empty compact\_bit\_trie"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00191}00191 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00192}00192 \textcolor{keywordflow}{if} (key.\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_af093b39b3733cf20409a371fa2ee1668}{bits}} > bits\_of) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00193}00193 \textcolor{keywordflow}{throw} std::invalid\_argument(\textcolor{stringliteral}{"{}key prefix longer than key length"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00194}00194 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00195}00195 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} node = 1;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00196}00196 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} found = 0;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00197}00197 \textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a96f9b0b136be615f466a022ddeddd904}{bitset\_type}} search = key.\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_a8d5d09ab8d00bfb68f3dff213ce45e21}{prefix}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00198}00198 \textcolor{keywordtype}{int} idx = 0;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00199}00199 \textcolor{keywordflow}{while} (node and idx < key.\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_af093b39b3733cf20409a371fa2ee1668}{bits}}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00200}00200 \textcolor{keywordflow}{if} (\textcolor{keyword}{auto} val = storage[node].val) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00201}00201 found = val;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00202}00202 \textcolor{keywordflow}{if} (depth-\/-\/) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00203}00203 \textcolor{keywordflow}{break};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00204}00204 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00205}00205 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00206}00206 node = storage[node].children[search[idx++]];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00207}00207 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00208}00208 \textcolor{keywordflow}{if} (found) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00209}00209 \textcolor{keywordflow}{return} values[found];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00210}00210 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00211}00211 \textcolor{keywordflow}{throw} std::out\_of\_range(\textcolor{stringliteral}{"{}key not found in compact\_bit\_trie"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00212}00212 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00213}00213 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00214}00214 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00215}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_aea0c361b5ff5ba79466eff2a38836716}{00215}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_aea0c361b5ff5ba79466eff2a38836716}{find\_deep}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00216}00216 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} depth = -\/1) noexcept(false)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00217}00217 -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a55044b72a9698af15ee924502ade0bac}{reference}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00218}00218 \textcolor{keywordflow}{if} (empty()) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00219}00219 \textcolor{keywordflow}{throw} std::out\_of\_range(\textcolor{stringliteral}{"{}searched in an empty compact\_bit\_trie"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00220}00220 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00221}00221 \textcolor{keywordflow}{if} (key.\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_af093b39b3733cf20409a371fa2ee1668}{bits}} > bits\_of) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00222}00222 \textcolor{keywordflow}{throw} std::invalid\_argument(\textcolor{stringliteral}{"{}key prefix longer than key length"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00223}00223 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00224}00224 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} node = 1;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00225}00225 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} found = 0;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00226}00226 \textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a96f9b0b136be615f466a022ddeddd904}{bitset\_type}} search = key.\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_a8d5d09ab8d00bfb68f3dff213ce45e21}{prefix}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00227}00227 \textcolor{keywordtype}{int} idx = 0;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00228}00228 \textcolor{keywordflow}{while} (node and idx < key.\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type_af093b39b3733cf20409a371fa2ee1668}{bits}}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00229}00229 \textcolor{keywordflow}{if} (\textcolor{keyword}{auto} val = storage[node].val) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00230}00230 found = val;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00231}00231 \textcolor{keywordflow}{if} (depth-\/-\/) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00232}00232 \textcolor{keywordflow}{break};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00233}00233 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00234}00234 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00235}00235 node = storage[node].children[search[idx++]];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00236}00236 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00237}00237 \textcolor{keywordflow}{if} (found) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00238}00238 \textcolor{keywordflow}{return} values[found];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00239}00239 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00240}00240 \textcolor{keywordflow}{throw} std::out\_of\_range(\textcolor{stringliteral}{"{}key not found in compact\_bit\_trie"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00241}00241 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00242}00242 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00243}00243 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00244}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a6e7fcd026865c0aa4e2655feea2029fb}{00244}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a6e7fcd026865c0aa4e2655feea2029fb}{empty}}() const noexcept -\/> \textcolor{keywordtype}{bool} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00245}00245 \textcolor{keywordflow}{return} values.empty();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00246}00246 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00247}00247 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00248}00248 \textcolor{keyword}{template} <\textcolor{keyword}{typename}... Ts>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00249}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a5a56e7463a53d25630686db003cd1aff}{00249}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a5a56e7463a53d25630686db003cd1aff}{emplace}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key, Ts\&\&... args) -\/> \textcolor{keywordtype}{bool} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00250}00250 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} node = get\_storage\_node\_for(key);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00251}00251 \textcolor{keywordflow}{if} (\textcolor{keyword}{auto}\& v = storage[node].val; v != \mbox{\hyperlink{namespacekblib_1_1nums_a64067ecc4167ce1cfe32860ef5c1dc47}{max}}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00252}00252 \textcolor{keywordflow}{return} \textcolor{keyword}{false};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00253}00253 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00254}00254 values.emplace\_back(std::forward(args)...);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00255}00255 v = \textcolor{keyword}{static\_cast<}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}}\textcolor{keyword}{>}(values.size() -\/ 1);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00256}00256 \textcolor{keywordflow}{return} \textcolor{keyword}{true};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00257}00257 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00258}00258 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00259}00259 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00260}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a469010741579982c04d397c32befbe62}{00260}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a469010741579982c04d397c32befbe62}{insert}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key, \textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{value\_type}}\& value) -\/> \textcolor{keywordtype}{bool} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00261}00261 \textcolor{keywordflow}{return} emplace(key, value);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00262}00262 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00263}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ae4815146151134324306191624d91613}{00263}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ae4815146151134324306191624d91613}{insert}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key, \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{value\_type}}\&\& value) -\/> \textcolor{keywordtype}{bool} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00264}00264 \textcolor{keywordflow}{return} emplace(key, std::move(value));} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00265}00265 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00266}00266 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00267}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a7c6f607f04b5037e9ff100bb51d9e0de}{00267}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a7c6f607f04b5037e9ff100bb51d9e0de}{insert\_or\_assign}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key, \textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{value\_type}}\& value) -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a55044b72a9698af15ee924502ade0bac}{reference}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00268}00268 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} node = get\_storage\_node\_for(key);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00269}00269 \textcolor{keyword}{auto}\& v = storage[node].val;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00270}00270 \textcolor{keywordflow}{if} (v != -\/1) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00271}00271 values.push\_back(value);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00272}00272 v = \textcolor{keyword}{static\_cast<}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}}\textcolor{keyword}{>}(values.size() -\/ 1);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00273}00273 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00274}00274 values[v] = value;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00275}00275 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00276}00276 \textcolor{keywordflow}{return} values[v];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00277}00277 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00278}00278 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00279}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a821420511b4eb44be650e505e1740c81}{00279}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a821420511b4eb44be650e505e1740c81}{insert\_or\_assign}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key, \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac2322fc59d0c8bf2d008ceb32bc5d2b2}{value\_type}}\&\& value) -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a55044b72a9698af15ee924502ade0bac}{reference}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00280}00280 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} node = get\_storage\_node\_for(key);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00281}00281 \textcolor{keyword}{auto}\& v = storage[node].val;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00282}00282 \textcolor{keywordflow}{if} (v != -\/1) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00283}00283 values.push\_back(std::move(value));} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00284}00284 v = \textcolor{keyword}{static\_cast<}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}}\textcolor{keyword}{>}(values.size() -\/ 1);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00285}00285 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00286}00286 values[v] = std::move(value);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00287}00287 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00288}00288 \textcolor{keywordflow}{return} values[v];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00289}00289 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00290}00290 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00291}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac9c24174f0196230c3a18cca9408a560}{00291}} \textcolor{keywordtype}{bool} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ac9c24174f0196230c3a18cca9408a560}{erase}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} key);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00292}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a8ea7ecfbef1da7da29e1da3d6e3470ba}{00292}} \textcolor{keywordtype}{bool} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a8ea7ecfbef1da7da29e1da3d6e3470ba}{prune}}(\mbox{\hyperlink{structkblib_1_1compact__bit__trie_1_1key__type}{key\_type}} prefix);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00293}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a0e2971b68757907319adc4c940160376}{00293}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a0e2971b68757907319adc4c940160376}{clear}}() -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00294}00294 storage.clear();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00295}00295 values.clear();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00296}00296 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00297}00297 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00298}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a89ac5f1d972edbfb15e1542b651c9112}{00298}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a89ac5f1d972edbfb15e1542b651c9112}{size}}() const noexcept -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00299}00299 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}}\textcolor{keyword}{>}(values.size());} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00300}00300 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00301}00301 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00302}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_a1e814e7bc56ae6763c71d10a5f49b4e1}{00302}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a1e814e7bc56ae6763c71d10a5f49b4e1}{memory\_use}}() const noexcept -\/> \mbox{\hyperlink{namespacestd}{std}}::\textcolor{keywordtype}{size\_t} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00303}00303 \textcolor{keywordflow}{return} storage.capacity() * \textcolor{keyword}{sizeof}(inline\_node)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00304}00304 + values.size() * \textcolor{keyword}{sizeof}(Value);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00305}00305 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00306}00306 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00307}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_afe5a3b3b5667774cc67a76230cddf14f}{00307}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_afe5a3b3b5667774cc67a76230cddf14f}{shrink\_to\_fit}}() -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00308}00308 storage.shrink\_to\_fit();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00309}00309 values.shrink\_to\_fit();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00310}00310 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00311}00311 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00312}00312 \textcolor{keyword}{private}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00313}00313 \textcolor{keyword}{struct }inline\_node \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00314}00314 size\_type children[2];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00315}00315 size\_type parent;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00316}00316 size\_type val;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00317}00317 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00318}00318 std::vector storage;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00319}00319 std::vector values;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00320}00320 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00321}00321 \textcolor{keyword}{auto} do\_init() -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00322}00322 \textcolor{keywordflow}{if} (storage.size() < 2) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00323}00323 storage.resize(2);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00324}00324 storage[0] = \{\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00325}00325 storage[1] = \{\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00326}00326 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00327}00327 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00328}00328 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00329}00329 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} get\_storage\_node\_for(key\_type key) -\/> size\_type \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00330}00330 \textcolor{keywordflow}{if} (key.bits > bits\_of) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00331}00331 \textcolor{keywordflow}{throw} std::invalid\_argument(\textcolor{stringliteral}{"{}key prefix longer than key length"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00332}00332 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00333}00333 \textcolor{keyword}{const} bitset\_type search = key.prefix;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00334}00334 size\_type node = 1;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00335}00335 do\_init();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00336}00336 \textcolor{keywordflow}{for} (std::size\_t i : range(key.bits -\/ 1)) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00337}00337 \textcolor{keywordflow}{if} (\textcolor{keyword}{auto} n = storage[node].children[std::as\_const(search)[i]]) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00338}00338 node = n;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00339}00339 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00340}00340 storage.push\_back(\{\{0, 0\}, node, \mbox{\hyperlink{namespacekblib_1_1nums_a64067ecc4167ce1cfe32860ef5c1dc47}{max}}\});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00341}00341 node = \textcolor{keyword}{static\_cast<}size\_type\textcolor{keyword}{>}(storage.size() -\/ 1);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00342}00342 storage[node].children[std::as\_const(search)[i]] = node;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00343}00343 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00344}00344 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00345}00345 \textcolor{keywordflow}{return} node;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00346}00346 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00347}00347 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00348}00348 \textcolor{keyword}{public}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00349}00349 \textcolor{keyword}{template} <\textcolor{keyword}{typename} V>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00350}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{00350}} \textcolor{keyword}{class }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{iterator\_t}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00351}00351 \textcolor{keyword}{public}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00352}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a11d91fde461d01ffcbd9f1836fec510b}{00352}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a11d91fde461d01ffcbd9f1836fec510b}{value\_type}} = V;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00353}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a70457d6a335c09e08c40b4d5467ff885}{00353}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a70457d6a335c09e08c40b4d5467ff885}{pointer}} = V*;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00354}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a478bf75c5d269738278820a27705d02e}{00354}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a478bf75c5d269738278820a27705d02e}{reference}} = V\&;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00355}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a348a91b01f402aa032a64838b1ce9d87}{00355}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a348a91b01f402aa032a64838b1ce9d87}{difference\_type}} = \mbox{\hyperlink{classkblib_1_1compact__bit__trie_ab7fb4a6fd96e98dcb2574a1e5df2a969}{compact\_bit\_trie::difference\_type}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00356}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_ae329ad1e371830e12d1490f74602e5a4}{00356}} \textcolor{keyword}{using }\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_ae329ad1e371830e12d1490f74602e5a4}{iterator\_category}} = std::bidirectional\_iterator\_tag;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00357}00357 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00358}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a5445cd8a5bb4131404eb34ca0aacea2a}{00358}} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a5445cd8a5bb4131404eb34ca0aacea2a}{iterator\_t}}() = \textcolor{keywordflow}{default};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00359}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a15e3addc1e950ecb0bb9ab93229e381c}{00359}} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a15e3addc1e950ecb0bb9ab93229e381c}{iterator\_t}}(\textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie}{compact\_bit\_trie}}\& \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}})} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00360}00360 : tree\_ptr\{\&\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.storage\}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00361}00361 , values\_ptr\{\&\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.values\}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00362}00362 , node\{0\} \{\}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00363}00363 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00364}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_abaef27ed188929171dfd34d4e3e9e5b0}{00364}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_abaef27ed188929171dfd34d4e3e9e5b0}{operator*}}() const noexcept -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a478bf75c5d269738278820a27705d02e}{reference}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00365}00365 \textcolor{keywordflow}{return} (*values\_ptr)[(*tree\_ptr)[node].val];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00366}00366 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00367}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a55ee23904e192fe01639dd7552616f42}{00367}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a55ee23904e192fe01639dd7552616f42}{operator-\/>}}() const noexcept -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a70457d6a335c09e08c40b4d5467ff885}{pointer}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00368}00368 \textcolor{keywordflow}{return} std::addressof((*values\_ptr)[(*tree\_ptr)[node].val]);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00369}00369 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00370}\mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a94d707e0e6810730be6f2e7b5277a618}{00370}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t_a94d707e0e6810730be6f2e7b5277a618}{operator++}}() -\/> \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{iterator\_t}} \{\}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00371}00371 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00372}00372 \textcolor{keyword}{private}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00373}00373 \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{iterator\_t}}(\textcolor{keyword}{const} \mbox{\hyperlink{classkblib_1_1compact__bit__trie}{compact\_bit\_trie}}\& \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}, \mbox{\hyperlink{classkblib_1_1compact__bit__trie_a58c515648fcdd5be88e37667c65296a5}{size\_type}} n\_)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00374}00374 : \mbox{\hyperlink{classkblib_1_1compact__bit__trie_1_1iterator__t}{iterator\_t}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00375}00375 node = n\_;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00376}00376 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00377}00377 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00378}00378 \textcolor{keyword}{const} std::vector* tree\_ptr\{\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00379}00379 \textcolor{keyword}{const} std::vector* values\_ptr\{\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00380}00380 size\_type node\{\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00381}00381 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00382}00382 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00383}00383 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00394}\mbox{\hyperlink{namespacekblib_a240472ec40bbae42961817f5985de54e}{00394}} \textcolor{keyword}{constexpr} \textcolor{keyword}{inline} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a325b7ea3dc60a54c9b341e7851f94bcb}{memswap}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}* A, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}* B,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00395}00395 std::size\_t \mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}) \textcolor{keyword}{noexcept} -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00396}00396 \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} i : \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}(\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}})) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00397}00397 (\mbox{\hyperlink{namespacekblib_a4aadfdece3872e99551aa812ac3bac27}{swap}})(A[i], B[i]);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00398}00398 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00399}00399 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00400}00400 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00401}00401 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00412}\mbox{\hyperlink{namespacekblib_a325b7ea3dc60a54c9b341e7851f94bcb}{00412}} \textcolor{keyword}{inline} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a325b7ea3dc60a54c9b341e7851f94bcb}{memswap}}(\textcolor{keywordtype}{void}* A, \textcolor{keywordtype}{void}* B, std::size\_t \mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}) \textcolor{keyword}{noexcept} -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00413}00413 \textcolor{keyword}{auto} Ab = \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}*\textcolor{keyword}{>}(A);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00414}00414 \textcolor{keyword}{auto} Bb = \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}*\textcolor{keyword}{>}(B);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00415}00415 \mbox{\hyperlink{namespacekblib_a325b7ea3dc60a54c9b341e7851f94bcb}{memswap}}(Ab, Bb, \mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00416}00416 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00417}00417 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00418}00418 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00419}00419 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00420}00420 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00436}00436 \textcolor{keyword}{template} <\textcolor{keywordtype}{unsigned} offset, \textcolor{keywordtype}{unsigned} size, \textcolor{keyword}{typename} Storage>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00437}\mbox{\hyperlink{structkblib_1_1bitfield}{00437}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1bitfield}{bitfield}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00438}\mbox{\hyperlink{structkblib_1_1bitfield_a94ce5df7945a975c6a79245971ba0744}{00438}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1bitfield_a94ce5df7945a975c6a79245971ba0744}{operator()}}() const noexcept -\/> Storage \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00439}00439 \textcolor{keywordflow}{return} (\mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}() >> offset) \& ((1u << \mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}) -\/ 1);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00440}00440 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00441}\mbox{\hyperlink{structkblib_1_1bitfield_a4e37815a104b48dc55dca23414edaee0}{00441}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1bitfield_a4e37815a104b48dc55dca23414edaee0}{operator()}}(\textcolor{keyword}{const} Storage val) \textcolor{keyword}{noexcept} -\/> Storage \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00442}00442 \textcolor{comment}{// Clear the bits for this field}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00443}00443 \mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}() \&= \string~(((1u << \mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}) -\/ 1) << offset);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00444}00444 \textcolor{comment}{// Set the field}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00445}00445 \mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}() |= (val \& ((1u << \mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}) -\/ 1)) << offset;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00446}00446 \textcolor{keywordflow}{return} val;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00447}00447 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00448}\mbox{\hyperlink{structkblib_1_1bitfield_a0c8646d544a0fce41b183e7a52c45877}{00448}} \textcolor{keyword}{operator} Storage() const noexcept \{ \textcolor{keywordflow}{return} (*\textcolor{keyword}{this})(); \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00449}\mbox{\hyperlink{structkblib_1_1bitfield_afd301ce41a80fe9c2c48d3bd9d8c812e}{00449}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1bitfield_afd301ce41a80fe9c2c48d3bd9d8c812e}{operator=}}(Storage val) \textcolor{keyword}{noexcept} -\/> Storage \{ \textcolor{keywordflow}{return} (*\textcolor{keyword}{this})(val); \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00450}00450 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00451}00451 \textcolor{comment}{// allowed by pointer-\/interconvertibility when placed in a union}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00452}\mbox{\hyperlink{structkblib_1_1bitfield_a5dda3b597cf066223205c49ad684b851}{00452}} Storage\& \mbox{\hyperlink{structkblib_1_1bitfield_a5dda3b597cf066223205c49ad684b851}{get}}() noexcept \{ \textcolor{keywordflow}{return} *\textcolor{keyword}{reinterpret\_cast<}Storage*\textcolor{keyword}{>}(\textcolor{keyword}{this}); \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00453}\mbox{\hyperlink{structkblib_1_1bitfield_a0bb0d9b5548f5f0e8902ad7609b6ccea}{00453}} \textcolor{keyword}{const} Storage\& \mbox{\hyperlink{structkblib_1_1bitfield_a0bb0d9b5548f5f0e8902ad7609b6ccea}{get}}() const noexcept \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00454}00454 \textcolor{keywordflow}{return} *\textcolor{keyword}{reinterpret\_cast<}\textcolor{keyword}{const }Storage*\textcolor{keyword}{>}(\textcolor{keyword}{this});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00455}00455 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00456}00456 \textcolor{comment}{// ensure that there is an object for pointer-\/interconvertibility to find}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00457}\mbox{\hyperlink{structkblib_1_1bitfield_a18e4383e64f808396a4a9beaba1ec59c}{00457}} Storage \mbox{\hyperlink{structkblib_1_1bitfield_a18e4383e64f808396a4a9beaba1ec59c}{raw\_}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00458}00458 \textcolor{comment}{// Is this a good idea?}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00459}\mbox{\hyperlink{structkblib_1_1bitfield_a48836d3d35d8abb7b6747de63f417108}{00459}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1bitfield_a48836d3d35d8abb7b6747de63f417108}{operator\&}}() -\/> \textcolor{keywordtype}{void} = \textcolor{keyword}{delete};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00460}00460 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00461}00461 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00462}00462 \textcolor{keyword}{namespace }detail\_bits \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00463}00463 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00472}00472 \textcolor{keyword}{template} <\textcolor{keyword}{typename} Parent, \textcolor{keyword}{typename} ReturnT,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00473}00473 ReturnT (Parent::*Set)(ReturnT) \textcolor{keyword}{noexcept},} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00474}00474 ReturnT (Parent::*Get)() \textcolor{keyword}{const} \textcolor{keyword}{noexcept}>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00475}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1bitfield__proxy}{00475}} \textcolor{keyword}{struct} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1bitfield__proxy}{bitfield\_proxy}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00476}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1bitfield__proxy_a0359b15e0ac99a2ff9bb163ceee0ebd7}{00476}} Parent* \mbox{\hyperlink{structkblib_1_1detail__bits_1_1bitfield__proxy_a0359b15e0ac99a2ff9bb163ceee0ebd7}{p}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00477}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1bitfield__proxy_a78aa5db9aebbca25d7be249f4d616fbd}{00477}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1bitfield__proxy_a78aa5db9aebbca25d7be249f4d616fbd}{operator=}}(ReturnT val) \textcolor{keyword}{noexcept} -\/> ReturnT \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00478}00478 \textcolor{keywordflow}{return} (p-\/>*Set)(val);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00479}00479 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00480}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1bitfield__proxy_a12c97c9964d0eb641f333a08b372c087}{00480}} \textcolor{keyword}{constexpr} \textcolor{keyword}{operator} ReturnT() const noexcept \{ \textcolor{keywordflow}{return} (p-\/>*Get)(); \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00481}00481 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00482}00482 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00483}00483 \} \textcolor{comment}{// namespace detail\_bits}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00484}00484 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00491}\mbox{\hyperlink{bits_8h_ae6ae7d7c5a7d3a7ea2f7b94678ec3e1b}{00491}} \textcolor{preprocessor}{\#define KBLIB\_INTERNAL\_BITFIELD\_MACRO(offset, size, name, raw) \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00492}00492 \textcolor{preprocessor}{ static\_assert(offset >= 0 and size > 0, \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00493}00493 \textcolor{preprocessor}{ "{}BITFIELD cannot have negative offset or size"{}}); \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00494}00494 \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00495}00495 private: \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00496}00496 constexpr auto name\#\#\_get\_impl() const noexcept-\/>decltype(raw) \{ \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00497}00497 return (raw >> kblib::to\_unsigned(offset)) \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00498}00498 \& ((decltype(raw)(1) << kblib::to\_unsigned(size)) -\/ 1u); \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00499}00499 \} \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00500}00500 \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00501}00501 public: \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00502}00502 KBLIB\_NODISCARD constexpr auto name() const noexcept-\/>decltype(raw) \{ \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00503}00503 return name\#\#\_get\_impl(); \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00504}00504 \} \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00505}00505 \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00506}00506 private: \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00507}00507 constexpr auto name\#\#\_set\_impl(const decltype(raw) val) noexcept-\/>decltype( \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00508}00508 raw) \{ \(\backslash\)} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00509}00509 \textcolor{comment}{/* Clear the bits for this field */}\textcolor{preprocessor}{ \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00510}00510 \textcolor{preprocessor}{ raw \&= \string~(((decltype(raw)(1) << kblib::to\_unsigned(size)) -\/ 1u) \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00511}00511 \textcolor{preprocessor}{ << kblib::to\_unsigned(offset)); \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00512}00512 \textcolor{preprocessor}{ }\textcolor{comment}{/* Set the field */}\textcolor{preprocessor}{ \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00513}00513 \textcolor{preprocessor}{ raw |= (val \& ((decltype(raw)(1) << kblib::to\_unsigned(size)) -\/ 1u)) \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00514}00514 \textcolor{preprocessor}{ << kblib::to\_unsigned(offset); \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00515}00515 \textcolor{preprocessor}{ return val; \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00516}00516 \textcolor{preprocessor}{ \} \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00517}00517 \textcolor{preprocessor}{ \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00518}00518 \textcolor{preprocessor}{ public: \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00519}00519 \textcolor{preprocessor}{ constexpr auto name(const decltype(raw) val) noexcept-\/>decltype(raw) \{ \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00520}00520 \textcolor{preprocessor}{ return name\#\#\_set\_impl(val); \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00521}00521 \textcolor{preprocessor}{ \} \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00522}00522 \textcolor{preprocessor}{ \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00523}00523 \textcolor{preprocessor}{ KBLIB\_NODISCARD constexpr auto name() noexcept-\/>auto \{ \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00524}00524 \textcolor{preprocessor}{ using Parent = std::remove\_pointer::type; \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00525}00525 \textcolor{preprocessor}{ return kblib::detail\_bits::bitfield\_proxy\{ \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00528}00528 \textcolor{preprocessor}{ this\}; \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00529}00529 \textcolor{preprocessor}{ \} \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00530}00530 \textcolor{preprocessor}{ \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00531}00531 \textcolor{preprocessor}{ template \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00532}00532 \textcolor{preprocessor}{ constexpr static decltype(raw) set\_\#\#name\#\#\_v \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00533}00533 \textcolor{preprocessor}{ = (basis \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00534}00534 \textcolor{preprocessor}{ \& \string~(((decltype(raw)(1) << kblib::to\_unsigned(size)) -\/ 1u) \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00535}00535 \textcolor{preprocessor}{ << kblib::to\_unsigned(offset))) \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00536}00536 \textcolor{preprocessor}{ | (val \& ((decltype(raw)(1) << kblib::to\_unsigned(size)) -\/ 1u)) \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00537}00537 \textcolor{preprocessor}{ << kblib::to\_unsigned(offset); \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00538}00538 \textcolor{preprocessor}{ \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00539}00539 \textcolor{preprocessor}{ template \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00540}00540 \textcolor{preprocessor}{ constexpr static decltype(raw) get\_\#\#name\#\#\_v \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00541}00541 \textcolor{preprocessor}{ = (basis >> kblib::to\_unsigned(offset)) \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00542}00542 \textcolor{preprocessor}{ \& ((decltype(raw)(1) << kblib::to\_unsigned(size)) -\/ 1u); \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00543}00543 \textcolor{preprocessor}{ constexpr static std::size\_t name\#\#\_shift\_v = offset; \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00544}00544 \textcolor{preprocessor}{ constexpr static std::size\_t name\#\#\_width\_v = size;}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00545}00545 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00546}00546 \textcolor{keyword}{namespace }detail\_bits \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00547}00547 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00548}00548 \textcolor{keyword}{template} <\textcolor{keyword}{typename} Type, \textcolor{keyword}{typename} Storage>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00549}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{00549}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{pun\_proxy}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00550}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy_a6795332b630673938bb9a9ee1d9ffb66}{00550}} Storage\& \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy_a6795332b630673938bb9a9ee1d9ffb66}{base}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00551}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy_a3f21e1992cc75cf29faafb17f0e0d192}{00551}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy_a3f21e1992cc75cf29faafb17f0e0d192}{operator=}}(\textcolor{keyword}{const} Type val) \textcolor{keyword}{noexcept} -\/> \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{pun\_proxy}}\& \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00552}00552 std::memcpy(\&base, \&val, \textcolor{keyword}{sizeof} val);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00553}00553 \textcolor{keywordflow}{return} *\textcolor{keyword}{this};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00554}00554 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00555}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy_ae1faf257f851e5034397ddcd7d546fd3}{00555}} \textcolor{keyword}{operator} Type() const noexcept \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00556}00556 Type ret;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00557}00557 std::memcpy(\&ret, \&base, \textcolor{keyword}{sizeof} ret);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00558}00558 \textcolor{keywordflow}{return} ret;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00559}00559 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00560}00560 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00561}00561 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00562}00562 \textcolor{keyword}{template} <\textcolor{keyword}{typename} Type, \textcolor{keyword}{typename} Storage>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00563}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy}{00563}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy}{array\_pun\_proxy}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00564}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a9759fd73262d903fd0852201dc1556bc}{00564}} Storage\& \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a9759fd73262d903fd0852201dc1556bc}{base}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00565}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_ad4e3e70992679f4c9924ef85b5523bfb}{00565}} Type \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_ad4e3e70992679f4c9924ef85b5523bfb}{data}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00566}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a4256c0e4470692428d140c468944f387}{00566}} \textcolor{keywordtype}{bool} dirty = \textcolor{keyword}{false};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00567}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_ac5931fcb426014b21dcc863a501f9794}{00567}} \textcolor{keyword}{operator} Type\&() \textcolor{keyword}{noexcept} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00568}00568 \textcolor{keywordflow}{if} (dirty) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00569}00569 std::memcpy(\&base, \&data, \textcolor{keyword}{sizeof} data);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00570}00570 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00571}00571 dirty = \textcolor{keyword}{true};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00572}00572 \textcolor{keywordflow}{return} data;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00573}00573 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00574}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a60266f11b135a5c611f3924c2c2d7958}{00574}} \textcolor{keyword}{operator} \textcolor{keyword}{const} Type\&() \textcolor{keyword}{const} \textcolor{keyword}{noexcept} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00575}00575 \textcolor{keywordflow}{if} (dirty) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00576}00576 std::memcpy(\&base, \&data, \textcolor{keyword}{sizeof} data);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00577}00577 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00578}00578 \textcolor{keywordflow}{return} data;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00579}00579 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00580}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_aba649df8edce1e6c21b4b3cf5edd24cf}{00580}} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_aba649df8edce1e6c21b4b3cf5edd24cf}{\string~array\_pun\_proxy}}() \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00581}00581 \textcolor{keywordflow}{if} (dirty) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00582}00582 std::memcpy(\&base, \&data, \textcolor{keyword}{sizeof} data);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00583}00583 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00584}00584 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00585}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a7aac762082fd97fc3a8a82087ad03e10}{00585}} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a7aac762082fd97fc3a8a82087ad03e10}{array\_pun\_proxy}}(\textcolor{keyword}{const} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy}{array\_pun\_proxy}}\&) = \textcolor{keyword}{delete};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00586}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a668fb5c2e82c090f57f5995e0f21527b}{00586}} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a668fb5c2e82c090f57f5995e0f21527b}{array\_pun\_proxy}}(\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy}{array\_pun\_proxy}}\&\&) = \textcolor{keyword}{delete};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00587}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a4457b1a98958743894db9913975c520b}{00587}} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy}{array\_pun\_proxy}}\& \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a4457b1a98958743894db9913975c520b}{operator=}}(\textcolor{keyword}{const} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy}{array\_pun\_proxy}}\&) = \textcolor{keyword}{delete};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00588}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a6ae6b7ad33fbf407e1f88cb612b632a2}{00588}} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy}{array\_pun\_proxy}}\& \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy_a6ae6b7ad33fbf407e1f88cb612b632a2}{operator=}}(\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__pun__proxy}{array\_pun\_proxy}}\&\&) = \textcolor{keyword}{delete};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00589}00589 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00590}00590 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00591}00591 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00592}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter}{00592}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter}{array\_filter}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00593}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_abc807a7401335ec068b66d9dfea09b19}{00593}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_abc807a7401335ec068b66d9dfea09b19}{type}} = T;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00594}00594 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00595}00595 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T, std::\textcolor{keywordtype}{size\_t} N>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00596}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_3_01_t_0f_n_0e_4}{00596}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_3_01_t_0f_n_0e_4}{array\_filter}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00597}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_3_01_t_0f_n_0e_4_a3d9480c30a824f56762d223cbf761051}{00597}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_3_01_t_0f_n_0e_4_a3d9480c30a824f56762d223cbf761051}{type}} = std::array;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00598}00598 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00599}00599 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00600}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_3_01_t_0f_0e_4}{00600}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_3_01_t_0f_0e_4}{array\_filter}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00601}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_3_01_t_0f_0e_4_ab03bc2ebeb42a58b7c4446ff25226bf7}{00601}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_3_01_t_0f_0e_4_ab03bc2ebeb42a58b7c4446ff25226bf7}{type}} = std::array;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00602}00602 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00603}00603 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00604}00604 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T, std::\textcolor{keywordtype}{size\_t} S>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00605}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2}{00605}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2}{array\_filter2}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00606}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_a09cbc95418dc49431a323c5f8bc02c42}{00606}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_a09cbc95418dc49431a323c5f8bc02c42}{type}} = T;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00607}00607 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00608}00608 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T, std::\textcolor{keywordtype}{size\_t} N, std::\textcolor{keywordtype}{size\_t} S>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00609}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_3_01_t_0f_n_0e_00_01_s_01_4}{00609}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_3_01_t_0f_n_0e_00_01_s_01_4}{array\_filter2}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00610}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_3_01_t_0f_n_0e_00_01_s_01_4_a8aaaf6b9d72beaa93a84e0bfc43216a6}{00610}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_3_01_t_0f_n_0e_00_01_s_01_4_a8aaaf6b9d72beaa93a84e0bfc43216a6}{type}} = std::array;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00611}00611 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00612}00612 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T, std::\textcolor{keywordtype}{size\_t} S>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00613}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_3_01_t_0f_0e_00_01_s_01_4}{00613}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_3_01_t_0f_0e_00_01_s_01_4}{array\_filter2}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00614}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_3_01_t_0f_0e_00_01_s_01_4_afd4ba708b8b273fdc4600bbd019a1c56}{00614}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_3_01_t_0f_0e_00_01_s_01_4_afd4ba708b8b273fdc4600bbd019a1c56}{type}} = std::array;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00615}00615 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00616}00616 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00617}00617 \textcolor{keyword}{template} <\textcolor{keyword}{typename} P, \textcolor{keyword}{typename} Type, std::size\_t S, std::size\_t,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00618}00618 \textcolor{keywordtype}{bool} aliases} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00619}00619 = is\_aliasing\_type\_v::type>>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00620}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{00620}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{pun\_el}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00621}00621 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00622}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a3c07d6523ecefe3e17ade12eb5dc064d}{00622}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a3c07d6523ecefe3e17ade12eb5dc064d}{type}} = \textcolor{keyword}{typename} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter2_a09cbc95418dc49431a323c5f8bc02c42}{array\_filter2::type}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00623}00623 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00624}00624 \textcolor{keyword}{static\_assert}(std::is\_trivially\_copyable::value,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00625}00625 \textcolor{stringliteral}{"{}Type must be trivially copyable"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00626}00626 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00627}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a75e45c725fc8e09ecd6ece8fc5fa7353}{00627}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a75e45c725fc8e09ecd6ece8fc5fa7353}{get}}() noexcept -\/> auto \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00628}00628 \textcolor{keywordflow}{return} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{pun\_proxy}}<\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a3c07d6523ecefe3e17ade12eb5dc064d}{type}}, \textcolor{keyword}{decltype}(P::raw)>\{\textcolor{keyword}{static\_cast<}P*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>raw\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00629}00629 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00630}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a0269fffbb958d1d10f20e0eff69f03e1}{00630}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a0269fffbb958d1d10f20e0eff69f03e1}{get}}() const noexcept -\/> auto \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00631}00631 \textcolor{keywordflow}{return} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{pun\_proxy}}<\textcolor{keyword}{const} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a3c07d6523ecefe3e17ade12eb5dc064d}{type}}, \textcolor{keyword}{const} \textcolor{keyword}{decltype}(P::raw)>\{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00632}00632 \textcolor{keyword}{static\_cast<}\textcolor{keyword}{const }P*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>raw\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00633}00633 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00634}00634 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00635}00635 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00636}00636 \textcolor{keyword}{template} <\textcolor{keyword}{typename} P, \textcolor{keyword}{typename} Type, std::\textcolor{keywordtype}{size\_t} S, std::\textcolor{keywordtype}{size\_t} I>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00637}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_s_0e_00_01_s_00_01_i_00_01true_01_4}{00637}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{pun\_el}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00638}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_s_0e_00_01_s_00_01_i_00_01true_01_4_a37fa72cc02a3c5f7e918bc0b7c055ff0}{00638}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_s_0e_00_01_s_00_01_i_00_01true_01_4_a37fa72cc02a3c5f7e918bc0b7c055ff0}{type}} = Type[S];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00639}00639 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00640}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_s_0e_00_01_s_00_01_i_00_01true_01_4_a1ec3f265813495989f0a0fe752deb8c8}{00640}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_s_0e_00_01_s_00_01_i_00_01true_01_4_a1ec3f265813495989f0a0fe752deb8c8}{get}}() noexcept -\/> decltype(auto) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00641}00641 \textcolor{keywordflow}{return} \textcolor{keyword}{reinterpret\_cast<}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_s_0e_00_01_s_00_01_i_00_01true_01_4_a37fa72cc02a3c5f7e918bc0b7c055ff0}{type}}\&\textcolor{keyword}{>}(\textcolor{keyword}{static\_cast<}P*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>raw);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00642}00642 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00643}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_s_0e_00_01_s_00_01_i_00_01true_01_4_a47d1185effb83db8b056e0b52a012464}{00643}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_s_0e_00_01_s_00_01_i_00_01true_01_4_a47d1185effb83db8b056e0b52a012464}{get}}() const noexcept -\/> decltype(auto) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00644}00644 \textcolor{keywordflow}{return} \textcolor{keyword}{reinterpret\_cast<}\textcolor{keyword}{const }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_s_0e_00_01_s_00_01_i_00_01true_01_4_a37fa72cc02a3c5f7e918bc0b7c055ff0}{type}}\&\textcolor{keyword}{>}(\textcolor{keyword}{static\_cast<}\textcolor{keyword}{const }P*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>raw);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00645}00645 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00646}00646 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00647}00647 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00648}00648 \textcolor{keyword}{template} <\textcolor{keyword}{typename} P, \textcolor{keyword}{typename} Type, std::\textcolor{keywordtype}{size\_t} S, std::\textcolor{keywordtype}{size\_t} I>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00649}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_0e_00_01_s_00_01_i_00_01true_01_4}{00649}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{pun\_el}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00650}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_0e_00_01_s_00_01_i_00_01true_01_4_a23bfd07fc26e0c569db6cd4711f12c13}{00650}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_0e_00_01_s_00_01_i_00_01true_01_4_a23bfd07fc26e0c569db6cd4711f12c13}{type}} = Type[S];} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00651}00651 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00652}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_0e_00_01_s_00_01_i_00_01true_01_4_a6fc413ccf49c744ff131884eabc2d27e}{00652}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_0e_00_01_s_00_01_i_00_01true_01_4_a6fc413ccf49c744ff131884eabc2d27e}{get}}() noexcept -\/> decltype(auto) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00653}00653 \textcolor{keywordflow}{return} \textcolor{keyword}{reinterpret\_cast<}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_0e_00_01_s_00_01_i_00_01true_01_4_a23bfd07fc26e0c569db6cd4711f12c13}{type}}\&\textcolor{keyword}{>}(\textcolor{keyword}{static\_cast<}P*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>raw);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00654}00654 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00655}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_0e_00_01_s_00_01_i_00_01true_01_4_a01bbfabc6b10855063c5c006fa4cce4d}{00655}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_0e_00_01_s_00_01_i_00_01true_01_4_a01bbfabc6b10855063c5c006fa4cce4d}{get}}() const noexcept -\/> decltype(auto) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00656}00656 \textcolor{keywordflow}{return} \textcolor{keyword}{reinterpret\_cast<}\textcolor{keyword}{const }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_3_01_p_00_01_type_0f_0e_00_01_s_00_01_i_00_01true_01_4_a23bfd07fc26e0c569db6cd4711f12c13}{type}}\&\textcolor{keyword}{>}(\textcolor{keyword}{static\_cast<}\textcolor{keyword}{const }P*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>raw);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00657}00657 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00658}00658 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00659}00659 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00660}00660 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00661}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1punner__impl}{00661}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1punner__impl}{punner\_impl}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00662}00662 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00663}00663 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00664}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1punner__impl_3_01_s_00_01std_1_1index__sequence_3_01_is_8_8_8_01_4_00_01_types_8_8_8_01_4}{00664}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1punner__impl}{punner\_impl}}, Types...>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00665}00665 : \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{pun\_el}}, Types...>, Types, S,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00666}00666 Is>... \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00667}00667 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00668}00668 \textcolor{keyword}{alignas}(\mbox{\hyperlink{namespacekblib_1_1nums_a64067ecc4167ce1cfe32860ef5c1dc47}{std::max}}(\{\textcolor{keyword}{alignof}(\textcolor{keyword}{typename} std::remove\_extent<} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00669}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1punner__impl_3_01_s_00_01std_1_1index__sequence_3_01_is_8_8_8_01_4_00_01_types_8_8_8_01_4_a4768952cba75c6eec7ae1327a94f7589}{00669}} Types>::type)...\})) unsigned \textcolor{keywordtype}{char} raw[S]\{\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00670}00670 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00671}00671 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00672}00672 \textcolor{keyword}{template} <\textcolor{keyword}{typename}... Types>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00673}\mbox{\hyperlink{namespacekblib_1_1detail__bits_a1666832c0507e41b9943583f1c67938d}{00673}} \textcolor{keyword}{constexpr} std::size\_t \mbox{\hyperlink{namespacekblib_1_1detail__bits_a1666832c0507e41b9943583f1c67938d}{max\_size}}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00674}00674 = \mbox{\hyperlink{namespacekblib_1_1nums_a64067ecc4167ce1cfe32860ef5c1dc47}{std::max}}(\{\textcolor{keyword}{sizeof}(\textcolor{keyword}{typename} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1array__filter_abc807a7401335ec068b66d9dfea09b19}{array\_filter::type}})...\});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00675}00675 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00676}00676 \} \textcolor{comment}{// namespace detail\_bits}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00677}00677 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00678}00678 \textcolor{keyword}{template} <\textcolor{keyword}{typename}... Types>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00679}\mbox{\hyperlink{structkblib_1_1punner}{00679}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1punner}{punner}}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00680}00680 : \textcolor{keyword}{private} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1punner__impl}{detail\_bits::punner\_impl}},} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00681}00681 std::index\_sequence\_for,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00682}00682 Types...> \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00683}00683 \textcolor{keyword}{private}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00684}00684 \textcolor{keyword}{constexpr} \textcolor{keyword}{static} std::size\_t storage\_size = \mbox{\hyperlink{namespacekblib_1_1detail__bits_a1666832c0507e41b9943583f1c67938d}{detail\_bits::max\_size}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00685}00685 \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1punner__impl}{impl\_t}}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00686}00686 = \mbox{\hyperlink{structkblib_1_1detail__bits_1_1punner__impl}{detail\_bits::punner\_impl}}, Types...>;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00688}00688 \textcolor{keyword}{using }tuple\_t = std::tuple;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00689}00689 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00690}00690 \textcolor{keyword}{using }r\_element\_t = \textcolor{keyword}{typename} std::tuple\_element::type;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00691}00691 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00692}00692 \textcolor{keyword}{static\_assert}(std::is\_standard\_layout::value, \textcolor{stringliteral}{"{}"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00693}00693 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00694}00694 \textcolor{keyword}{public}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00695}00695 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00696}\mbox{\hyperlink{structkblib_1_1punner_a2f3304655dc864a32d86491414640252}{00696}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{base\_t}} = \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{detail\_bits::pun\_el}}, storage\_size, I>;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00697}00697 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00698}\mbox{\hyperlink{structkblib_1_1punner_a3216617468adf41427b8dd5bcd5629f2}{00698}} \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1punner_a3216617468adf41427b8dd5bcd5629f2}{element\_t}} = \textcolor{keyword}{typename} \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a3c07d6523ecefe3e17ade12eb5dc064d}{base\_t::type}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00699}00699 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00700}00700 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00701}\mbox{\hyperlink{structkblib_1_1punner_a2239fdbf6ac157757df3b599d0ee9f2b}{00701}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1punner_a2239fdbf6ac157757df3b599d0ee9f2b}{get}}() \& \textcolor{keyword}{noexcept} -\/> \textcolor{keyword}{decltype}(\textcolor{keyword}{auto}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00702}00702 \textcolor{keyword}{static\_assert}(std::is\_base\_of, \mbox{\hyperlink{structkblib_1_1detail__bits_1_1punner__impl}{impl\_t}}>::value, \textcolor{stringliteral}{"{}"{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00703}00703 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{base\_t}}\&\textcolor{keyword}{>}(*this).\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a75e45c725fc8e09ecd6ece8fc5fa7353}{get}}();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00704}00704 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00705}00705 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00706}\mbox{\hyperlink{structkblib_1_1punner_a3fb0452080aeff65a203965a10e6b079}{00706}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1punner_a3fb0452080aeff65a203965a10e6b079}{get}}() const\& noexcept -\/> decltype(auto) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00707}00707 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\textcolor{keyword}{const }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{base\_t}}\&\textcolor{keyword}{>}(*this).\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a75e45c725fc8e09ecd6ece8fc5fa7353}{get}}();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00708}00708 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00709}00709 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00710}\mbox{\hyperlink{structkblib_1_1punner_a22f961dac0119c334054478d457bed58}{00710}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1punner_a22f961dac0119c334054478d457bed58}{get}}() \&\& \textcolor{keyword}{noexcept} -\/> \textcolor{keyword}{decltype}(\textcolor{keyword}{auto}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00711}00711 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{base\_t}}\&\&\textcolor{keyword}{>}(*this).\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a75e45c725fc8e09ecd6ece8fc5fa7353}{get}}();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00712}00712 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00713}00713 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00714}\mbox{\hyperlink{structkblib_1_1punner_ae1e87ac1d684a043ed7348f65c714495}{00714}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1punner_ae1e87ac1d684a043ed7348f65c714495}{get}}() const\&\& noexcept -\/> decltype(auto) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00715}00715 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\textcolor{keyword}{const }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el}{base\_t}}\&\&\textcolor{keyword}{>}(*this).\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__el_a75e45c725fc8e09ecd6ece8fc5fa7353}{get}}();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00716}00716 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00717}00717 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00718}00718 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00719}00719 \} \textcolor{comment}{// namespace KBLIB\_NS}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00720}00720 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00721}\mbox{\hyperlink{namespacestd}{00721}} \textcolor{keyword}{namespace }\mbox{\hyperlink{namespacestd}{std}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00722}00722 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00723}00723 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00724}\mbox{\hyperlink{structstd_1_1tuple__element_3_01_i_00_01kblib_1_1punner_3_01_types_8_8_8_01_4_01_4}{00724}} \textcolor{keyword}{struct }tuple\_element> \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00725}\mbox{\hyperlink{structstd_1_1tuple__element_3_01_i_00_01kblib_1_1punner_3_01_types_8_8_8_01_4_01_4_af97e660fea7024ec2a83d37513df7c6f}{00725}} \textcolor{keyword}{using }\mbox{\hyperlink{structstd_1_1tuple__element_3_01_i_00_01kblib_1_1punner_3_01_types_8_8_8_01_4_01_4_af97e660fea7024ec2a83d37513df7c6f}{type}} = \textcolor{keyword}{typename} \mbox{\hyperlink{structkblib_1_1punner}{kblib::punner}}::template element\_t;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00726}00726 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00727}00727 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00728}00728 \textcolor{keyword}{template} <\textcolor{keyword}{typename}... Types>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00729}\mbox{\hyperlink{structstd_1_1tuple__size_3_01kblib_1_1punner_3_01_types_8_8_8_01_4_01_4}{00729}} \textcolor{keyword}{struct }tuple\_size<\mbox{\hyperlink{namespacekblib}{kblib}}::\mbox{\hyperlink{unionpunner}{punner}}>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00730}00730 : \textcolor{keyword}{public} std::integral\_constant \{\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00731}00731 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00732}00732 \} \textcolor{comment}{// namespace std}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00733}00733 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00734}00734 \textcolor{keyword}{namespace }\mbox{\hyperlink{tdecl_8h_a4b5c574c663a392148218cd4410fd7a1}{KBLIB\_NS}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00735}00735 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00736}00736 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00737}\mbox{\hyperlink{namespacekblib_a951945f1ed7d42562a7e6fa8cf8f0405}{00737}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}(\mbox{\hyperlink{structkblib_1_1punner}{punner}}\& p) \textcolor{keyword}{noexcept} -\/> \textcolor{keyword}{decltype}(\textcolor{keyword}{auto}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00738}00738 \textcolor{keywordflow}{return} p.template get();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00739}00739 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00740}00740 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00741}\mbox{\hyperlink{namespacekblib_ac224d3445c7dba280beacefc67b7641b}{00741}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}(\textcolor{keyword}{const} \mbox{\hyperlink{structkblib_1_1punner}{punner}}\& p) \textcolor{keyword}{noexcept} -\/> \textcolor{keyword}{decltype}(\textcolor{keyword}{auto}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00742}00742 \textcolor{keywordflow}{return} p.template get();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00743}00743 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00744}00744 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00745}\mbox{\hyperlink{namespacekblib_aeb5bc5882b32685b477723ff9b5d4642}{00745}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}(\mbox{\hyperlink{structkblib_1_1punner}{punner}}\&\& p) \textcolor{keyword}{noexcept} -\/> \textcolor{keyword}{decltype}(\textcolor{keyword}{auto}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00746}00746 \textcolor{keywordflow}{return} p.template get();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00747}00747 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00748}00748 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00749}\mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{00749}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_af291a0ebb9263d6588279eb0e379abc1}{get}}(\textcolor{keyword}{const} \mbox{\hyperlink{structkblib_1_1punner}{punner}}\&\& p) \textcolor{keyword}{noexcept}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00750}00750 -\/> \textcolor{keyword}{decltype}(\textcolor{keyword}{auto}) \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00751}00751 \textcolor{keywordflow}{return} p.template get();} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00752}00752 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00753}00753 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00754}00754 \textcolor{preprocessor}{\#if KBLIB\_USE\_CXX17}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00755}00755 \textcolor{keyword}{template} <\textcolor{keyword}{typename} Type, auto Storage>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00756}\mbox{\hyperlink{classkblib_1_1union__pun}{00756}} \textcolor{keyword}{class }\mbox{\hyperlink{classkblib_1_1union__pun}{union\_pun}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00757}00757 \textcolor{keyword}{private}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00758}00758 \textcolor{keyword}{using }sptr\_t = \textcolor{keyword}{decltype}(Storage);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00759}00759 \textcolor{keyword}{using }class\_t = kblib::class\_t;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00760}00760 \textcolor{keyword}{using }member\_t = \mbox{\hyperlink{namespacekblib_a8944b438ec39c111c64a1e8501fd7828}{kblib::member\_of\_t}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00761}00761 \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{proxy\_t}} = \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{detail\_bits::pun\_proxy}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00762}00762 \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{const\_proxy\_t}} = \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{detail\_bits::pun\_proxy}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00763}00763 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00764}00764 \textcolor{keyword}{static\_assert}(\textcolor{keyword}{sizeof}(Type) <= \textcolor{keyword}{sizeof}(member\_t),} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00765}00765 \textcolor{stringliteral}{"{}Type will not fit in the provided storage."{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00766}00766 \textcolor{keyword}{static\_assert}(std::is\_trivially\_copyable\_v,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00767}00767 \textcolor{stringliteral}{"{}Type must be trivially copyable."{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00768}00768 \textcolor{keyword}{static\_assert}(} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00769}00769 std::is\_trivially\_copyable\_v>,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00770}00770 \textcolor{stringliteral}{"{}Storage type must be trivially copyable."{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00771}00771 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00772}00772 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} base() \textcolor{keyword}{noexcept} -\/> member\_t\& \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00773}00773 \textcolor{keywordflow}{return} \textcolor{keyword}{reinterpret\_cast<}class\_t*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>*Storage;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00774}00774 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00775}00775 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} base() \textcolor{keyword}{const} \textcolor{keyword}{noexcept} -\/> \textcolor{keyword}{const} member\_t\& \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00776}00776 \textcolor{keywordflow}{return} \textcolor{keyword}{reinterpret\_cast<}\textcolor{keyword}{const }class\_t*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>*Storage;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00777}00777 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00778}00778 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00779}00779 \textcolor{keyword}{public}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00780}\mbox{\hyperlink{classkblib_1_1union__pun_ade0367e68af4e5093949428a766f8bf7}{00780}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1union__pun_ade0367e68af4e5093949428a766f8bf7}{operator()}}() const noexcept -\/> \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{const\_proxy\_t}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00781}00781 \textcolor{keywordflow}{return} \{base()\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00782}00782 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00783}\mbox{\hyperlink{classkblib_1_1union__pun_a1deda91c88c6f9ebbb80dea7c97d11f9}{00783}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1union__pun_a1deda91c88c6f9ebbb80dea7c97d11f9}{operator()}}(\textcolor{keyword}{const} Type val) \textcolor{keyword}{noexcept} -\/> \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{proxy\_t}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00784}00784 std::memcpy(\&base(), \&val, \textcolor{keyword}{sizeof} val);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00785}00785 \textcolor{keywordflow}{return} \{base()\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00786}00786 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00787}\mbox{\hyperlink{classkblib_1_1union__pun_a8c459942098cd37619a15624f14f6658}{00787}} \textcolor{keyword}{operator} Type() const noexcept \{ \textcolor{keywordflow}{return} (*\textcolor{keyword}{this})(); \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00788}\mbox{\hyperlink{classkblib_1_1union__pun_a2675b6877804247accd20bec2993dfbc}{00788}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1union__pun_a2675b6877804247accd20bec2993dfbc}{operator=}}(\textcolor{keyword}{const} Type val) \textcolor{keyword}{noexcept} -\/> \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{proxy\_t}} \{ \textcolor{keywordflow}{return} (*\textcolor{keyword}{this})(val); \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00789}00789 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00790}00790 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00791}00791 \textcolor{keyword}{template} <\textcolor{keyword}{typename} Type, std::\textcolor{keywordtype}{size\_t} N, auto Storage>} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00792}\mbox{\hyperlink{classkblib_1_1union__pun_3_01_type_0f_n_0e_00_01_storage_01_4}{00792}} \textcolor{keyword}{class }\mbox{\hyperlink{classkblib_1_1union__pun}{union\_pun}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00793}00793 \textcolor{keyword}{private}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00794}00794 \textcolor{keyword}{using }class\_t = kblib::class\_t;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00795}00795 \textcolor{keyword}{using }member\_t = kblib::member\_t;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00796}00796 \textcolor{keyword}{using }type = std::array;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00797}00797 \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{proxy\_t}} = \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{detail\_bits::pun\_proxy}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00798}00798 \textcolor{keyword}{using }\mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{const\_proxy\_t}} = \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{detail\_bits::pun\_proxy}};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00799}00799 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00800}00800 \textcolor{keyword}{static\_assert}(\textcolor{keyword}{sizeof}(type) <= \textcolor{keyword}{sizeof}(member\_t),} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00801}00801 \textcolor{stringliteral}{"{}Type will not fit in the provided storage."{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00802}00802 \textcolor{keyword}{static\_assert}(std::is\_trivially\_copyable\_v,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00803}00803 \textcolor{stringliteral}{"{}Type must be trivially copyable."{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00804}00804 \textcolor{keyword}{static\_assert}(} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00805}00805 std::is\_trivially\_copyable\_v>,} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00806}00806 \textcolor{stringliteral}{"{}Storage type must be trivially copyable."{}});} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00807}00807 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00808}00808 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} base() \textcolor{keyword}{noexcept} -\/> member\_t\& \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00809}00809 \textcolor{keywordflow}{return} \textcolor{keyword}{reinterpret\_cast<}class\_t*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>*Storage;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00810}00810 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00811}00811 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} base() \textcolor{keyword}{const} \textcolor{keyword}{noexcept} -\/> \textcolor{keyword}{const} member\_t\& \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00812}00812 \textcolor{keywordflow}{return} \textcolor{keyword}{reinterpret\_cast<}\textcolor{keyword}{const }class\_t*\textcolor{keyword}{>}(\textcolor{keyword}{this})-\/>*Storage;} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00813}00813 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00814}00814 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00815}00815 \textcolor{keyword}{public}:} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00816}\mbox{\hyperlink{classkblib_1_1union__pun_3_01_type_0f_n_0e_00_01_storage_01_4_a4538124e8a9c52f2e66666e8f991ec52}{00816}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1union__pun_3_01_type_0f_n_0e_00_01_storage_01_4_a4538124e8a9c52f2e66666e8f991ec52}{operator()}}() const noexcept -\/> \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{const\_proxy\_t}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00817}00817 \textcolor{keywordflow}{return} \{base()\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00818}00818 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00819}\mbox{\hyperlink{classkblib_1_1union__pun_3_01_type_0f_n_0e_00_01_storage_01_4_aff9914b7dcaf1d66864f420e4c278258}{00819}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1union__pun_3_01_type_0f_n_0e_00_01_storage_01_4_aff9914b7dcaf1d66864f420e4c278258}{operator()}}(\textcolor{keyword}{const} Type (\&val)[N]) \textcolor{keyword}{noexcept} -\/> \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{proxy\_t}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00820}00820 std::memcpy(\&base(), \&val, \textcolor{keyword}{sizeof} val);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00821}00821 \textcolor{keywordflow}{return} \{base()\};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00822}00822 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00823}\mbox{\hyperlink{classkblib_1_1union__pun_3_01_type_0f_n_0e_00_01_storage_01_4_a8acca356bb7d62bfb206b1aa14eaa5c7}{00823}} \textcolor{keyword}{operator} type() const noexcept \{ \textcolor{keywordflow}{return} (*\textcolor{keyword}{this})(); \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00824}\mbox{\hyperlink{classkblib_1_1union__pun_3_01_type_0f_n_0e_00_01_storage_01_4_a79f72904d12b1e49e4bcd156b18aa87c}{00824}} \textcolor{keyword}{auto} \mbox{\hyperlink{classkblib_1_1union__pun_3_01_type_0f_n_0e_00_01_storage_01_4_a79f72904d12b1e49e4bcd156b18aa87c}{operator=}}(\textcolor{keyword}{const} Type (\&val)[N]) \textcolor{keyword}{noexcept} -\/> \mbox{\hyperlink{structkblib_1_1detail__bits_1_1pun__proxy}{proxy\_t}} \{} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00825}00825 \textcolor{keywordflow}{return} (*\textcolor{keyword}{this})(val);} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00826}00826 \}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00827}00827 \};} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00828}00828 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00829}00829 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00830}00830 \} \textcolor{comment}{// namespace KBLIB\_NS}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00831}00831 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00832}00832 \textcolor{preprocessor}{\#endif }\textcolor{comment}{// KBLIB\_BITS\_H}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00833}00833 } \DoxyCodeLine{\Hypertarget{bits_8h_source_l00834}00834 \textcolor{preprocessor}{\#if KBLIB\_DEF\_MACROS and not defined(BITFIELD)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00863}\mbox{\hyperlink{bits_8h_a15bd8019a95bdacddc1e0c896540fdba}{00863}} \textcolor{preprocessor}{\#define BITFIELD(offset, size, name, raw) \(\backslash\)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00864}00864 \textcolor{preprocessor}{ KBLIB\_INTERNAL\_BITFIELD\_MACRO(offset, size, name, raw)}} \DoxyCodeLine{\Hypertarget{bits_8h_source_l00865}00865 \textcolor{preprocessor}{\#endif }\textcolor{comment}{// KBLIB\_DEF\_MACROS and not defined(BITFIELD)}} \end{DoxyCode}