Skip to content

Commit 6f694e3

Browse files
heinemmlsangelovic
andauthored
fix: add deduction guides for Struct from std::tuple (#525)
* 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 * refactor: remove std::decay_t wrapper We need to be able to create sdbus::Structs with element types being references. --------- Co-authored-by: Stanislav Angelovič <stanislav.angelovic@protonmail.com>
1 parent 44aa4f0 commit 6f694e3

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<_Elements...>;
182+
183+
template <typename... _Elements>
184+
Struct(std::tuple<_Elements...>&&) -> Struct<_Elements...>;
185+
180186
template<typename... _Elements>
181187
constexpr Struct<std::decay_t<_Elements>...>
182188
make_struct(_Elements&&... args)

0 commit comments

Comments
 (0)