public member function
<regex>

std::regex_traits::length

static size_t length (const char_type* p);
Return length of string
Returns the length of the string represented by the null-terminated character sequence pointed by p.

Similar in semantics to the strlen C function.

In regex_traits it is defined as an alias of its homonym in char_traits:
1
2
3
static size_t length (const char_type* p) {
  return char_traits<char_type>::length(p);
}


Parameters

p
A pointer to the first character in a null-terminated character sequence.

Return value

The number of characters in the null-terminated character sequence pointed by the argument passed (until the terminating null character, but without including it).
char_type is a member type, defined as an alias of regex_traits's template parameter (charT).

See also