rapidyaml 0.14.0
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
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).
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.

Detailed Description

Function Documentation

◆ to_substr()

template<class U>
auto c4::to_substr ( U s) ->typenamestd::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 2399 of file substr.hpp.

2401{
2402 return substr(s);
2403}
basic_substring< char > substr
a mutable string view
Definition substr.hpp:2356

◆ to_csubstr()

template<class U>
auto c4::to_csubstr ( U s) ->typenamestd::enable_if< is_compatible_char_ptr< U, constchar >::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 2412 of file substr.hpp.

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