forked from qt-creator/qt-creator
LayoutBuilder: Fix build with Apple Clang
It needs an explicit constructor, otherwise it complains that it cannot
find a match to the Arg2{p1, p2} call (requires 1 argument, but 2 were
provided) etc.
Amends 6231213aa3
Change-Id: Ibe3b27b334b8abff5028a77372cf208bfda9d8c1
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -51,13 +51,43 @@ public:
|
||||
};
|
||||
|
||||
template<typename T1, typename T2>
|
||||
struct Arg2 { const T1 p1; const T2 p2; };
|
||||
struct Arg2
|
||||
{
|
||||
Arg2(const T1 &a1, const T2 &a2)
|
||||
: p1(a1)
|
||||
, p2(a2)
|
||||
{}
|
||||
const T1 p1;
|
||||
const T2 p2;
|
||||
};
|
||||
|
||||
template<typename T1, typename T2, typename T3>
|
||||
struct Arg3 { const T1 p1; const T2 p2; const T3 p3; };
|
||||
struct Arg3
|
||||
{
|
||||
Arg3(const T1 &a1, const T2 &a2, const T3 &a3)
|
||||
: p1(a1)
|
||||
, p2(a2)
|
||||
, p3(a3)
|
||||
{}
|
||||
const T1 p1;
|
||||
const T2 p2;
|
||||
const T3 p3;
|
||||
};
|
||||
|
||||
template<typename T1, typename T2, typename T3, typename T4>
|
||||
struct Arg4 { const T1 p1; const T2 p2; const T3 p3; const T4 p4; };
|
||||
struct Arg4
|
||||
{
|
||||
Arg4(const T1 &a1, const T2 &a2, const T3 &a3, const T4 &a4)
|
||||
: p1(a1)
|
||||
, p2(a2)
|
||||
, p3(a3)
|
||||
, p4(a4)
|
||||
{}
|
||||
const T1 p1;
|
||||
const T2 p2;
|
||||
const T3 p3;
|
||||
const T4 p4;
|
||||
};
|
||||
|
||||
// The main dispatcher
|
||||
|
||||
@@ -460,7 +490,7 @@ void doit(Interface *x, IdId, auto p)
|
||||
|
||||
#define QTCREATOR_SETTER3(name, setter) \
|
||||
class name##_TAG {}; \
|
||||
inline auto name(auto p1, auto p2, auto p3) { return IdAndArg{name##_TAG{}, Arg4{p1, p2, p3}}; } \
|
||||
inline auto name(auto p1, auto p2, auto p3) { return IdAndArg{name##_TAG{}, Arg3{p1, p2, p3}}; } \
|
||||
inline void doit(auto x, name##_TAG, auto p) { x->setter(p.p1, p.p2, p.p3); }
|
||||
|
||||
#define QTCREATOR_SETTER4(name, setter) \
|
||||
|
Reference in New Issue
Block a user