underlying_row.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MYSQL_UNDERLYING_ROW_HPP
  8. #define BOOST_MYSQL_UNDERLYING_ROW_HPP
  9. #include <boost/mysql/detail/typing/row_traits.hpp>
  10. #ifdef BOOST_MYSQL_CXX14
  11. namespace boost {
  12. namespace mysql {
  13. /**
  14. * \brief Type trait to retrieve the underlying row type.
  15. * \details
  16. * Given an input type `T` satisfying the `StaticRow` concept,
  17. * this trait is an alias for its underlying row type. It is defined as follows:
  18. * \n
  19. * \li If `T` is a marker type, like \ref pfr_by_name "pfr_by_name<U>", `underlying_row_t`
  20. * is an alias for the marker's inner type `U`.
  21. * \li If `T` is not a marker type (e.g. it's a Boost.Describe struct or a `std::tuple`),
  22. * `underlying_row_t` is an alias for `T`.
  23. *
  24. * For instance, \ref static_results::rows uses this trait to determine its return type.
  25. */
  26. template <BOOST_MYSQL_STATIC_ROW StaticRow>
  27. using underlying_row_t =
  28. #ifdef BOOST_MYSQL_DOXYGEN
  29. __see_below__
  30. #else
  31. detail::underlying_row_t<StaticRow>
  32. #endif
  33. ;
  34. } // namespace mysql
  35. } // namespace boost
  36. #endif
  37. #endif