S
silversurfer2025
Hello everyone,
I am using a struct inside another class, which can be used through an
empty constructor or another one. The definition looks like this:
struct Entry{
int index; //line 38
FeatureVector* value; //line 39
int object;
int count;
double variance;
Entry() {}
Entry(FeatureVector* _value, int _index, int _object, int _count,
double _variance)
: value(_value), index(_index), object(_object), count(_count),
variance(_variance) {}
};
When I am compiling I get the following error:
.../ModelContainer.h: In constructor 'Entry::Entry(FeatureVector*,
int, int, int, double)':
.../ModelContainer.h:39: warning: 'Entry::value' will be initialized
after
.../ModelContainer.h:38: warning: 'int Entry::index'
.../ModelContainer.h:44: warning: when initialized here
Why this? isn't it only initialized on calling the second constructor?
This should be no problem to me so why the warning?
Thanks a lot for your help
Tim
I am using a struct inside another class, which can be used through an
empty constructor or another one. The definition looks like this:
struct Entry{
int index; //line 38
FeatureVector* value; //line 39
int object;
int count;
double variance;
Entry() {}
Entry(FeatureVector* _value, int _index, int _object, int _count,
double _variance)
: value(_value), index(_index), object(_object), count(_count),
variance(_variance) {}
};
When I am compiling I get the following error:
.../ModelContainer.h: In constructor 'Entry::Entry(FeatureVector*,
int, int, int, double)':
.../ModelContainer.h:39: warning: 'Entry::value' will be initialized
after
.../ModelContainer.h:38: warning: 'int Entry::index'
.../ModelContainer.h:44: warning: when initialized here
Why this? isn't it only initialized on calling the second constructor?
This should be no problem to me so why the warning?
Thanks a lot for your help
Tim