So, I've defined a class like
DataLoggingSystemStateReceiver
{
DataLoggingSystemStateReceiver()
: // initializer list
{
// stuff
}
// ... other functions here
};
In main, I instantiate DataLoggingSystemStateReceiver like so:
int main()
{
// ... run stuff
Sensor sensor(port, timer);
DataLoggingSystemStateReceiver dlss();
Log::notice("started");
return 0;
}
However, when I step through this code in gdb, it runs:
Sensor sensor(port, timer);
skips
DataLoggingSystemStateReceiver dlss();
and continues with
Log::notice("started");
What gives?
EDIT: By changing
DataLoggingSystemStateReceiver dlss();
to
DataLoggingSystemStateReceiver dlss;
in main(), the line executes. Can someone explain why?