/* Copyright (c) 2018-2024 Marcelo Zimbres Silva (mzimbres@gmail.com) * * Distributed under the Boost Software License, Version 1.0. (See * accompanying file LICENSE.txt) */ #ifndef BOOST_REDIS_ADAPTER_ADAPT_HPP #define BOOST_REDIS_ADAPTER_ADAPT_HPP #include #include #include namespace boost::redis::adapter { /** @brief Adapts a type to be used as a response. * * The type T must be either * * @li a `response` * @li `std::vector>` * * The types T1, T2, etc can be any STL container, any integer type * and `std::string`. * * @tparam T The response type. */ template auto boost_redis_adapt(T& t) noexcept { return detail::response_traits::adapt(t); } /** @brief Adapts a type to be used as the response to an individual command. * * It can be used with low-level APIs, like @ref boost::redis::resp3::parser. */ template auto adapt2(T& t = redis::ignore) noexcept { return detail::result_traits::adapt(t); } } // namespace boost::redis::adapter #endif // BOOST_REDIS_ADAPTER_ADAPT_HPP