rapidyaml  0.16.0
parseandemitYAML,anddoitfast
create substrings from C strings

Functions

template<class U >
auto c4::to_substr (U s) noexcept-> typename std::enable_if< is_compatible_char_ptr< U, char >::value, substr >::type
 Create a substring from a C-string (char*-like pointer) More...
 
template<class U >
auto c4::to_csubstr (U s) noexcept-> typename std::enable_if< is_compatible_char_ptr< U, const char >::value, csubstr >::type
 Create a substring from a const char*-like pointer. More...
 

Detailed Description

Function Documentation

template<class U >
auto c4::to_substr ( U  s) -> typename std::enable_if<is_compatible_char_ptr<U, char>::value, substr>::type
inlinenoexcept

Create a substring from a C-string (char*-like pointer)

Note
this overload uses SFINAE to prevent it from overriding the literal/array overload. U must be is a non-const-char pointer for this function to be considered in the overload set.
See also
For a more detailed explanation on why the plain overloads cannot coexist, see http://cplusplus.bordoon.com/specializeForCharacterArrays.html

Definition at line 2398 of file substr.hpp.

2400 {
2401  return substr(s);
2402 }
basic_substring< char > substr
a mutable string view
Definition: substr.hpp:2355
template<class U >
auto c4::to_csubstr ( U  s) -> typename std::enable_if<is_compatible_char_ptr<U, const char>::value, csubstr>::type
inlinenoexcept

Create a substring from a const char*-like pointer.

Note
this overload uses SFINAE to prevent it from overriding the literal/array overload
See also
For a more detailed explanation on why the plain overloads cannot coexist, see http://cplusplus.bordoon.com/specializeForCharacterArrays.html

Definition at line 2411 of file substr.hpp.

2413 {
2414  return csubstr(s);
2415 }
basic_substring< const char > csubstr
an immutable string view
Definition: substr.hpp:2356