CPP-AP 3.0.1
Command-line argument parser for C++20
Loading...
Searching...
No Matches
ranges.hpp
Go to the documentation of this file.
1// Copyright (c) 2023-2025 Jakub MusiaƂ
2// This file is part of the CPP-AP project (https://github.com/SpectraL519/cpp-ap).
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 "concepts.hpp"
13
14#include <any>
15#include <ranges>
16
17namespace ap::util {
18
27template <typename T>
29 return range | std::views::transform([](const std::any& value) -> T {
30 return std::any_cast<T>(value);
31 });
32}
33
34} // namespace ap::util
Validates that R is a range of type T (ignoring the cvref qualifiers).
Definition concepts.hpp:138
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
Provides the general concept definitions.