OSSIA
Open Scenario System for Interactive Application
string_view.hpp
1 #pragma once
2 #include <ossia/detail/config.hpp>
3 
4 #include <array>
5 #include <string_view>
6 
7 namespace ossia
8 {
9 using string_view = std::string_view;
10 /*
11 inline std::string& operator+=(std::string& str, string_view s)
12 {
13  str.append(s.data(), s.size());
14  return str;
15 }
16 */
17 
18 // See also https://gist.github.com/klmr/2775736
19 template <std::size_t N>
20 constexpr std::string_view make_string_view(const char (&str)[N]) noexcept
21 {
22  return {str, N - 1};
23 }
24 
25 template <typename... Args>
26 constexpr std::array<std::string_view, sizeof...(Args)>
27 make_string_array(Args&&... args) noexcept
28 {
29  return std::array<std::string_view, sizeof...(Args)>{make_string_view(args)...};
30 }
31 }
Definition: git_info.h:7