mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-22 02:45:07 -04:00
erpt: update for 11.0.0 (closes #1218)
This commit is contained in:
parent
bba99d49da
commit
6da28f4a27
24 changed files with 438 additions and 146 deletions
47
libraries/libvapours/include/vapours/util/util_range.hpp
Normal file
47
libraries/libvapours/include/vapours/util/util_range.hpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include <vapours/common.hpp>
|
||||
#include <vapours/assert.hpp>
|
||||
|
||||
namespace ams::util::range {
|
||||
|
||||
template<typename T, typename F>
|
||||
constexpr bool any_of(T &&t, F &&f) {
|
||||
return std::any_of(std::begin(t), std::end(t), std::forward<F>(f));
|
||||
}
|
||||
|
||||
template<typename T, typename F>
|
||||
constexpr bool all_of(T &&t, F &&f) {
|
||||
return std::all_of(std::begin(t), std::end(t), std::forward<F>(f));
|
||||
}
|
||||
|
||||
template<typename T, typename F>
|
||||
constexpr bool none_of(T &&t, F &&f) {
|
||||
return std::none_of(std::begin(t), std::end(t), std::forward<F>(f));
|
||||
}
|
||||
|
||||
template<typename T, typename F>
|
||||
constexpr auto find_if(T &&t, F &&f) {
|
||||
return std::find_if(std::begin(t), std::end(t), std::forward<F>(f));
|
||||
}
|
||||
|
||||
template<typename T, typename F>
|
||||
constexpr auto for_each(T &&t, F &&f) {
|
||||
return std::for_each(std::begin(t), std::end(t), std::forward<F>(f));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue