// // Copyright (c) 2019-2025 Ruben Perez Hidalgo (rubenperez038 at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_MYSQL_TEST_COMMON_INCLUDE_TEST_COMMON_BUFFER_CONCAT_HPP #define BOOST_MYSQL_TEST_COMMON_INCLUDE_TEST_COMMON_BUFFER_CONCAT_HPP #include #include #include namespace boost { namespace mysql { namespace test { inline std::vector concat(std::vector lhs, const std::vector& rhs) { lhs.insert(lhs.end(), rhs.begin(), rhs.end()); return lhs; } class buffer_builder { std::vector buff_; public: buffer_builder() = default; buffer_builder& add(span value) { buff_.insert(buff_.end(), value.begin(), value.end()); return *this; } buffer_builder& add(const std::vector& value) { return add(span(value)); } std::vector build() { return std::move(buff_); } }; } // namespace test } // namespace mysql } // namespace boost #endif