You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't generally possible in C++ (@tap may have completely rewritten the construction process, though, so I might be wrong in this case). But you can make the member a pointer (or unique_ptr) and allocate/initialize it in the constructor, as per the docs wrt the m_beat_generator member variable. Or make the default constructor of your member object do nothing (maybe set a flag 'valid' to false), and then add a member function to initialize the object (which would set the flag 'valid' to true) and check for validity before using the object? Something like that. But I think the pointer initialization is the most idiomatic here.
Correct. The attribute<> class will still have it's constructor called when the Min class is initialized. I'm imagining that in this case that the assignment of the value internally to the attribute will not happen at that time, however.
There are questions though... Does the object then get initialized when the "loadbang" message is sent? Or not at all? Or... ?
Defer the initialization of a member object to allow for user parametrization before creation.
The text was updated successfully, but these errors were encountered: