Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.3.0
Description
The repc tool basically copies the RHS of the `=` sign into the member initializer. However, it breaks at the next `,` unless the `,` is inside a string literal.
// test.rep POD Range(int min, int max) class Device { // Supported: PROP(int id = 42); PROP(QString status = "Setting X-range to {-10, 10}..."); // Not supported: PROP(QList<int> targetIds = {1, 2, 3}); PROP(Range xRange = Range{-10, 10}); PROP(Range yRange = Range{0, 20}); }
The supported properties above currently get converted to this...
class DeviceSimpleSource : public DeviceSource { Q_OBJECT public: explicit DeviceSimpleSource(QObject *parent = nullptr) : DeviceSource(parent) , m_id(42) , m_status("Setting X-range to {-10, 10}...") { } ... }
...so it shouldn't be too hard to make it accept initializer lists or constructors too.