H
Hicham Mouline
Hello
I have a struct D of primitive member types that derives from B also of
primitive types
(double, int) which I construct from an input stream.
struct B {
double f1;
int f2;
};
struct D: public B {
double f3;
double f4;
...
};
The input stream would contain (not necessarily in this order) :
f1 = 5.0
f2 = 4
f3 = 7.0
f4 = 5.6
....
This seems to be a common enough situation? that there should be some
library out there for this?
otherwise, do I implement:
1. D:
(std::istream&)
or
2. std::istream& operator>>(std::istream& input, D& data);
where do i check that the values are acceptable by the application?
If the input is wrong, do I throw a std::exception
regards,
I have a struct D of primitive member types that derives from B also of
primitive types
(double, int) which I construct from an input stream.
struct B {
double f1;
int f2;
};
struct D: public B {
double f3;
double f4;
...
};
The input stream would contain (not necessarily in this order) :
f1 = 5.0
f2 = 4
f3 = 7.0
f4 = 5.6
....
This seems to be a common enough situation? that there should be some
library out there for this?
otherwise, do I implement:
1. D:
or
2. std::istream& operator>>(std::istream& input, D& data);
where do i check that the values are acceptable by the application?
If the input is wrong, do I throw a std::exception
regards,