Function substr

Synopsis

#include <include/internal/catch_stringref.h>

auto substr(size_type start, size_type length) const noexcept -> StringRef

Description

No description yet.

Source

Lines 29-35 in include/internal/catch_stringref.cpp. Line 77 in include/internal/catch_stringref.h.

auto StringRef::substr( size_type start, size_type size ) const noexcept -> StringRef {
    if (start < m_size) {
        return StringRef(m_start + start, (std::min)(m_size - start, size));
    } else {
        return StringRef();
    }
}





Add Discussion as Guest

Log in