In C++ you can cast a couple ways, C-style casting or C++ casts. Bjarne Stroustrup and a host of other C++ experts say that a good design should have no casting.
Can you help me out here with redesigning the code below to get rid of the cast?
void CProgressBar::SetPosition( int nPos ); //unable to change
void CSaveDialog::UpdatePosition( double dProgress )
{
double percentOfProgress = dProgress * 100;
m_pProgressBar->SetPosition( static_cast<int>( percentOfProgress ) );
}
I can modify UpdatePosition, but not SetPosition.