arg_router
1.4.0
C++ command line argument parsing and routing
description.hpp
1
// Copyright (C) 2022 by Camden Mannett.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5
#pragma once
6
7
#include "arg_router/policy/policy.hpp"
8
9
namespace
arg_router::policy
10
{
22
template
<
typename
S>
23
class
description_t
24
{
25
public
:
27
using
string_type
= S;
28
33
constexpr
explicit
description_t
([[maybe_unused]] S str = {}) noexcept {}
34
39
[[nodiscard]] constexpr
static
std::string_view
description
() noexcept {
return
S::get(); }
40
41
private
:
42
static_assert(!
description
().empty(),
"Descriptions must not be empty"
);
43
};
44
49
template
<
typename
S>
50
constexpr
auto
description
=
description_t<S>
{};
51
52
template
<
typename
T>
53
struct
is_policy<description_t<T>> : std::true_type {
54
};
55
}
// namespace arg_router::policy
arg_router::policy::description_t
Definition:
description.hpp:24
arg_router::policy::description_t::description_t
constexpr description_t([[maybe_unused]] S str={}) noexcept
Definition:
description.hpp:33
arg_router::policy::description_t::description
constexpr static std::string_view description() noexcept
Definition:
description.hpp:39
arg_router::policy::description_t::string_type
S string_type
Definition:
description.hpp:27
arg_router::policy
Definition:
alias.hpp:15
arg_router::policy::description
constexpr auto description
Definition:
description.hpp:50
arg_router
policy
description.hpp
Generated by
1.9.1