Skip to content

Commit 2f0a08c

Browse files
committed
Types.h: add deduction guides for Struct from std::tuple
C++23 changed the generation of implicit deduction guides. This causes the compiler to also see deduction guides for std::tuple as candidates for sdbus::Struct. Because of the competing guides the compiler doesn't know which one to pick. This seems to be implemented from gcc 15 on and is thus causing breakage there. To fix this we need to add explicit deduction guides when std::tuple is passed to sdbus::Struct. fixes #524
1 parent 44aa4f0 commit 2f0a08c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

include/sdbus-c++/Types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ namespace sdbus {
177177
template <typename... _Elements>
178178
Struct(_Elements...) -> Struct<_Elements...>;
179179

180+
template <typename... _Elements>
181+
Struct(const std::tuple<_Elements...>&) -> Struct<std::decay_t<_Elements>...>;
182+
183+
template <typename... _Elements>
184+
Struct(std::tuple<_Elements...>&&) -> Struct<std::decay_t<_Elements>...>;
185+
180186
template<typename... _Elements>
181187
constexpr Struct<std::decay_t<_Elements>...>
182188
make_struct(_Elements&&... args)

0 commit comments

Comments
 (0)