arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::policy::program_version_t< S > Class Template Reference

#include <arg_router/policy/program_version.hpp>

Public Types

using string_type = S
 

Public Member Functions

constexpr program_version_t ([[maybe_unused]] S str={}) noexcept
 

Static Public Member Functions

constexpr static std::string_view program_version () noexcept
 

Detailed Description

template<typename S>
class arg_router::policy::program_version_t< S >

Represents the program version string.

Used by help nodes to produce their output, though in principle can be used by anything that wants to.

If using C++17 then use the template variable helper with the S_ macro; for C++20 and higher, use the constructor directly with a compile-time string literal:

constexpr auto a = ar::policy::program_version<S_("hello")>;
constexpr auto b = ar::policy::program_version_t{"hello"_S};
#define S_(tok)
Template Parameters
SCompile-time string

Definition at line 25 of file program_version.hpp.

Member Typedef Documentation

◆ string_type

template<typename S >
using arg_router::policy::program_version_t< S >::string_type = S

String type.

Definition at line 29 of file program_version.hpp.

Constructor & Destructor Documentation

◆ program_version_t()

template<typename S >
constexpr arg_router::policy::program_version_t< S >::program_version_t ( [[maybe_unused] ] S  str = {})
inlineexplicitconstexprnoexcept

Constructor.

Parameters
strString instance

Definition at line 35 of file program_version.hpp.

Member Function Documentation

◆ program_version()

template<typename S >
constexpr static std::string_view arg_router::policy::program_version_t< S >::program_version ( )
inlinestaticconstexprnoexcept

Returns the program version.

Returns
Program version

Definition at line 41 of file program_version.hpp.


The documentation for this class was generated from the following file: