CPP-ARGON
4.0.0
Command-Line Argument Parser for C++20
Loading...
Searching...
No Matches
ranges.hpp
Go to the documentation of this file.
1
// Copyright (c) 2023-2026 Jakub Musiał
2
// This file is part of the CPP-ARGON project (https://github.com/SpectraL519/cpp-argon).
3
// Licensed under the MIT License. See the LICENSE file in the project root for full license information.
4
10
#pragma once
11
12
#include "
argon/util/concepts.hpp
"
13
14
#include <any>
15
#include <ranges>
16
17
namespace
argon::util
{
18
27
template
<
typename
T>
28
constexpr
auto
any_range_cast_view
(
const
c_range_of<std::any>
auto
& range) {
29
return
range | std::views::transform([](
const
std::any& value) -> T {
30
return
std::any_cast<T>(value);
31
});
32
}
33
34
}
// namespace argon::util
argon::util::c_range_of
Validates that R is a range of type T (ignoring the cvref qualifiers).
Definition
concepts.hpp:138
argon::util::any_range_cast_view
constexpr auto any_range_cast_view(const c_range_of< std::any > auto &range)
Casts a range of std::any to a range of type T.
Definition
ranges.hpp:28
argon::util
Definition
concepts.hpp:17
concepts.hpp
Provides the general concept definitions.
include
argon
util
ranges.hpp
Generated on Thu Jan 1 2026 for CPP-ARGON by
1.9.8