ClickHouse/dbms/include/DB/Common/StringView.h

13 lines
381 B
C++
Raw Normal View History

#pragma once
#include <experimental/string_view>
using StringView = std::experimental::string_view;
/// It creates StringView from literal constant at compile time.
2016-12-09 22:13:33 +00:00
template <typename TChar, size_t size>
constexpr inline std::experimental::basic_string_view<TChar> makeStringView(const TChar (&str)[size])
{
2017-03-09 04:26:17 +00:00
return std::experimental::basic_string_view<TChar>(str, size - 1);
}