#pragma once #include #include #include /** Copy string value into Arena. * Arena should support method: * char * alloc(size_t size). */ template inline StringRef copyStringInArena(Arena & arena, StringRef value) { size_t value_size = value.size; char * place_for_key = arena.alloc(value_size); memcpy(reinterpret_cast(place_for_key), reinterpret_cast(value.data), value_size); StringRef result{place_for_key, value_size}; return result; }