arg_router
1.4.0
C++ command line argument parsing and routing
display_name.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
{
28
template
<
typename
S>
29
class
display_name_t
30
{
31
public
:
33
using
string_type
= S;
34
39
constexpr
explicit
display_name_t
([[maybe_unused]] S str = {}) noexcept {}
40
45
[[nodiscard]] constexpr
static
std::string_view
display_name
() noexcept {
return
S::get(); }
46
47
private
:
48
static_assert(!
display_name
().empty(),
"Display name must not be empty"
);
49
};
50
55
template
<
typename
S>
56
constexpr
auto
display_name
=
display_name_t<S>
{};
57
58
template
<
typename
S>
59
struct
is_policy<display_name_t<S>> : std::true_type {
60
};
61
}
// namespace arg_router::policy
arg_router::policy::display_name_t
Definition:
display_name.hpp:30
arg_router::policy::display_name_t::display_name_t
constexpr display_name_t([[maybe_unused]] S str={}) noexcept
Definition:
display_name.hpp:39
arg_router::policy::display_name_t::string_type
S string_type
Definition:
display_name.hpp:33
arg_router::policy::display_name_t::display_name
constexpr static std::string_view display_name() noexcept
Definition:
display_name.hpp:45
arg_router::policy
Definition:
alias.hpp:15
arg_router::policy::display_name
constexpr auto display_name
Definition:
display_name.hpp:56
arg_router
policy
display_name.hpp
Generated by
1.9.1