return found - data_;
}
- size_t rfind(int c, size_t pos=0) const {
- if (pos != 0)
- return substr(pos).find(c);
+ size_t rfind(int c, size_t pos=npos) const {
+ if (pos != npos)
+ return substr(0, pos).rfind(c);
const char *found = static_cast<const char*>(memrchr(data_, c, size_));