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