M
Martin Lepage
Hi World!
I have a general function that takes a (vector<double> &) as parameter.In
the case were I only need 2D vectors, I made the following class :
class Data2D : public vector<double> {
public:
Data2D(double x, double y) {
push_back(x); push_back(y);
}
};
Using this, I though I could use my original fonction in the following
way:
fonction(Data2D(0.2, 2.3));
But when I compile using gcc version 2.96 20000731 (Red Hat Linux 7.3
2.96-110) (I wish I could update my PC at work!) I get the following
message :
sorry, not implemented: 'float_expr' not supported by 'dump_expr'
I solved the problem by taking a copy of the vector (vector<double>)
instead in my original fonction. Can anyone tell me what I'm doing wrong?
Is it that I should never pass the reference of a temporary variable? I
only did so to avoid copying the vector to the fonction (thus saving a
little memory, I hope).
Thanks.
Martin Lepage
I have a general function that takes a (vector<double> &) as parameter.In
the case were I only need 2D vectors, I made the following class :
class Data2D : public vector<double> {
public:
Data2D(double x, double y) {
push_back(x); push_back(y);
}
};
Using this, I though I could use my original fonction in the following
way:
fonction(Data2D(0.2, 2.3));
But when I compile using gcc version 2.96 20000731 (Red Hat Linux 7.3
2.96-110) (I wish I could update my PC at work!) I get the following
message :
sorry, not implemented: 'float_expr' not supported by 'dump_expr'
I solved the problem by taking a copy of the vector (vector<double>)
instead in my original fonction. Can anyone tell me what I'm doing wrong?
Is it that I should never pass the reference of a temporary variable? I
only did so to avoid copying the vector to the fonction (thus saving a
little memory, I hope).
Thanks.
Martin Lepage