/* * Copyright (c) 2021, Jan de Visser * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace SQL { template void deserialize_from(ByteBuffer& buffer, size_t& at_offset, T& t) { auto ptr = buffer.offset_pointer((int)at_offset); memcpy(&t, ptr, sizeof(T)); at_offset += sizeof(T); } template void serialize_to(ByteBuffer& buffer, T const& t) { buffer.append(&t, sizeof(T)); } }