OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
string_view.hpp
1#pragma once
2#include <ossia/detail/config.hpp>
3
4#include <array>
5#include <string_view>
6
7namespace ossia
8{
9using string_view = std::string_view;
10/*
11inline 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
19template <std::size_t N>
20constexpr std::string_view make_string_view(const char (&str)[N]) noexcept
21{
22 return {str, N - 1};
23}
24
25template <typename... Args>
26constexpr std::array<std::string_view, sizeof...(Args)>
27make_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