I have a simple question:
Is there a way to do a strlen()
-like count of characters in zero-terminated char16_t
array?
相关问题
- thread_local variables initialization
- Google Test - generate values for template class i
- std::vector of objects / pointers / smart pointers
- correctly registering a plugin to use Eigen via Rc
- Set *both* elements and initial capacity of std::v
相关文章
- std::function copying parameters?
- Is a compiler forced to reject invalid constexpr?
- Custom pointer types and container/allocator typed
- How to fix a purported lack of an “explicit instan
- Ok to use std::getline() with a moved-from std::st
- How to specify gcc flags (CXXFLAGS) particularly f
- Templates, Function Pointers and C++0x
- Is it safe to use negative integers with size_t?
use
see 21.2.3.2
struct char_traits<char16_t>
and table 62 of the C++11-Std.Use pointers :), create a duplicate pointer to the start, then loop through it
while (*endptr++);
, then the length is given byendptr - startptr
. You can actually template this, however, its possible the the compile won't generate the same intrinsic code it does forstrlen
(for different sizes ofc).