mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd::util: Add basic STL map transformation functors.
This commit is contained in:
parent
229a222ff6
commit
8955328479
1 changed files with 23 additions and 0 deletions
|
@ -559,6 +559,29 @@ at(It &&start,
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// Some functors for STL
|
||||
//
|
||||
|
||||
template<class container>
|
||||
struct keys
|
||||
{
|
||||
auto &operator()(typename container::reference v) const
|
||||
{
|
||||
return v.first;
|
||||
}
|
||||
};
|
||||
|
||||
template<class container>
|
||||
struct values
|
||||
{
|
||||
auto &operator()(typename container::reference v) const
|
||||
{
|
||||
return v.second;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Customized std::string_view (experimental TS / C++17)
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue