problem mit binary_function
-
der konstruktor schmiert mir immer ab bevor noch die erste zeile ausgeführt wird...
Liegt das problem hier irgendwo oder wo anders?
main
{
parralel_potential pot(...);
problem_fall(pot);
}
class problem_fall
{
problem_fall(potential_function& pot) { cout <<"wird nich ausgegeben";...}
};
class potential_function : public std::binary_function<double,double,double>
{
public:
virtual double operator()(double x, double y)=0;
};class parralel_potential : public potential_function
{
...
virtual double operator()(double x, double y)
{
return x*u+y*v;
}
};
-
sry hier nochmal formatiert
main { parralel_potential pot(...); problem_fall bla(pot); <-- absturz ohne das erste zeile des konstruktors ausgeführt wird } class problem_fall { problem_fall(potential_function& pot) { cout <<"wird nich ausgegeben";...} }; class potential_function : public std::binary_function<double,double,double> { public: virtual double operator()(double x, double y)=0; }; class parralel_potential : public potential_function { ... virtual double operator()(double x, double y) { return x*u+y*v; } };
-
ahhh sorry idiotischer indextausch in der parameterliste hat den absturz verursacht, deswegen wurd nie die erste zeile ausgeführt.
sry für die störung ^^