Beispiel #1
0
 size_type find (basic_string_view that) const {
   auto iter = std::search(
     this->begin(), this->end(),
     that.begin(), that.end(),
     traits::eq
   );
   if (iter == this->end()) { return npos; }
   return std::distance(this->begin(), iter);
 }
Beispiel #2
0
 size_t operator() (const basic_string_view<T, Traits>& sv,
                    charT *buf, size_t buf_len) const noexcept {
     const size_t n = sv.size();
     if (buf) {
         CLUE_ASSERT(n < buf_len);
         ::std::copy(sv.begin(), sv.end(), buf);
         buf[n] = static_cast<charT>('\0');
     }
     return n;
 }