Skip to content

Commit 9bbd9fd

Browse files
committed
feat third-party: up Boost.PFR to 1.90.0
commit_hash:a235f8ee10c82d390d646a1bbd1fe05ad386c9ac
1 parent 2aba433 commit 9bbd9fd

43 files changed

Lines changed: 370 additions & 206 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mapping.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5182,6 +5182,7 @@
51825182
"third_party/pfr/include/boost/pfr/detail/core14_loophole.hpp":"taxi/uservices/userver/third_party/pfr/include/boost/pfr/detail/core14_loophole.hpp",
51835183
"third_party/pfr/include/boost/pfr/detail/core17.hpp":"taxi/uservices/userver/third_party/pfr/include/boost/pfr/detail/core17.hpp",
51845184
"third_party/pfr/include/boost/pfr/detail/core17_generated.hpp":"taxi/uservices/userver/third_party/pfr/include/boost/pfr/detail/core17_generated.hpp",
5185+
"third_party/pfr/include/boost/pfr/detail/core26.hpp":"taxi/uservices/userver/third_party/pfr/include/boost/pfr/detail/core26.hpp",
51855186
"third_party/pfr/include/boost/pfr/detail/core_name.hpp":"taxi/uservices/userver/third_party/pfr/include/boost/pfr/detail/core_name.hpp",
51865187
"third_party/pfr/include/boost/pfr/detail/core_name14_disabled.hpp":"taxi/uservices/userver/third_party/pfr/include/boost/pfr/detail/core_name14_disabled.hpp",
51875188
"third_party/pfr/include/boost/pfr/detail/core_name20_static.hpp":"taxi/uservices/userver/third_party/pfr/include/boost/pfr/detail/core_name20_static.hpp",

third_party/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This folder contains source codes from following open source projects:
44

5-
* pfr: https://github.com/boostorg/pfr/releases/tag/boost-1.87.0
5+
* pfr: https://github.com/boostorg/pfr/releases/tag/boost-1.90.0
66
* moodycamel: https://github.com/cameron314/concurrentqueue/releases/tag/v1.0.4
77
* rapidjson: https://github.com/Tencent/rapidjson/commit/083f359f5c36198accc2b9360ce1e32a333231d9 with RAPIDJSON_HAS_STDSTRING defined in rapidjson.h
88
* date: https://github.com/HowardHinnant/date/tree/v3.0.1

third_party/pfr/include/boost/pfr.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016-2024 Antony Polukhin
1+
// Copyright (c) 2016-2025 Antony Polukhin
22
//
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

third_party/pfr/include/boost/pfr/config.hpp

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016-2024 Antony Polukhin
1+
// Copyright (c) 2016-2025 Antony Polukhin
22
// Copyright (c) 2022 Denis Mikhailov
33
//
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -8,10 +8,14 @@
88
#define BOOST_PFR_CONFIG_HPP
99
#pragma once
1010

11-
#if __cplusplus >= 201402L || (defined(_MSC_VER) && defined(_MSVC_LANG) && _MSC_VER > 1900)
11+
#if !defined(BOOST_USE_MODULES) && (__cplusplus >= 201402L || (defined(_MSC_VER) && defined(_MSVC_LANG) && _MSC_VER > 1900))
1212
#include <type_traits> // to get non standard platform macro definitions (__GLIBCXX__ for example)
1313
#endif
1414

15+
#if defined(BOOST_USE_MODULES) || __cplusplus >= 202002L
16+
#include <version>
17+
#endif
18+
1519
/// \file boost/pfr/config.hpp
1620
/// Contains all the macros that describe Boost.PFR configuration, like BOOST_PFR_ENABLED
1721
///
@@ -49,6 +53,14 @@
4953
# endif
5054
#endif
5155

56+
#ifndef BOOST_PFR_USE_CPP26
57+
#if __cpp_structured_bindings >= 202411L && __cpp_lib_forward_like >= 202207L
58+
#define BOOST_PFR_USE_CPP26 1
59+
#else
60+
#define BOOST_PFR_USE_CPP26 0
61+
#endif
62+
#endif
63+
5264
#ifndef BOOST_PFR_USE_CPP17
5365
# ifdef __cpp_structured_bindings
5466
# define BOOST_PFR_USE_CPP17 1
@@ -63,15 +75,17 @@
6375
# endif
6476
#endif
6577

66-
#if (!BOOST_PFR_USE_CPP17 && !BOOST_PFR_USE_LOOPHOLE)
78+
#if (!BOOST_PFR_USE_CPP26 && !BOOST_PFR_USE_CPP17 && !BOOST_PFR_USE_LOOPHOLE)
6779
# if (defined(_MSC_VER) && _MSC_VER < 1916) ///< in Visual Studio 2017 v15.9 PFR library with classic engine normally works
6880
# define BOOST_PFR_NOT_SUPPORTED 1
6981
# endif
7082
#endif
7183

7284
#ifndef BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE
85+
# if defined(BOOST_USE_MODULES)
86+
# define BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE 1
7387
// Assume that libstdc++ since GCC-7.3 does not have linear instantiation depth in std::make_integral_sequence
74-
# if defined( __GLIBCXX__) && __GLIBCXX__ >= 20180101
88+
# elif defined( __GLIBCXX__) && __GLIBCXX__ >= 20180101
7589
# define BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE 1
7690
# elif defined(_MSC_VER)
7791
# define BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE 1
@@ -145,12 +159,16 @@
145159

146160
#undef BOOST_PFR_NOT_SUPPORTED
147161

148-
#ifndef BOOST_PFR_BEGIN_MODULE_EXPORT
162+
#ifdef BOOST_PFR_INTERFACE_UNIT
163+
# define BOOST_PFR_BEGIN_MODULE_EXPORT export {
164+
# define BOOST_PFR_END_MODULE_EXPORT }
165+
#else
149166
# define BOOST_PFR_BEGIN_MODULE_EXPORT
167+
# define BOOST_PFR_END_MODULE_EXPORT
150168
#endif
151169

152-
#ifndef BOOST_PFR_END_MODULE_EXPORT
153-
# define BOOST_PFR_END_MODULE_EXPORT
170+
#if defined(BOOST_USE_MODULES) && !defined(BOOST_PFR_INTERFACE_UNIT)
171+
import boost.pfr;
154172
#endif
155173

156174
#endif // BOOST_PFR_CONFIG_HPP

third_party/pfr/include/boost/pfr/core.hpp

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016-2024 Antony Polukhin
1+
// Copyright (c) 2016-2025 Antony Polukhin
22
//
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -9,6 +9,8 @@
99

1010
#include <boost/pfr/detail/config.hpp>
1111

12+
#if !defined(BOOST_USE_MODULES) || defined(BOOST_PFR_INTERFACE_UNIT)
13+
1214
#include <boost/pfr/detail/core.hpp>
1315

1416
#include <boost/pfr/detail/sequence_tuple.hpp>
@@ -17,10 +19,12 @@
1719
#include <boost/pfr/detail/make_integer_sequence.hpp>
1820
#include <boost/pfr/detail/tie_from_structure_tuple.hpp>
1921

22+
#include <boost/pfr/tuple_size.hpp>
23+
24+
#if !defined(BOOST_PFR_INTERFACE_UNIT)
2025
#include <type_traits>
2126
#include <utility> // metaprogramming stuff
22-
23-
#include <boost/pfr/tuple_size.hpp>
27+
#endif
2428

2529
/// \file boost/pfr/core.hpp
2630
/// Contains all the basic tuple-like interfaces \forcedlink{get}, \forcedlink{tuple_size}, \forcedlink{tuple_element_t}, and others.
@@ -48,24 +52,34 @@ BOOST_PFR_BEGIN_MODULE_EXPORT
4852
/// \endcode
4953
template <std::size_t I, class T>
5054
constexpr decltype(auto) get(const T& val) noexcept {
51-
return detail::sequence_tuple::get<I>( detail::tie_as_tuple(val) );
55+
#if BOOST_PFR_USE_CPP26
56+
const auto& [... members] = val;
57+
return std::forward_like<const T &>(members...[I]);
58+
#else
59+
return detail::sequence_tuple::get<I>(detail::tie_as_tuple(val));
60+
#endif
5261
}
5362

5463
/// \overload get
5564
template <std::size_t I, class T>
5665
constexpr decltype(auto) get(T& val
57-
#if !BOOST_PFR_USE_CPP17
66+
#if !BOOST_PFR_USE_CPP17 && !BOOST_PFR_USE_CPP26
5867
, std::enable_if_t<std::is_assignable<T, T>::value>* = nullptr
5968
#endif
6069
) noexcept {
70+
#if BOOST_PFR_USE_CPP26
71+
auto& [... members] = val;
72+
return std::forward_like<T &>(members...[I]);
73+
#else
6174
return detail::sequence_tuple::get<I>( detail::tie_as_tuple(val) );
75+
#endif
6276
}
6377

64-
#if !BOOST_PFR_USE_CPP17
78+
#if !BOOST_PFR_USE_CPP17 && !BOOST_PFR_USE_CPP26
6579
/// \overload get
6680
template <std::size_t I, class T>
6781
constexpr auto get(T&, std::enable_if_t<!std::is_assignable<T, T>::value>* = nullptr) noexcept {
68-
static_assert(!sizeof(T), "====================> Boost.PFR: Calling boost::pfr::get on non const non assignable type is allowed only in C++17");
82+
static_assert(sizeof(T) && false, "====================> Boost.PFR: Calling boost::pfr::get on non const non assignable type is allowed only in C++17 and later");
6983
return 0;
7084
}
7185
#endif
@@ -74,7 +88,12 @@ constexpr auto get(T&, std::enable_if_t<!std::is_assignable<T, T>::value>* = nul
7488
/// \overload get
7589
template <std::size_t I, class T>
7690
constexpr auto get(T&& val, std::enable_if_t< std::is_rvalue_reference<T&&>::value>* = nullptr) noexcept {
91+
#if BOOST_PFR_USE_CPP26
92+
auto&& [... members] = std::forward<T>(val);
93+
return std::move(members...[I]);
94+
#else
7795
return std::move(detail::sequence_tuple::get<I>( detail::tie_as_tuple(val) ));
96+
#endif
7897
}
7998

8099

@@ -88,18 +107,18 @@ constexpr const U& get(const T& val) noexcept {
88107
/// \overload get
89108
template <class U, class T>
90109
constexpr U& get(T& val
91-
#if !BOOST_PFR_USE_CPP17
110+
#if !BOOST_PFR_USE_CPP17 && !BOOST_PFR_USE_CPP26
92111
, std::enable_if_t<std::is_assignable<T, T>::value>* = nullptr
93112
#endif
94113
) noexcept {
95114
return detail::sequence_tuple::get_by_type_impl<U&>( detail::tie_as_tuple(val) );
96115
}
97116

98-
#if !BOOST_PFR_USE_CPP17
117+
#if !BOOST_PFR_USE_CPP17 && !BOOST_PFR_USE_CPP26
99118
/// \overload get
100119
template <class U, class T>
101120
constexpr U& get(T&, std::enable_if_t<!std::is_assignable<T, T>::value>* = nullptr) noexcept {
102-
static_assert(!sizeof(T), "====================> Boost.PFR: Calling boost::pfr::get on non const non assignable type is allowed only in C++17");
121+
static_assert(sizeof(T) && false, "====================> Boost.PFR: Calling boost::pfr::get on non const non assignable type is allowed only in C++17 and later");
103122
return 0;
104123
}
105124
#endif
@@ -143,10 +162,15 @@ using tuple_element_t = typename tuple_element<I, T>::type;
143162
/// \endcode
144163
template <class T>
145164
constexpr auto structure_to_tuple(const T& val) {
165+
#if BOOST_PFR_USE_CPP26
166+
const auto& [... members] = val;
167+
return std::make_tuple(members...);
168+
#else
146169
return detail::make_stdtuple_from_tietuple(
147170
detail::tie_as_tuple(val),
148171
detail::make_index_sequence< tuple_size_v<T> >()
149172
);
173+
#endif
150174
}
151175

152176

@@ -168,31 +192,39 @@ constexpr auto structure_to_tuple(const T& val) {
168192
/// \endcode
169193
template <class T>
170194
constexpr auto structure_tie(const T& val) noexcept {
195+
#if BOOST_PFR_USE_CPP26
196+
const auto& [... members] = val;
197+
return std::tie(std::forward_like<const T &>(members)...);
198+
#else
171199
return detail::make_conststdtiedtuple_from_tietuple(
172200
detail::tie_as_tuple(const_cast<T&>(val)),
173201
detail::make_index_sequence< tuple_size_v<T> >()
174202
);
203+
#endif
175204
}
176205

177206

178207
/// \overload structure_tie
179208
template <class T>
180209
constexpr auto structure_tie(T& val
181-
#if !BOOST_PFR_USE_CPP17
210+
#if !BOOST_PFR_USE_CPP17 && !BOOST_PFR_USE_CPP26
182211
, std::enable_if_t<std::is_assignable<T, T>::value>* = nullptr
183212
#endif
184213
) noexcept {
185-
return detail::make_stdtiedtuple_from_tietuple(
186-
detail::tie_as_tuple(val),
187-
detail::make_index_sequence< tuple_size_v<T> >()
188-
);
214+
#if BOOST_PFR_USE_CPP26
215+
auto& [... members] = val;
216+
return std::tie(std::forward_like<T &>(members)...);
217+
#else
218+
return detail::make_stdtiedtuple_from_tietuple(detail::tie_as_tuple(val),
219+
detail::make_index_sequence<tuple_size_v<T> >());
220+
#endif
189221
}
190222

191-
#if !BOOST_PFR_USE_CPP17
223+
#if !BOOST_PFR_USE_CPP17 && !BOOST_PFR_USE_CPP26
192224
/// \overload structure_tie
193225
template <class T>
194226
constexpr auto structure_tie(T&, std::enable_if_t<!std::is_assignable<T, T>::value>* = nullptr) noexcept {
195-
static_assert(!sizeof(T), "====================> Boost.PFR: Calling boost::pfr::structure_tie on non const non assignable type is allowed only in C++17");
227+
static_assert(sizeof(T) && false, "====================> Boost.PFR: Calling boost::pfr::structure_tie on non const non assignable type is allowed only in C++17 and later modes");
196228
return 0;
197229
}
198230
#endif
@@ -201,7 +233,7 @@ constexpr auto structure_tie(T&, std::enable_if_t<!std::is_assignable<T, T>::val
201233
/// \overload structure_tie
202234
template <class T>
203235
constexpr auto structure_tie(T&&, std::enable_if_t< std::is_rvalue_reference<T&&>::value>* = nullptr) noexcept {
204-
static_assert(!sizeof(T), "====================> Boost.PFR: Calling boost::pfr::structure_tie on rvalue references is forbidden");
236+
static_assert(sizeof(T) && false, "====================> Boost.PFR: Calling boost::pfr::structure_tie on rvalue references is forbidden");
205237
return 0;
206238
}
207239

@@ -249,4 +281,6 @@ BOOST_PFR_END_MODULE_EXPORT
249281

250282
}} // namespace boost::pfr
251283

284+
#endif // #if !defined(BOOST_USE_MODULES) || defined(BOOST_PFR_INTERFACE_UNIT)
285+
252286
#endif // BOOST_PFR_CORE_HPP

third_party/pfr/include/boost/pfr/core_name.hpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,20 @@
1414

1515
#include <boost/pfr/detail/config.hpp>
1616

17+
#if !defined(BOOST_USE_MODULES) || defined(BOOST_PFR_INTERFACE_UNIT)
18+
1719
#include <boost/pfr/detail/core_name.hpp>
1820

1921
#include <boost/pfr/detail/sequence_tuple.hpp>
2022
#include <boost/pfr/detail/stdarray.hpp>
2123
#include <boost/pfr/detail/make_integer_sequence.hpp>
2224

23-
#include <cstddef> // for std::size_t
24-
2525
#include <boost/pfr/tuple_size.hpp>
2626

27+
#if !defined(BOOST_PFR_INTERFACE_UNIT)
28+
#include <cstddef> // for std::size_t
29+
#endif
30+
2731
/// \file boost/pfr/core_name.hpp
2832
/// Contains functions \forcedlink{get_name} and \forcedlink{names_as_array} to know which names each field of any \aggregate has.
2933
///
@@ -79,8 +83,7 @@ auto
7983
names_as_array() noexcept {
8084
return detail::make_stdarray_from_tietuple(
8185
detail::tie_as_names_tuple<T>(),
82-
detail::make_index_sequence< tuple_size_v<T> >(),
83-
1L
86+
detail::make_index_sequence< tuple_size_v<T> >()
8487
);
8588
}
8689

@@ -110,4 +113,6 @@ BOOST_PFR_END_MODULE_EXPORT
110113

111114
}} // namespace boost::pfr
112115

116+
#endif // #if !defined(BOOST_USE_MODULES) || defined(BOOST_PFR_INTERFACE_UNIT)
117+
113118
#endif // BOOST_PFR_CORE_NAME_HPP

third_party/pfr/include/boost/pfr/detail/config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016-2024 Antony Polukhin
1+
// Copyright (c) 2016-2025 Antony Polukhin
22
// Copyright (c) 2022 Denis Mikhailov
33
//
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying

third_party/pfr/include/boost/pfr/detail/core.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016-2024 Antony Polukhin
1+
// Copyright (c) 2016-2025 Antony Polukhin
22
//
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -13,7 +13,9 @@
1313
// `boost::pfr::detail::for_each_field_dispatcher` functions.
1414
//
1515
// The whole PFR library is build on top of those two functions.
16-
#if BOOST_PFR_USE_CPP17
16+
#if BOOST_PFR_USE_CPP26
17+
#include <boost/pfr/detail/core26.hpp>
18+
#elif BOOST_PFR_USE_CPP17
1719
# include <boost/pfr/detail/core17.hpp>
1820
#elif BOOST_PFR_USE_LOOPHOLE
1921
# include <boost/pfr/detail/core14_loophole.hpp>

third_party/pfr/include/boost/pfr/detail/core14_classic.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016-2024 Antony Polukhin
1+
// Copyright (c) 2016-2025 Antony Polukhin
22
//
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -9,13 +9,6 @@
99

1010
#include <boost/pfr/detail/config.hpp>
1111

12-
#ifdef BOOST_PFR_HAS_STD_MODULE
13-
import std;
14-
#else
15-
#include <type_traits>
16-
#include <utility> // metaprogramming stuff
17-
#endif
18-
1912
#include <boost/pfr/detail/sequence_tuple.hpp>
2013
#include <boost/pfr/detail/offset_based_getter.hpp>
2114
#include <boost/pfr/detail/fields_count.hpp>
@@ -25,6 +18,11 @@ import std;
2518
#include <boost/pfr/detail/size_t_.hpp>
2619
#include <boost/pfr/detail/rvalue_t.hpp>
2720

21+
#if !defined(BOOST_PFR_INTERFACE_UNIT)
22+
#include <type_traits>
23+
#include <utility> // metaprogramming stuff
24+
#endif
25+
2826
#ifdef __clang__
2927
# pragma clang diagnostic push
3028
# pragma clang diagnostic ignored "-Wmissing-braces"

0 commit comments

Comments
 (0)