My program generates a lot of coordinates, over 3 million at 10 iterations of the rendering loop.
my class looks something like this:
I'm just wondering what effect does 'inline' have here? Is it doing anything better at all? Is the idea of calling a function in the initialization list a good idea?Code:class Coord{ public: Coord(double x, double y):xcoord(x),ycoord(y), theta( calcTheta() ){}; inline double calcTheta(); private: double xcoord; double ycoord; double theta; }; inline double Coord::calcTheta(){ double t; // Perform floating-point calculations to obtain theta... return t; }
Any suggestions are welcome!