Implements piping StringView into streams.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-07-08 13:28:43 +02:00
parent 97b15650f1
commit 950464ae79
2 changed files with 23 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
#ifndef ARBUTILS_BASICSTRINGVIEW_HPP
#define ARBUTILS_BASICSTRINGVIEW_HPP
#include <iostream>
#include <string>
namespace ArbUt {
@@ -28,7 +29,11 @@ namespace ArbUt {
virtual constexpr bool operator!=(const std::string_view& rhs) const noexcept = 0;
virtual constexpr bool operator==(const char* rhs) const noexcept = 0;
virtual constexpr bool operator!=(const char* rhs) const noexcept = 0;
friend std::ostream& operator<<(std::ostream& out, const BasicStringView& c) {
out << c.c_str();
return out;
}
};
}
#endif // ARBUTILS_BASICSTRINGVIEW_HPP