Add string_view::empty()

This commit is contained in:
Jørgen Kvalsvik
2016-03-15 16:41:54 +01:00
parent 47ca6d31cc
commit 23f01511bd

View File

@@ -56,6 +56,7 @@ namespace Opm {
inline char operator[]( size_t ) const;
inline bool empty() const;
inline size_t size() const;
inline size_t length() const;
@@ -158,6 +159,10 @@ namespace Opm {
return *(this->begin() + i);
}
inline bool string_view::empty() const {
return std::distance( this->begin(), this->end() ) == 0;
}
inline size_t string_view::size() const {
return std::distance( this->begin(), this->end() );
}