CPP-AP 3.0.1
Command-line argument parser for C++20
Loading...
Searching...
No Matches
types.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 "ap/util/concepts.hpp"
13
14#include <functional>
15
16namespace ap::action_type {
17
24struct observe {
25 template <ap::util::c_argument_value_type T>
26 using type = std::function<void(const T&)>;
27};
28
35struct transform {
36 template <ap::util::c_argument_value_type T>
37 using type = std::function<T(const T&)>;
38};
39
46struct modify {
47 template <ap::util::c_argument_value_type T>
48 using type = std::function<void(T&)>;
49};
50
59struct on_flag {
60 using type = std::function<void()>;
61};
62
63} // namespace ap::action_type
A modifying value action specifier.
Definition types.hpp:46
std::function< void(T &)> type
Definition types.hpp:48
An observing value action specifier.
Definition types.hpp:24
std::function< void(const T &)> type
Definition types.hpp:26
An on-flag action specifier.
Definition types.hpp:59
std::function< void()> type
Definition types.hpp:60
A transformating value action specifier.
Definition types.hpp:35
std::function< T(const T &)> type
Definition types.hpp:37
Provides the general concept definitions.