Constructor calling another function in the same class/object?
Is it okay for an object's constructor to call another function in its own class/object? I think I did it once before but don't remember for sure.
My class is called bitmap, and it already has a bitmap::readin() member function for reading in a .bmp file. I'd like to have a version of the constructor that takes a filename as its only argument and reads the file right then and there, without having to duplicate the function I've already got.
I know member functions can call other member functions, I'm just not sure if there's a problem with it being the constructor (i.e. does the other member function "not exist yet" because it's "still being constructed"?).
My class is called bitmap, and it already has a bitmap::readin() member function for reading in a .bmp file. I'd like to have a version of the constructor that takes a filename as its only argument and reads the file right then and there, without having to duplicate the function I've already got.
I know member functions can call other member functions, I'm just not sure if there's a problem with it being the constructor (i.e. does the other member function "not exist yet" because it's "still being constructed"?).
