Can you use classes lacking parameter-less constructors within structs?

How can I use a custom type that requires a constructor parameter within a struct?
I’ve been using the RunningAverage library lately and you create an instance of it like this:

RunningAverage myRA(10);

But if I try that within a Struct:

struct shtAverage {
RunningAverage temp(10);
RunningAverage humidity(10);
} shtAverages[numSensors];

I get this error:
expected identifier before numeric constant
and
expected ',' or '...' before numeric constant
I also tried moving the (10) to the type name, ie:

RunningAverage(10) humidity;

But get similar, though different errors. Trying without the “(10)” fails because the library doesn’t have a parameter-less constructor.

If I copy local and update the RunningAverage library to have an empty constructor that defaults to 10, ie:

RunningAverage::RunningAverage() :RunningAverage(10) { }

Then it does work; but I’m curious if there’s a way to do this without having to modify that library and miss out on future updates.

Here’s the full simplified example of what I’m trying to do if anyone wants to play with it:

// This #include statement was automatically added by the Particle IDE.
#include <RunningAverage.h>
#define numSensors 4

struct shtAverage {
RunningAverage temp(10);
RunningAverage humidity(10);
} shtAverages[numSensors];

void setup() { }

void loop() { }

class and struct are pretty much interchangeable. You can use a constructor in this case to properly initialize the inner classes.

struct shtAverage {
    RunningAverage temp;
    RunningAverage humidity;
    shtAverage() : temp(10), humidity(10) {}
} shtAverages[numSensors];

Thanks, I didn’t know you could do that :smiley: