core_name14_disabled.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright (c) 2023 Bela Schaum, X-Ryl669, Denis Mikhailov.
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // Initial implementation by Bela Schaum, https://github.com/schaumb
  6. // The way to make it union and UB free by X-Ryl669, https://github.com/X-Ryl669
  7. //
  8. #ifndef BOOST_PFR_DETAIL_CORE_NAME14_DISABLED_HPP
  9. #define BOOST_PFR_DETAIL_CORE_NAME14_DISABLED_HPP
  10. #pragma once
  11. #include <boost/pfr/detail/config.hpp>
  12. #include <boost/pfr/detail/sequence_tuple.hpp>
  13. namespace boost { namespace pfr { namespace detail {
  14. template <class T, std::size_t I>
  15. constexpr auto get_name() noexcept {
  16. static_assert(
  17. sizeof(T) && false,
  18. "====================> Boost.PFR: Field's names extracting functionality requires C++20."
  19. );
  20. return nullptr;
  21. }
  22. template <class T>
  23. constexpr auto tie_as_names_tuple() noexcept {
  24. static_assert(
  25. sizeof(T) && false,
  26. "====================> Boost.PFR: Field's names extracting functionality requires C++20."
  27. );
  28. return detail::sequence_tuple::make_sequence_tuple();
  29. }
  30. }}} // namespace boost::pfr::detail
  31. #endif // BOOST_PFR_DETAIL_CORE_NAME14_DISABLED_HPP