C++ initialize base class member constants in derived class

class BaseImage
{
private:
    const unsigned int    IMG_WIDTH
                        , IMG_HEIGHT
                        ;
public:
    BaseImage(
          unsigned int iImgWidth
        , unsigned int iImgHeight
    ) : 
          IMG_WIDTH(iImgWidth)
        , IMG_HEIGHT(iImgHeight)
    {}
};

class DerivedImage : public BaseImage
{
    DerivedImage(
          unsigned int iImgWidth
        , unsigned int iImgHeight
    ) : 
          BaseImage(iImgWidth, iImgHeight)
    {}
}

Comments