\hypertarget{iterators_8cpp_source}{}\doxysection{iterators.\+cpp}
\label{iterators_8cpp_source}\index{tests/iterators.cpp@{tests/iterators.cpp}}
\mbox{\hyperlink{iterators_8cpp}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00001}00001 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{iterators_8h}{kblib/iterators.h}}"{}}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00002}00002 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{build_8h}{kblib/build.h}}"{}}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00003}00003 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00004}00004 \textcolor{preprocessor}{\#include "{}catch.hpp"{}}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00005}00005 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00006}00006 \textcolor{preprocessor}{\#include <iterator>}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00007}00007 \textcolor{preprocessor}{\#include <list>}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00008}00008 \textcolor{preprocessor}{\#include <set>}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00009}00009 \textcolor{preprocessor}{\#include <sstream>}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00010}00010 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00011}\mbox{\hyperlink{iterators_8cpp_a3820a144b30c7da4173c6677fcd80a76}{00011}} \mbox{\hyperlink{iterators_8cpp_a3820a144b30c7da4173c6677fcd80a76}{TEST\_CASE}}(\textcolor{stringliteral}{"{}to\_pointer"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00012}00012    \textcolor{keyword}{auto} smart\_ptr = std::make\_unique<int>(0);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00013}00013    \textcolor{keyword}{auto}* raw\_pointer = \mbox{\hyperlink{namespacekblib_a1c2aa67048789f77bea56734a583d3d1}{kblib::to\_pointer}}(smart\_ptr);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00014}00014    CHECK(raw\_pointer == smart\_ptr.get());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00015}00015    \textcolor{keyword}{const} \textcolor{keyword}{auto}\& smart\_ptr\_const\_ref = smart\_ptr;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00016}00016    \textcolor{keyword}{auto}* raw\_pointer2 = \mbox{\hyperlink{namespacekblib_a1c2aa67048789f77bea56734a583d3d1}{kblib::to\_pointer}}(smart\_ptr\_const\_ref);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00017}00017    CHECK(raw\_pointer2 == smart\_ptr\_const\_ref.get());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00018}00018 \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00019}00019 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00020}\mbox{\hyperlink{iterators_8cpp_a3d83c949874b96b4320fba77b9ce4a86}{00020}} \mbox{\hyperlink{iterators_8cpp_a3820a144b30c7da4173c6677fcd80a76}{TEST\_CASE}}(\textcolor{stringliteral}{"{}range"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00021}00021    \textcolor{comment}{// range supports iterators and other similar types.}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00022}00022    std::vector<int> v(100);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00023}00023    CHECK(v.begin() == *\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(v.begin(), v.end()).begin());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00024}00024    CHECK(v.end() == *\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(v.begin(), v.end()).end());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00025}00025 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00026}00026    std::vector<int> r\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00027}00027    \textcolor{keyword}{auto} r2 = \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00028}00028    CHECK(r.size() == r2.size());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00029}00029    CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{std::equal}}(r.begin(), r.end(), r2.begin()));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00030}00030    CHECK(r2[0] == 0);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00031}00031    CHECK(r2[9] == 9);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00032}00032    CHECK(r2[-\/1] == -\/1);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00033}00033    SECTION(\textcolor{stringliteral}{"{}size"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00034}00034       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10, 1).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 10);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00035}00035       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 10);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00036}00036       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10, 2).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 5);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00037}00037       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 1).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 1);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00038}00038       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 0).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 0);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00039}00039       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 0, 1).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 0);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00041}00041       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 20, 1).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 10);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00042}00042       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 20, 2).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 5);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00043}00043       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 11).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 1);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00044}00044       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 10).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 0);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00045}00045       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 10, 1).\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}}() == 0);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00046}00046    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00047}00047    SECTION(\textcolor{stringliteral}{"{}empty"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00048}00048       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 0, 1).empty());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00049}00049       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 0, 2).empty());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00050}00050       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 10).empty());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00052}00052       CHECK(not \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10, 1).empty());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00053}00053       CHECK(not \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10, 2).empty());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00054}00054    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00055}00055 \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00057}\mbox{\hyperlink{iterators_8cpp_a340a2fded0e5a500997b2dae417dcbd5}{00057}} \mbox{\hyperlink{iterators_8cpp_a3820a144b30c7da4173c6677fcd80a76}{TEST\_CASE}}(\textcolor{stringliteral}{"{}range conversion"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00058}00058    SECTION(\textcolor{stringliteral}{"{}vector"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00059}00059       \textcolor{keyword}{auto} r = \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(2, 5);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00060}00060       \textcolor{keyword}{auto} v = std::vector<int>(r);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00061}00061       CHECK(v.size() == r.size());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00062}00062       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{std::equal}}(v.begin(), v.end(), r.begin()));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00063}00063    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00064}00064    SECTION(\textcolor{stringliteral}{"{}string"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00065}00065       \textcolor{keyword}{auto} r = \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(+\textcolor{charliteral}{'a'}, \textcolor{charliteral}{'z'} + 1);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00066}00066       \textcolor{keyword}{auto} v = std::string(r);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00067}00067       CHECK(v == \textcolor{stringliteral}{"{}abcdefghijklmnopqrstuvwxyz"{}});}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00068}00068       CHECK(v.size() == r.size());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00069}00069       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{std::equal}}(v.begin(), v.end(), r.begin()));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00070}00070    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00071}00071    \textcolor{keyword}{auto} x = std::set<int>(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00072}00072 \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00074}\mbox{\hyperlink{iterators_8cpp_aebcacd1e0ff73bc445cf431876ce56c1}{00074}} \mbox{\hyperlink{iterators_8cpp_a3820a144b30c7da4173c6677fcd80a76}{TEST\_CASE}}(\textcolor{stringliteral}{"{}range comparison"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00075}00075    \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}} = [](\textcolor{keyword}{auto} r1, \textcolor{keyword}{auto} r2) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00076}00076       \textcolor{keyword}{auto} r1b = r1.begin();}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00077}00077       \textcolor{keyword}{auto} r1e = r1.end();}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00078}00078       \textcolor{keyword}{auto} r2b = r2.begin();}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00079}00079       \textcolor{keyword}{auto} r2e = r2.end();}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00080}00080       \textcolor{keywordflow}{return} std::distance(r1b, r1e) == std::distance(r2b, r2e)}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00081}00081              and \mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{kblib::equal}}(r1b, r1e, r2b);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00082}00082    \};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00084}00084    SECTION(\textcolor{stringliteral}{"{}equivalency"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00086}00086       \textcolor{keyword}{auto} target10 = std::vector<int>\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00087}00087       \textcolor{keyword}{auto} target10m = std::vector<int>\{0, -\/1, -\/2, -\/3, -\/4, -\/5, -\/6, -\/7, -\/8, -\/9\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00088}00088       \textcolor{keyword}{auto} target10r = std::vector<int>\{10, 9, 8, 7, 6, 5, 4, 3, 2, 1\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00090}00090       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10), target10));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00091}00091       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10), target10));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00092}00092       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10, \mbox{\hyperlink{structkblib_1_1incrementer}{kblib::incrementer}}\{\}), target10));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00094}00094       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10, 2), std::vector<int>\{0, 2, 4, 6, 8\}));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00096}00096       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 0, -\/1), target10r));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00097}00097       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 0, \mbox{\hyperlink{structkblib_1_1decrementer}{kblib::decrementer}}\{\}), target10r));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00099}00099       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, -\/10, -\/1), target10m));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00100}00100       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, -\/10), target10m));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00101}00101 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00102}00102       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 11, 2), \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 12, 2)));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00103}00103    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00105}00105    SECTION(\textcolor{stringliteral}{"{}comparisons"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00107}00107       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 0, 1) == \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(1, 1, 2));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00108}00108       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(100, 100, 1) == \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 0, 2));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00109}00109       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10) != \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 0));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00110}00110       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 11, 2) != \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 10, 2));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00111}00111       CHECK(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 0, 1) != \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(0, 1, 2));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00112}00112    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00114}00114    SECTION(\textcolor{stringliteral}{"{}buildiota equivalency"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00115}00115       \textcolor{keyword}{auto} l = kblib::buildiota<std::list<int>>(10u, 10, -\/1);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00116}00116       CHECK(\mbox{\hyperlink{namespacekblib_afbec3807c1be9d0aea88c620d673823c}{equal}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(10, 0, -\/1), l));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00117}00117    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00118}00118 \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00120}\mbox{\hyperlink{iterators_8cpp_a8e76962f8c23b94b729653327a7cd6be}{00120}} \mbox{\hyperlink{iterators_8cpp_a3820a144b30c7da4173c6677fcd80a76}{TEST\_CASE}}(\textcolor{stringliteral}{"{}range from iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00121}00121    std::string str = \textcolor{stringliteral}{"{}abcdefghijklmnopqrstuvwxyz"{}};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00122}00122    \textcolor{comment}{// Just asserting that this loop compiles.}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00123}00123    \textcolor{keywordflow}{for} ([[gnu::unused]] std::string::iterator c :}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00124}00124         \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(str.begin(), str.end())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00125}00125    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00126}00126 \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00128}\mbox{\hyperlink{iterators_8cpp_a5372fa871a632b705a6791864517d5b3}{00128}} \mbox{\hyperlink{iterators_8cpp_a3820a144b30c7da4173c6677fcd80a76}{TEST\_CASE}}(\textcolor{stringliteral}{"{}ranges overflow"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00129}00129    \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} c\{\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00130}00130    \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} i : \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{kblib::range}}(\textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}\textcolor{keyword}{>}(255))) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00131}00131       c = i;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00132}00132    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00133}00133    CHECK(c == 254);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00134}00134 \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00136}00136 \textcolor{preprocessor}{\#if KBLIB\_USE\_CXX17}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00138}\mbox{\hyperlink{iterators_8cpp_a6d7a578f86bb96decd0a91ea6dfbc1b5}{00138}} \mbox{\hyperlink{iterators_8cpp_a3820a144b30c7da4173c6677fcd80a76}{TEST\_CASE}}(\textcolor{stringliteral}{"{}magic\_enumerate"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00139}00139    std::vector<int> persistent\{0, 1, 1, 2, 3, 5, 8\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00140}00140    SECTION(\textcolor{stringliteral}{"{}lvalue"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00141}00141       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00142}00142          REQUIRE(\&v == \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00143}00143       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00144}00144    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00145}00145    SECTION(\textcolor{stringliteral}{"{}non-\/forwarding lvalue"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00146}00146       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\& [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00147}00147          REQUIRE(\&v == \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00148}00148       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00149}00149    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00150}00150    SECTION(\textcolor{stringliteral}{"{}copy"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00151}00151       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00152}00152          REQUIRE(v == persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00153}00153          REQUIRE(\&v != \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00154}00154       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00155}00155    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00157}00157    SECTION(\textcolor{stringliteral}{"{}const lvalue"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00158}00158       \textcolor{keyword}{const} \textcolor{keyword}{auto}\& cp = persistent;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00159}00159       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(cp)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00160}00160          REQUIRE(\&v == \&cp[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00161}00161          \textcolor{keyword}{static\_assert}(std::is\_const\_v<\mbox{\hyperlink{namespacekblib_a4be602e9cbe25a984f76f7a66a0466cd}{std::remove\_reference\_t}}<\textcolor{keyword}{decltype}(v)>>,}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00162}00162                        \textcolor{stringliteral}{"{}v must refer to const when the range is const"{}});}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00163}00163       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00164}00164    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00165}00165    SECTION(\textcolor{stringliteral}{"{}const reference"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00166}00166       \textcolor{keywordflow}{for} (\textcolor{keyword}{const} \textcolor{keyword}{auto}\& [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00167}00167          REQUIRE(\&v == \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00168}00168          \textcolor{keyword}{static\_assert}(}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00169}00169              std::is\_const\_v<\mbox{\hyperlink{namespacekblib_a4be602e9cbe25a984f76f7a66a0466cd}{std::remove\_reference\_t}}<\textcolor{keyword}{decltype}(v)>>,}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00170}00170              \textcolor{stringliteral}{"{}v must refer to const when the bound reference is const"{}});}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00171}00171       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00172}00172    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00173}00173    SECTION(\textcolor{stringliteral}{"{}copy from const"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00174}00174       \textcolor{keyword}{const} \textcolor{keyword}{auto}\& cp = persistent;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00175}00175       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(cp)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00176}00176          REQUIRE(v == persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00177}00177          REQUIRE(\&v != \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00178}00178          \textcolor{keyword}{static\_assert}(}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00179}00179              not std::is\_const\_v<\mbox{\hyperlink{namespacekblib_a4be602e9cbe25a984f76f7a66a0466cd}{std::remove\_reference\_t}}<\textcolor{keyword}{decltype}(v)>>,}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00180}00180              \textcolor{stringliteral}{"{}v must not be const when copied from a const range"{}});}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00181}00181       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00182}00182    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00183}00183    SECTION(\textcolor{stringliteral}{"{}const copy from non-\/const"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00184}00184 \textcolor{preprocessor}{\#  if defined(\_\_clang\_\_)}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00185}00185       \textcolor{comment}{// Suppress warning for intentional behavior}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00186}00186 \textcolor{preprocessor}{\#     pragma clang diagnostic push}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00187}00187 \textcolor{preprocessor}{\#     pragma clang diagnostic ignored "{}-\/Wrange-\/loop-\/analysis"{}}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00188}00188 \textcolor{preprocessor}{\#  endif}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00189}00189       \textcolor{keywordflow}{for} (\textcolor{keyword}{const} \textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00190}00190          REQUIRE(v == persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00191}00191          REQUIRE(\&v != \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00192}00192          \textcolor{keyword}{static\_assert}(std::is\_const\_v<\mbox{\hyperlink{namespacekblib_a4be602e9cbe25a984f76f7a66a0466cd}{std::remove\_reference\_t}}<\textcolor{keyword}{decltype}(v)>>,}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00193}00193                        \textcolor{stringliteral}{"{}v must refer to const in a const copy"{}});}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00194}00194       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00195}00195 \textcolor{preprocessor}{\#  if defined(\_\_clang\_\_)}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00196}00196 \textcolor{preprocessor}{\#     pragma clang diagnostic pop}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00197}00197 \textcolor{preprocessor}{\#  endif}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00198}00198    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00200}00200    SECTION(\textcolor{stringliteral}{"{}iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00201}00201       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] :}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00202}00202            \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(persistent.cbegin(), persistent.cend())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00203}00203          REQUIRE(\&v == \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00204}00204       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00205}00205    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00206}00206    SECTION(\textcolor{stringliteral}{"{}mutable iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00207}00207       std::vector<int> \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}\{0, 1, 2, 3, 4, 5, 6, 7\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00208}00208       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.begin(), \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.end())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00209}00209          v = 0;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00210}00210       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00211}00211       REQUIRE(\mbox{\hyperlink{namespacekblib_ab437bea5ac232c0a681f8bb1d3754170}{std::all\_of}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.begin(), \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.end(),}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00212}00212                           [](\textcolor{keywordtype}{int} v) \{ return v == 0; \}));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00213}00213    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00214}00214    SECTION(\textcolor{stringliteral}{"{}reverse iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00215}00215       std::vector<int> reversed\{7, 6, 5, 4, 3, 2, 1, 0\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00216}00216       \textcolor{keywordtype}{int} last = -\/1;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00217}00217       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] :}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00218}00218            \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(reversed.rbegin(), reversed.rend())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00219}00219          REQUIRE(v == \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00220}00220          ++v;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00221}00221          last = v;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00222}00222       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00223}00223       REQUIRE(last == reversed.front());}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00224}00224    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00226}00226    SECTION(\textcolor{stringliteral}{"{}temporary"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00227}00227       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] :}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00228}00228            \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(std::vector<int>(persistent))) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00229}00229          REQUIRE(v == persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00230}00230          REQUIRE(\&v != \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00231}00231       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00232}00232    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00233}00233    SECTION(\textcolor{stringliteral}{"{}input iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00234}00234       std::istringstream is\{\textcolor{stringliteral}{"{}0 0 1 1 2 2 3 3 4 4 5 5 6 6"{}}\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00235}00235       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00236}00236                std::istream\_iterator<int>(is), std::istream\_iterator<int>())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00237}00237          REQUIRE(v == \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i) / 2);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00238}00238       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00239}00239    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00240}00240    SECTION(\textcolor{stringliteral}{"{}copied input iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00241}00241       std::istringstream is\{\textcolor{stringliteral}{"{}0 0 1 1 2 2 3 3 4 4 5 5 6 6"{}}\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00242}00242       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(std::istream\_iterator<int>(is),}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00243}00243                                                 std::istream\_iterator<int>())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00244}00244          REQUIRE(v == \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i) / 2);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00245}00245       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00246}00246    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00248}00248    SECTION(\textcolor{stringliteral}{"{}move-\/only"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00249}00249       std::vector<std::unique\_ptr<int>> ptr\_vec(10);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00250}00250       \textcolor{keywordflow}{for} ([[maybe\_unused]] \textcolor{keyword}{auto}\&\& [i, ptr] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(ptr\_vec)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00251}00251          REQUIRE(not ptr);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00252}00252       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00253}00253    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00255}00255    SECTION(\textcolor{stringliteral}{"{}array"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00256}00256       \textcolor{keywordtype}{int} arr[5] = \{0, 1, 2, 3, 4\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00257}00257       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(arr)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00258}00258          REQUIRE(\&arr[i] != \&v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00259}00259          REQUIRE(\textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i) == v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00260}00260          REQUIRE(arr[i] == v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00261}00261          ++v;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00262}00262          REQUIRE(arr[i] != v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00263}00263       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00264}00264    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00265}00265 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00266}00266    SECTION(\textcolor{stringliteral}{"{}array by ref"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00267}00267       \textcolor{keywordtype}{int} arr[5] = \{0, 1, 2, 3, 4\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00268}00268       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\& [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(arr)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00269}00269          REQUIRE(\&arr[i] == \&v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00270}00270       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00271}00271    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00273}00273    SECTION(\textcolor{stringliteral}{"{}array by const ref"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00274}00274       \textcolor{keywordtype}{int} arr[5] = \{0, 1, 2, 3, 4\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00275}00275       \textcolor{keywordflow}{for} (\textcolor{keyword}{const} \textcolor{keyword}{auto}\& [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(arr)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00276}00276          REQUIRE(\&arr[i] == \&v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00277}00277       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00278}00278    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00279}00279 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00280}00280    SECTION(\textcolor{stringliteral}{"{}array by forwarding ref"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00281}00281       \textcolor{keywordtype}{int} arr[5] = \{0, 1, 2, 3, 4\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00282}00282       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a0084bbd67ea381c6954c3d82c3cd0691}{kblib::magic\_enumerate}}(arr)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00283}00283          REQUIRE(\&arr[i] == \&v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00284}00284       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00285}00285    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00286}00286 \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00288}\mbox{\hyperlink{iterators_8cpp_a7fe37c538066db7ba43add09b6907c49}{00288}} \mbox{\hyperlink{iterators_8cpp_a3820a144b30c7da4173c6677fcd80a76}{TEST\_CASE}}(\textcolor{stringliteral}{"{}cry\_enumerate"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00289}00289    std::vector<int> persistent\{0, 1, 1, 2, 3, 5, 8\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00290}00290    SECTION(\textcolor{stringliteral}{"{}lvalue"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00291}00291       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00292}00292          REQUIRE(v == persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00293}00293          REQUIRE(\&v == \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00294}00294       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00295}00295    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00296}00296    SECTION(\textcolor{stringliteral}{"{}non-\/forwarding lvalue"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00297}00297       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00298}00298          REQUIRE(\&v == \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00299}00299       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00300}00300    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00301}00301    SECTION(\textcolor{stringliteral}{"{}copy"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00302}00302       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00303}00303          REQUIRE(v == persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00304}00304          REQUIRE(\&v != \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00305}00305       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00306}00306    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00307}00307 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00308}00308    SECTION(\textcolor{stringliteral}{"{}const lvalue"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00309}00309       \textcolor{keyword}{const} \textcolor{keyword}{auto}\& cp = persistent;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00310}00310       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(cp)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00311}00311          REQUIRE(\&v == \&cp[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00312}00312          \textcolor{keyword}{static\_assert}(}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00313}00313              std::is\_const<}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00314}00314                  \textcolor{keyword}{typename} std::remove\_reference<\textcolor{keyword}{decltype}(v)>::type>::value,}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00315}00315              \textcolor{stringliteral}{"{}v must refer to const when the range is const"{}});}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00316}00316       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00317}00317    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00318}00318    SECTION(\textcolor{stringliteral}{"{}const reference"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00319}00319       \textcolor{keywordflow}{for} (\textcolor{keyword}{const} \textcolor{keyword}{auto}\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00320}00320          REQUIRE(\&v == \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00321}00321          \textcolor{keyword}{static\_assert}(}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00322}00322              std::is\_const<}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00323}00323                  \textcolor{keyword}{typename} std::remove\_reference<\textcolor{keyword}{decltype}(v)>::type>::value,}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00324}00324              \textcolor{stringliteral}{"{}v must refer to const when the bound reference is const"{}});}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00325}00325       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00326}00326    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00327}00327    SECTION(\textcolor{stringliteral}{"{}copy from const"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00328}00328       \textcolor{keyword}{const} \textcolor{keyword}{auto}\& cp = persistent;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00329}00329       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(cp)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00330}00330          REQUIRE(v == persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00331}00331          REQUIRE(\&v != \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00332}00332          \textcolor{comment}{// This approach can't do this}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00333}00333          \textcolor{comment}{/*static\_assert(}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00334}00334 \textcolor{comment}{             not std::is\_const<}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00335}00335 \textcolor{comment}{                 typename std::remove\_reference<decltype(v)>::type>::value,}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00336}00336 \textcolor{comment}{             "{}v must not be const when copied from a const range"{});*/}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00337}00337       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00338}00338    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00339}00339    SECTION(\textcolor{stringliteral}{"{}const copy from non-\/const"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00340}00340 \textcolor{preprocessor}{\#  if defined(\_\_clang\_\_)}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00341}00341       \textcolor{comment}{// Suppress warning for intentional behavior}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00342}00342 \textcolor{preprocessor}{\#     pragma clang diagnostic push}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00343}00343 \textcolor{preprocessor}{\#     pragma clang diagnostic ignored "{}-\/Wrange-\/loop-\/analysis"{}}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00344}00344 \textcolor{preprocessor}{\#  endif}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00345}00345       \textcolor{keywordflow}{for} (\textcolor{keyword}{const} \textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(persistent)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00346}00346          REQUIRE(v == persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00347}00347          REQUIRE(\&v != \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00348}00348          \textcolor{keyword}{static\_assert}(}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00349}00349              std::is\_const<}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00350}00350                  \textcolor{keyword}{typename} std::remove\_reference<\textcolor{keyword}{decltype}(v)>::type>::value,}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00351}00351              \textcolor{stringliteral}{"{}v must refer to const in a const copy"{}});}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00352}00352       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00353}00353 \textcolor{preprocessor}{\#  if defined(\_\_clang\_\_)}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00354}00354 \textcolor{preprocessor}{\#     pragma clang diagnostic pop}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00355}00355 \textcolor{preprocessor}{\#  endif}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00356}00356    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00357}00357 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00358}00358    SECTION(\textcolor{stringliteral}{"{}iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00359}00359       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] :}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00360}00360            \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(persistent.cbegin(), persistent.cend())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00361}00361          REQUIRE(\&v == \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00362}00362       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00363}00363    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00364}00364    SECTION(\textcolor{stringliteral}{"{}mutable iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00365}00365       std::vector<int> \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}\{0, 1, 2, 3, 4, 5, 6, 7\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00366}00366       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.begin(), \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.end())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00367}00367          v = 0;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00368}00368       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00369}00369       REQUIRE(\mbox{\hyperlink{namespacekblib_ab437bea5ac232c0a681f8bb1d3754170}{std::all\_of}}(\mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.begin(), \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}.end(),}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00370}00370                           [](\textcolor{keywordtype}{int} v) \{ return v == 0; \}));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00371}00371    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00372}00372    SECTION(\textcolor{stringliteral}{"{}reverse iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00373}00373       std::vector<int> reversed\{7, 6, 5, 4, 3, 2, 1, 0\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00374}00374       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] :}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00375}00375            \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(reversed.rbegin(), reversed.rend())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00376}00376          REQUIRE(v == \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i));}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00377}00377       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00378}00378    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00380}00380    SECTION(\textcolor{stringliteral}{"{}temporary"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00381}00381       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(std::vector<int>(persistent))) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00382}00382          REQUIRE(v == persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00383}00383          REQUIRE(\&v != \&persistent[i]);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00384}00384       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00385}00385    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00386}00386    SECTION(\textcolor{stringliteral}{"{}input iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00387}00387       std::istringstream is\{\textcolor{stringliteral}{"{}0 0 1 1 2 2 3 3 4 4 5 5 6 6"{}}\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00388}00388       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(std::istream\_iterator<int>(is),}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00389}00389                                                 std::istream\_iterator<int>())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00390}00390          REQUIRE(v == \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i) / 2);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00391}00391       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00392}00392    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00393}00393    SECTION(\textcolor{stringliteral}{"{}copied input iterators"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00394}00394       std::istringstream is\{\textcolor{stringliteral}{"{}0 0 1 1 2 2 3 3 4 4 5 5 6 6"{}}\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00395}00395       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(std::istream\_iterator<int>(is),}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00396}00396                                               std::istream\_iterator<int>())) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00397}00397          REQUIRE(v == \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i) / 2);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00398}00398       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00399}00399    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00400}00400 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00401}00401    SECTION(\textcolor{stringliteral}{"{}move-\/only"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00402}00402       std::vector<std::unique\_ptr<int>> ptr\_vec(10);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00403}00403       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, ptr] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(ptr\_vec)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00404}00404          (void)i;}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00405}00405       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00406}00406    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00407}00407 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00408}00408    SECTION(\textcolor{stringliteral}{"{}array"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00409}00409       \textcolor{keywordtype}{int} arr[5] = \{0, 1, 2, 3, 4\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00410}00410       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(arr)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00411}00411          REQUIRE(\textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i) == v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00412}00412       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00413}00413    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00414}00414 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00415}00415    SECTION(\textcolor{stringliteral}{"{}array by ref"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00416}00416       \textcolor{keywordtype}{int} arr[5] = \{0, 1, 2, 3, 4\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00417}00417       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(arr)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00418}00418          REQUIRE(\textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i) == v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00419}00419       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00420}00420    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00422}00422    SECTION(\textcolor{stringliteral}{"{}array by const ref"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00423}00423       \textcolor{keywordtype}{int} arr[5] = \{0, 1, 2, 3, 4\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00424}00424       \textcolor{keywordflow}{for} (\textcolor{keyword}{const} \textcolor{keyword}{auto}\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(arr)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00425}00425          REQUIRE(\textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i) == v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00426}00426       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00427}00427    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00428}00428 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00429}00429    SECTION(\textcolor{stringliteral}{"{}array by forwarding ref"{}}) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00430}00430       \textcolor{keywordtype}{int} arr[5] = \{0, 1, 2, 3, 4\};}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00431}00431       \textcolor{keywordflow}{for} (\textcolor{keyword}{auto}\&\& [i, v] : \mbox{\hyperlink{namespacekblib_a679258c0b7423a4175f9ba848da99d96}{kblib::cry\_enumerate}}(arr)) \{}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00432}00432          REQUIRE(\textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{int}\textcolor{keyword}{>}(i) == v);}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00433}00433       \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00434}00434    \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00435}00435 \}}
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00436}00436 }
\DoxyCodeLine{\Hypertarget{iterators_8cpp_source_l00437}00437 \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
