mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 14:15:46 +00:00
sstring: add static_assert to prevent use on >1 byte types
This commit is contained in:
@@ -31,11 +31,17 @@
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
#include <cstdio>
|
||||
#include <type_traits>
|
||||
#include <experimental/string_view>
|
||||
#include "core/temporary_buffer.hh"
|
||||
|
||||
template <typename char_type, typename Size, Size max_size>
|
||||
class basic_sstring {
|
||||
static_assert(
|
||||
(std::is_same<char_type, char>::value
|
||||
|| std::is_same<char_type, signed char>::value
|
||||
|| std::is_same<char_type, unsigned char>::value),
|
||||
"basic_sstring only supports single byte char types");
|
||||
union contents {
|
||||
struct external_type {
|
||||
char_type* str;
|
||||
|
||||
Reference in New Issue
Block a user