Namespaces | Macros | Functions
string_view.hpp File Reference
#include <algorithm>
#include <cassert>
#include <iterator>
#include <limits>
#include <ostream>
#include <stdexcept>
#include <string>
Include dependency graph for string_view.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 nonstd
 
 nonstd::sv_lite
 

Macros

#define NONSTD_SV_LITE_H_INCLUDED
 
#define nssv_BETWEEN(v, lo, hi)   ((lo) <= (v) && (v) < (hi))
 
#define nssv_COMPILER_CLANG_VERSION   0
 
#define nssv_COMPILER_GNUC_VERSION   0
 
#define nssv_COMPILER_MSVC_VER   0
 
#define nssv_COMPILER_MSVC_VERSION   0
 
#define nssv_COMPILER_VERSION(major, minor, patch)   (10 * (10 * major + minor) + patch)
 
#define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS   1
 
#define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS   1
 
#define nssv_CONFIG_SELECT_STRING_VIEW   (nssv_HAVE_STD_STRING_VIEW ? nssv_STRING_VIEW_STD : nssv_STRING_VIEW_NONSTD)
 
#define nssv_CONFIG_STD_SV_OPERATOR   0
 
#define nssv_CONFIG_USR_SV_OPERATOR   1
 
#define nssv_constexpr   /*constexpr*/
 
#define nssv_constexpr14   /*constexpr*/
 
#define nssv_CPLUSPLUS   __cplusplus
 
#define nssv_CPP11_100   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1600)
 
#define nssv_CPP11_110   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1700)
 
#define nssv_CPP11_120   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1800)
 
#define nssv_CPP11_140   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1900)
 
#define nssv_CPP11_141   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1910)
 
#define nssv_CPP11_90   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1500)
 
#define nssv_CPP11_OR_GREATER   (nssv_CPLUSPLUS >= 201103L)
 
#define nssv_CPP11_OR_GREATER_   (nssv_CPLUSPLUS >= 201103L)
 
#define nssv_CPP14_000   (nssv_CPP14_OR_GREATER)
 
#define nssv_CPP14_OR_GREATER   (nssv_CPLUSPLUS >= 201402L)
 
#define nssv_CPP17_000   (nssv_CPP17_OR_GREATER)
 
#define nssv_CPP17_OR_GREATER   (nssv_CPLUSPLUS >= 201703L)
 
#define nssv_CPP20_OR_GREATER   (nssv_CPLUSPLUS >= 202000L)
 
#define nssv_CPP98_OR_GREATER   (nssv_CPLUSPLUS >= 199711L)
 
#define nssv_DISABLE_MSVC_WARNINGS(codes)
 
#define nssv_explicit   /*explicit*/
 
#define nssv_HAS_CPP0X   0
 
#define nssv_HAVE_CONSTEXPR_11   nssv_CPP11_140
 
#define nssv_HAVE_CONSTEXPR_14   nssv_CPP14_000
 
#define nssv_HAVE_ENDS_WITH   nssv_HAVE_STARTS_WITH
 
#define nssv_HAVE_EXPLICIT_CONVERSION   nssv_CPP11_140
 
#define nssv_HAVE_INLINE_NAMESPACE   nssv_CPP11_140
 
#define nssv_HAVE_NODISCARD   nssv_CPP17_000
 
#define nssv_HAVE_NOEXCEPT   nssv_CPP11_140
 
#define nssv_HAVE_NULLPTR   nssv_CPP11_100
 
#define nssv_HAVE_REF_QUALIFIER   nssv_CPP11_140
 
#define nssv_HAVE_STARTS_WITH   (nssv_CPP20_OR_GREATER || !nssv_USES_STD_STRING_VIEW)
 
#define nssv_HAVE_STD_DEFINED_LITERALS   nssv_CPP11_140
 
#define nssv_HAVE_STD_HASH   nssv_CPP11_120
 
#define nssv_HAVE_STD_STRING_VIEW   0
 
#define nssv_HAVE_UNICODE_LITERALS   nssv_CPP11_140
 
#define nssv_HAVE_USER_DEFINED_LITERALS   nssv_CPP11_140
 
#define nssv_HAVE_WCHAR16_T   nssv_CPP11_100
 
#define nssv_HAVE_WCHAR32_T   nssv_CPP11_100
 
#define nssv_inline_ns   /*inline*/
 
#define nssv_nodiscard   /*[[nodiscard]]*/
 
#define nssv_noexcept   /*noexcept*/
 
#define nssv_nullptr   NULL
 
#define nssv_RESTORE_WARNINGS()
 
#define nssv_STRING_VIEW_DEFAULT   0
 
#define nssv_STRING_VIEW_NONSTD   1
 
#define nssv_STRING_VIEW_STD   2
 
#define nssv_STRINGIFY(x)   nssv_STRINGIFY_(x)
 
#define nssv_STRINGIFY_(x)   #x
 
#define nssv_SUPPRESS_MSGSL_WARNING(expr)
 
#define nssv_SUPPRESS_MSVC_WARNING(code, descr)
 
#define nssv_USES_STD_STRING_VIEW
 
#define string_view_lite_MAJOR   1
 
#define string_view_lite_MINOR   1
 
#define string_view_lite_PATCH   0
 
#define string_view_lite_VERSION
 

Functions

 nssv_DISABLE_MSVC_WARNINGS (4455 26481 26472) namespace nonstd
 
template<class CharT , class Traits >
std::basic_string< CharT, Traits > nonstd::sv_lite::to_string (basic_string_view< CharT, Traits > v)
 
template<class CharT , class Traits , class Allocator >
std::basic_string< CharT, Traits, Allocator > nonstd::sv_lite::to_string (basic_string_view< CharT, Traits > v, Allocator const &a)
 
template<class CharT , class Traits , class Allocator >
basic_string_view< CharT, Traits > nonstd::sv_lite::to_string_view (std::basic_string< CharT, Traits, Allocator > const &s)
 

Macro Definition Documentation

◆ NONSTD_SV_LITE_H_INCLUDED

#define NONSTD_SV_LITE_H_INCLUDED

Definition at line 12 of file string_view.hpp.

◆ nssv_BETWEEN

#define nssv_BETWEEN (   v,
  lo,
  hi 
)    ((lo) <= (v) && (v) < (hi))

Definition at line 232 of file string_view.hpp.

◆ nssv_COMPILER_CLANG_VERSION

#define nssv_COMPILER_CLANG_VERSION   0

Definition at line 221 of file string_view.hpp.

◆ nssv_COMPILER_GNUC_VERSION

#define nssv_COMPILER_GNUC_VERSION   0

Definition at line 228 of file string_view.hpp.

◆ nssv_COMPILER_MSVC_VER

#define nssv_COMPILER_MSVC_VER   0

Definition at line 211 of file string_view.hpp.

◆ nssv_COMPILER_MSVC_VERSION

#define nssv_COMPILER_MSVC_VERSION   0

Definition at line 212 of file string_view.hpp.

◆ nssv_COMPILER_VERSION

#define nssv_COMPILER_VERSION (   major,
  minor,
  patch 
)    (10 * (10 * major + minor) + patch)

Definition at line 215 of file string_view.hpp.

◆ nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS

#define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS   1

Definition at line 55 of file string_view.hpp.

◆ nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS

#define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS   1

Definition at line 59 of file string_view.hpp.

◆ nssv_CONFIG_SELECT_STRING_VIEW

#define nssv_CONFIG_SELECT_STRING_VIEW   (nssv_HAVE_STD_STRING_VIEW ? nssv_STRING_VIEW_STD : nssv_STRING_VIEW_NONSTD)

Definition at line 32 of file string_view.hpp.

◆ nssv_CONFIG_STD_SV_OPERATOR

#define nssv_CONFIG_STD_SV_OPERATOR   0

Definition at line 42 of file string_view.hpp.

◆ nssv_CONFIG_USR_SV_OPERATOR

#define nssv_CONFIG_USR_SV_OPERATOR   1

Definition at line 46 of file string_view.hpp.

◆ nssv_constexpr

#define nssv_constexpr   /*constexpr*/

Definition at line 294 of file string_view.hpp.

◆ nssv_constexpr14

#define nssv_constexpr14   /*constexpr*/

Definition at line 300 of file string_view.hpp.

◆ nssv_CPLUSPLUS

#define nssv_CPLUSPLUS   __cplusplus

Definition at line 69 of file string_view.hpp.

◆ nssv_CPP11_100

#define nssv_CPP11_100   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1600)

Definition at line 250 of file string_view.hpp.

◆ nssv_CPP11_110

#define nssv_CPP11_110   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1700)

Definition at line 251 of file string_view.hpp.

◆ nssv_CPP11_120

#define nssv_CPP11_120   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1800)

Definition at line 252 of file string_view.hpp.

◆ nssv_CPP11_140

#define nssv_CPP11_140   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1900)

Definition at line 253 of file string_view.hpp.

◆ nssv_CPP11_141

#define nssv_CPP11_141   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1910)

Definition at line 254 of file string_view.hpp.

◆ nssv_CPP11_90

#define nssv_CPP11_90   (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1500)

Definition at line 249 of file string_view.hpp.

◆ nssv_CPP11_OR_GREATER

#define nssv_CPP11_OR_GREATER   (nssv_CPLUSPLUS >= 201103L)

Definition at line 74 of file string_view.hpp.

◆ nssv_CPP11_OR_GREATER_

#define nssv_CPP11_OR_GREATER_   (nssv_CPLUSPLUS >= 201103L)

Definition at line 75 of file string_view.hpp.

◆ nssv_CPP14_000

#define nssv_CPP14_000   (nssv_CPP14_OR_GREATER)

Definition at line 256 of file string_view.hpp.

◆ nssv_CPP14_OR_GREATER

#define nssv_CPP14_OR_GREATER   (nssv_CPLUSPLUS >= 201402L)

Definition at line 76 of file string_view.hpp.

◆ nssv_CPP17_000

#define nssv_CPP17_000   (nssv_CPP17_OR_GREATER)

Definition at line 257 of file string_view.hpp.

◆ nssv_CPP17_OR_GREATER

#define nssv_CPP17_OR_GREATER   (nssv_CPLUSPLUS >= 201703L)

Definition at line 77 of file string_view.hpp.

◆ nssv_CPP20_OR_GREATER

#define nssv_CPP20_OR_GREATER   (nssv_CPLUSPLUS >= 202000L)

Definition at line 78 of file string_view.hpp.

◆ nssv_CPP98_OR_GREATER

#define nssv_CPP98_OR_GREATER   (nssv_CPLUSPLUS >= 199711L)

Definition at line 73 of file string_view.hpp.

◆ nssv_DISABLE_MSVC_WARNINGS

#define nssv_DISABLE_MSVC_WARNINGS (   codes)

Definition at line 374 of file string_view.hpp.

◆ nssv_explicit

#define nssv_explicit   /*explicit*/

Definition at line 306 of file string_view.hpp.

◆ nssv_HAS_CPP0X

#define nssv_HAS_CPP0X   0

Definition at line 239 of file string_view.hpp.

◆ nssv_HAVE_CONSTEXPR_11

#define nssv_HAVE_CONSTEXPR_11   nssv_CPP11_140

Definition at line 261 of file string_view.hpp.

◆ nssv_HAVE_CONSTEXPR_14

#define nssv_HAVE_CONSTEXPR_14   nssv_CPP14_000

Definition at line 279 of file string_view.hpp.

◆ nssv_HAVE_ENDS_WITH

#define nssv_HAVE_ENDS_WITH   nssv_HAVE_STARTS_WITH

Definition at line 88 of file string_view.hpp.

◆ nssv_HAVE_EXPLICIT_CONVERSION

#define nssv_HAVE_EXPLICIT_CONVERSION   nssv_CPP11_140

Definition at line 262 of file string_view.hpp.

◆ nssv_HAVE_INLINE_NAMESPACE

#define nssv_HAVE_INLINE_NAMESPACE   nssv_CPP11_140

Definition at line 263 of file string_view.hpp.

◆ nssv_HAVE_NODISCARD

#define nssv_HAVE_NODISCARD   nssv_CPP17_000

Definition at line 283 of file string_view.hpp.

◆ nssv_HAVE_NOEXCEPT

#define nssv_HAVE_NOEXCEPT   nssv_CPP11_140

Definition at line 264 of file string_view.hpp.

◆ nssv_HAVE_NULLPTR

#define nssv_HAVE_NULLPTR   nssv_CPP11_100

Definition at line 265 of file string_view.hpp.

◆ nssv_HAVE_REF_QUALIFIER

#define nssv_HAVE_REF_QUALIFIER   nssv_CPP11_140

Definition at line 266 of file string_view.hpp.

◆ nssv_HAVE_STARTS_WITH

#define nssv_HAVE_STARTS_WITH   (nssv_CPP20_OR_GREATER || !nssv_USES_STD_STRING_VIEW)

Definition at line 87 of file string_view.hpp.

◆ nssv_HAVE_STD_DEFINED_LITERALS

#define nssv_HAVE_STD_DEFINED_LITERALS   nssv_CPP11_140

Definition at line 274 of file string_view.hpp.

◆ nssv_HAVE_STD_HASH

#define nssv_HAVE_STD_HASH   nssv_CPP11_120

Definition at line 287 of file string_view.hpp.

◆ nssv_HAVE_STD_STRING_VIEW

#define nssv_HAVE_STD_STRING_VIEW   0

Definition at line 80 of file string_view.hpp.

◆ nssv_HAVE_UNICODE_LITERALS

#define nssv_HAVE_UNICODE_LITERALS   nssv_CPP11_140

Definition at line 267 of file string_view.hpp.

◆ nssv_HAVE_USER_DEFINED_LITERALS

#define nssv_HAVE_USER_DEFINED_LITERALS   nssv_CPP11_140

Definition at line 268 of file string_view.hpp.

◆ nssv_HAVE_WCHAR16_T

#define nssv_HAVE_WCHAR16_T   nssv_CPP11_100

Definition at line 269 of file string_view.hpp.

◆ nssv_HAVE_WCHAR32_T

#define nssv_HAVE_WCHAR32_T   nssv_CPP11_100

Definition at line 270 of file string_view.hpp.

◆ nssv_inline_ns

#define nssv_inline_ns   /*inline*/

Definition at line 312 of file string_view.hpp.

◆ nssv_nodiscard

#define nssv_nodiscard   /*[[nodiscard]]*/

Definition at line 338 of file string_view.hpp.

◆ nssv_noexcept

#define nssv_noexcept   /*noexcept*/

Definition at line 318 of file string_view.hpp.

◆ nssv_nullptr

#define nssv_nullptr   NULL

Definition at line 332 of file string_view.hpp.

◆ nssv_RESTORE_WARNINGS

#define nssv_RESTORE_WARNINGS ( )

Definition at line 384 of file string_view.hpp.

◆ nssv_STRING_VIEW_DEFAULT

#define nssv_STRING_VIEW_DEFAULT   0

Definition at line 27 of file string_view.hpp.

◆ nssv_STRING_VIEW_NONSTD

#define nssv_STRING_VIEW_NONSTD   1

Definition at line 28 of file string_view.hpp.

◆ nssv_STRING_VIEW_STD

#define nssv_STRING_VIEW_STD   2

Definition at line 29 of file string_view.hpp.

◆ nssv_STRINGIFY

#define nssv_STRINGIFY (   x)    nssv_STRINGIFY_(x)

Definition at line 22 of file string_view.hpp.

◆ nssv_STRINGIFY_

#define nssv_STRINGIFY_ (   x)    #x

Definition at line 23 of file string_view.hpp.

◆ nssv_SUPPRESS_MSGSL_WARNING

#define nssv_SUPPRESS_MSGSL_WARNING (   expr)

Definition at line 372 of file string_view.hpp.

◆ nssv_SUPPRESS_MSVC_WARNING

#define nssv_SUPPRESS_MSVC_WARNING (   code,
  descr 
)

Definition at line 373 of file string_view.hpp.

◆ nssv_USES_STD_STRING_VIEW

#define nssv_USES_STD_STRING_VIEW
Value:

Definition at line 82 of file string_view.hpp.

◆ string_view_lite_MAJOR

#define string_view_lite_MAJOR   1

Definition at line 14 of file string_view.hpp.

◆ string_view_lite_MINOR

#define string_view_lite_MINOR   1

Definition at line 15 of file string_view.hpp.

◆ string_view_lite_PATCH

#define string_view_lite_PATCH   0

Definition at line 16 of file string_view.hpp.

◆ string_view_lite_VERSION

#define string_view_lite_VERSION

Function Documentation

◆ nssv_DISABLE_MSVC_WARNINGS()

nssv_DISABLE_MSVC_WARNINGS ( 4455 26481  26472)

Definition at line 394 of file string_view.hpp.

string_view_lite_MAJOR
#define string_view_lite_MAJOR
Definition: string_view.hpp:14
nssv_CONFIG_SELECT_STRING_VIEW
#define nssv_CONFIG_SELECT_STRING_VIEW
Definition: string_view.hpp:32
nssv_STRING_VIEW_STD
#define nssv_STRING_VIEW_STD
Definition: string_view.hpp:29
nssv_STRING_VIEW_DEFAULT
#define nssv_STRING_VIEW_DEFAULT
Definition: string_view.hpp:27
string_view_lite_MINOR
#define string_view_lite_MINOR
Definition: string_view.hpp:15
nssv_STRINGIFY
#define nssv_STRINGIFY(x)
Definition: string_view.hpp:22
string_view_lite_PATCH
#define string_view_lite_PATCH
Definition: string_view.hpp:16


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49