mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
525 B
C++
29 lines
525 B
C++
#ifndef LLARP_STRING_VIEW_HPP
|
|
#define LLARP_STRING_VIEW_HPP
|
|
|
|
#if __cplusplus >= 201703L
|
|
#include <string_view>
|
|
#include <string>
|
|
namespace llarp
|
|
{
|
|
typedef std::string_view string_view;
|
|
static std::string
|
|
string_view_string(const string_view& v)
|
|
{
|
|
return std::string(v.data(), v.size());
|
|
}
|
|
} // namespace llarp
|
|
#else
|
|
#include <string>
|
|
namespace llarp
|
|
{
|
|
typedef std::string string_view;
|
|
|
|
static std::string
|
|
string_view_string(const string_view& v)
|
|
{
|
|
return v;
|
|
};
|
|
} // namespace llarp
|
|
#endif
|
|
#endif |