From 8955328479189c3f67b04fdb84d182aee23905fc Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 6 Apr 2017 17:45:50 -0700 Subject: [PATCH] ircd::util: Add basic STL map transformation functors. --- include/ircd/util.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/ircd/util.h b/include/ircd/util.h index 023a1193c..40622ae40 100644 --- a/include/ircd/util.h +++ b/include/ircd/util.h @@ -559,6 +559,29 @@ at(It &&start, } +// +// Some functors for STL +// + +template +struct keys +{ + auto &operator()(typename container::reference v) const + { + return v.first; + } +}; + +template +struct values +{ + auto &operator()(typename container::reference v) const + { + return v.second; + } +}; + + // // Customized std::string_view (experimental TS / C++17) //