arg_router  1.4.0
C++ command line argument parsing and routing
basic_types.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/config.hpp"
8 
9 #include <sstream>
10 #include <vector>
11 
12 #if __cplusplus >= 202000L
13 # include <span>
14 #else
15 # define span_CONFIG_CONTRACT_LEVEL_OFF
16 # include <nonstd/span.hpp>
17 #endif
18 
19 namespace arg_router
20 {
25 using string = std::basic_string<char, std::char_traits<char>, config::allocator<char>>;
26 
32  std::basic_ostringstream<char, std::char_traits<char>, config::allocator<char>>;
33 
38 template <typename T>
39 using vector = std::vector<T, config::allocator<T>>;
40 
44 #if __cplusplus >= 202000L
45 template <typename T, auto Extent = std::dynamic_extent>
46 using span = std::span<T, Extent>;
47 #else
48 template <typename T, auto Extent = nonstd::span_lite::dynamic_extent>
49 using span = nonstd::span_lite::span<T, Extent>;
50 #endif
51 } // namespace arg_router
std::allocator< T > allocator
Definition: config.hpp:70
std::vector< T, config::allocator< T > > vector
Definition: basic_types.hpp:39
std::basic_ostringstream< char, std::char_traits< char >, config::allocator< char > > ostringstream
Definition: basic_types.hpp:32
nonstd::span_lite::span< T, Extent > span
Definition: basic_types.hpp:49