\hypertarget{fakestd_8h_source}{}\doxysection{fakestd.\+h}
\label{fakestd_8h_source}\index{kblib/fakestd.h@{kblib/fakestd.h}}
\mbox{\hyperlink{fakestd_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00001}00001 \textcolor{comment}{/* *****************************************************************************}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00002}00002 \textcolor{comment}{ * kblib is a general utility library for C++14 and C++17, intended to provide}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00003}00003 \textcolor{comment}{ * performant high-\/level abstractions and more expressive ways to do simple}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00004}00004 \textcolor{comment}{ * things.}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 2021 killerbee}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00008}00008 \textcolor{comment}{ * This program is free software: you can redistribute it and/or modify}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00009}00009 \textcolor{comment}{ * it under the terms of the GNU General Public License as published by}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00010}00010 \textcolor{comment}{ * the Free Software Foundation, either version 3 of the License, or}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00011}00011 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00013}00013 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00014}00014 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00015}00015 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00016}00016 \textcolor{comment}{ * GNU General Public License for more details.}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00017}00017 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00018}00018 \textcolor{comment}{ * You should have received a copy of the GNU General Public License}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00019}00019 \textcolor{comment}{ * along with this program. If not, see .}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00020}00020 \textcolor{comment}{ * ****************************************************************************/}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00021}00021 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00032}00032 \textcolor{preprocessor}{\#ifndef KBLIB\_FAKESTD\_H}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00033}00033 \textcolor{preprocessor}{\#define KBLIB\_FAKESTD\_H}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00035}00035 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{tdecl_8h}{tdecl.h}}"{}}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00037}00037 \textcolor{preprocessor}{\#include }}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00038}00038 \textcolor{preprocessor}{\#include }}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00039}00039 \textcolor{preprocessor}{\#include }}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00040}00040 \textcolor{preprocessor}{\#include }}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00041}00041 \textcolor{preprocessor}{\#include }}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00043}00043 \textcolor{preprocessor}{\#if \_\_has\_include("{}gsl/pointers"{}})}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00044}00044 \textcolor{preprocessor}{\# include "{}gsl/pointers"{}}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00045}00045 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00047}00047 \textcolor{preprocessor}{\#ifndef KBLIB\_FAKESTD}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00048}\mbox{\hyperlink{fakestd_8h_a1bd1bd94076a0a71cc107c28805209fd}{00048}} \textcolor{preprocessor}{\# define KBLIB\_FAKESTD (\_\_cplusplus < 201703L)}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00049}00049 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00051}00051 \textcolor{keyword}{namespace }\mbox{\hyperlink{tdecl_8h_a4b5c574c663a392148218cd4410fd7a1}{KBLIB\_NS}} \{}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00053}00053 \textcolor{preprocessor}{\#if \_\_has\_include("{}gsl/pointers"{}})}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00054}00054 \textcolor{keyword}{using }\mbox{\hyperlink{namespacekblib_a71909c4e14de14b43b7179d2ccb490e8}{gsl::owner}};}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00055}00055 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00056}00056 template ::value>>}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00057}\mbox{\hyperlink{namespacekblib_a71909c4e14de14b43b7179d2ccb490e8}{00057}} \textcolor{keyword}{using }\mbox{\hyperlink{namespacekblib_a71909c4e14de14b43b7179d2ccb490e8}{owner}} = T;}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00058}00058 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00060}00060 \textcolor{keyword}{template} <\textcolor{keywordtype}{bool} B, \textcolor{keyword}{typename} T = \textcolor{keywordtype}{void}>}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00061}\mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{00061}} \textcolor{keyword}{using }\mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t}} = \textcolor{keyword}{typename} std::enable\_if::type;}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00063}00063 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00064}\mbox{\hyperlink{namespacekblib_a9dcf2233bc360ff26fbbf82d98cdc64d}{00064}} \textcolor{keyword}{using }\mbox{\hyperlink{namespacekblib_a9dcf2233bc360ff26fbbf82d98cdc64d}{decay\_t}} = \textcolor{keyword}{typename} std::decay::type;}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00066}00066 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00067}\mbox{\hyperlink{namespacekblib_ad3067cf43d6c4d6d61e9bbb81c145cf9}{00067}} \textcolor{keyword}{using }\mbox{\hyperlink{namespacekblib_ad3067cf43d6c4d6d61e9bbb81c145cf9}{remove\_cvref\_t}} =}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00068}00068 \textcolor{keyword}{typename} std::remove\_reference::type>::type;}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00070}00070 \textcolor{keyword}{template} <\textcolor{keywordtype}{bool} v>}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00071}\mbox{\hyperlink{namespacekblib_aab6846d277428f1e4b61ced2ed64dd0b}{00071}} \textcolor{keyword}{using }\mbox{\hyperlink{namespacekblib_aab6846d277428f1e4b61ced2ed64dd0b}{bool\_constant}} = std::integral\_constant;}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00073}00073 \textcolor{preprocessor}{\#if \_\_cpp\_lib\_constexpr\_functional}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00074}00074 \textcolor{keyword}{using }\mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{std::invoke}};}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00075}00075 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00077}00077 \textcolor{preprocessor}{\# if \_\_cpp\_lib\_apply}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00079}00079 \textcolor{keyword}{template} <\textcolor{keyword}{typename} F, \textcolor{keyword}{typename}... Args>}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00080}00080 \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{invoke}}(F\&\& f, Args\&\&... args) \textcolor{keyword}{noexcept}(\textcolor{keyword}{noexcept}(\mbox{\hyperlink{namespacekblib_a3873199be1651ec4e0fda92171b2b82c}{std::apply}}(}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00081}00081 std::forward(f), std::forward\_as\_tuple(std::forward(args)...))))}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00082}00082 -\/> \textcolor{keyword}{decltype}(\textcolor{keyword}{auto}) \{}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00083}00083 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_a3873199be1651ec4e0fda92171b2b82c}{std::apply}}(std::forward(f),}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00084}00084 std::forward\_as\_tuple(std::forward(args)...));}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00085}00085 \}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00087}00087 \textcolor{preprocessor}{\# else}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00089}00089 \textcolor{keyword}{namespace }detail \{}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00091}00091 \textcolor{keyword}{template} <\textcolor{keyword}{typename} F, \textcolor{keyword}{typename}... Args,}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00092}00092 enable\_if\_t>::value,}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00093}00093 \textcolor{keywordtype}{int}> = 0>}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00094}\mbox{\hyperlink{namespacekblib_1_1detail_a9fcbe60cc8d89d741dc327bee247fbcb}{00094}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail_a9be193ea0038cdf6bec7cef4173f2d77}{do\_invoke}}(F\&\& f, Args\&\&... args) \textcolor{keyword}{noexcept}(\textcolor{keyword}{noexcept}(}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00095}00095 std::forward(f)(std::forward(args)...))) -\/> \textcolor{keyword}{decltype}(\textcolor{keyword}{auto}) \{}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00096}00096 \textcolor{keywordflow}{return} std::forward(f)(std::forward(args)...);}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00097}00097 \}}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00099}00099 \textcolor{keyword}{template} <\textcolor{keyword}{typename} F, \textcolor{keyword}{typename} Object, \textcolor{keyword}{typename}... Args,}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00100}00100 \mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t}}>::value}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00101}00101 and std::is\_member\_function\_pointer::value,}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00102}00102 \textcolor{keywordtype}{int}> = 0>}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00103}\mbox{\hyperlink{namespacekblib_1_1detail_a3814b2a778b24c77c5b25f0ba6ee517a}{00103}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail_a9be193ea0038cdf6bec7cef4173f2d77}{do\_invoke}}(F f, Object\&\& obj, Args\&\&... args) \textcolor{keyword}{noexcept}(}
\DoxyCodeLine{\Hypertarget{fakestd_8h_source_l00104}00104 \textcolor{keyword}{noexcept}((std::forward