From 01549ba676f6d17b3bb9d6a46e78e98f967ca18a Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Sat, 26 Aug 2023 17:17:59 +0200 Subject: [PATCH] New view: filter_by_currency --- include/views.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/views.hpp b/include/views.hpp index 3e85a0c..2e1d9c7 100644 --- a/include/views.hpp +++ b/include/views.hpp @@ -228,6 +228,10 @@ inline auto filter_by_type(std::string_view type) { return std::views::filter([type] (const auto & element) { return element.type == type; }); } +inline auto filter_by_currency(std::string_view currency) { + return std::views::filter([currency] (const auto & element) { return element.currency == currency; }); +} + inline auto filter_by_name(std::string_view name) { return std::views::filter([name] (const auto & account) { return account.name == name; }); }