diff options
author | David Tolnay <dtolnay@gmail.com> | 2021-04-28 00:29:55 -0700 |
---|---|---|
committer | David Tolnay <dtolnay@gmail.com> | 2021-04-28 00:32:11 -0700 |
commit | 99f79c0677eb1144af717fb242c184c9de590fd6 (patch) | |
tree | ec9280eb044b85edb02dc4edf7f1228d34a1a327 /src/cxx.cc | |
parent | 1d0556e0687c41ac564938f8d8579f3aab0e524c (diff) | |
download | cxx-99f79c0677eb1144af717fb242c184c9de590fd6.tar.gz |
Add 'bool empty() const noexcept' to Str, String
Diffstat (limited to 'src/cxx.cc')
-rw-r--r-- | src/cxx.cc | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -131,6 +131,8 @@ std::size_t String::length() const noexcept { return cxxbridge1$string$len(this); } +bool String::empty() const noexcept { return this->size() == 0; } + const char *String::c_str() noexcept { auto len = this->length(); cxxbridge1$string$reserve_total(this, len + 1); @@ -228,6 +230,8 @@ std::size_t Str::size() const noexcept { return cxxbridge1$str$len(this); } std::size_t Str::length() const noexcept { return this->size(); } +bool Str::empty() const noexcept { return this->size() == 0; } + Str::const_iterator Str::begin() const noexcept { return this->cbegin(); } Str::const_iterator Str::end() const noexcept { return this->cend(); } |