util/StringView: hard-code C++17
This commit is contained in:
parent
672278e5fd
commit
b1175acb59
@ -32,14 +32,10 @@
|
|||||||
|
|
||||||
#include "ConstBuffer.hxx"
|
#include "ConstBuffer.hxx"
|
||||||
#include "StringAPI.hxx"
|
#include "StringAPI.hxx"
|
||||||
#include "Compiler.h"
|
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
#if __cplusplus >= 201703L && !GCC_OLDER_THAN(7,0)
|
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#endif
|
#include <utility>
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct BasicStringView : ConstBuffer<T> {
|
struct BasicStringView : ConstBuffer<T> {
|
||||||
@ -72,14 +68,12 @@ struct BasicStringView : ConstBuffer<T> {
|
|||||||
constexpr BasicStringView(std::nullptr_t n) noexcept
|
constexpr BasicStringView(std::nullptr_t n) noexcept
|
||||||
:ConstBuffer<T>(n) {}
|
:ConstBuffer<T>(n) {}
|
||||||
|
|
||||||
#if __cplusplus >= 201703L && !GCC_OLDER_THAN(7,0)
|
|
||||||
constexpr BasicStringView(std::basic_string_view<T> src) noexcept
|
constexpr BasicStringView(std::basic_string_view<T> src) noexcept
|
||||||
:ConstBuffer<T>(src.data(), src.size()) {}
|
:ConstBuffer<T>(src.data(), src.size()) {}
|
||||||
|
|
||||||
constexpr operator std::basic_string_view<T>() const noexcept {
|
constexpr operator std::basic_string_view<T>() const noexcept {
|
||||||
return {data, size};
|
return {data, size};
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
using ConstBuffer<T>::empty;
|
using ConstBuffer<T>::empty;
|
||||||
using ConstBuffer<T>::begin;
|
using ConstBuffer<T>::begin;
|
||||||
|
Loading…
Reference in New Issue
Block a user