If you want to specifically call the const version for a non-const object use
const_cast works as well of course but the"style" guideline of most (authors) is to use static_cast to add const-ness.Code:static_cast<const Foo&>(foo).func(1);
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 15 of 16
Threaded View
|
Click Here to Expand Forum to Full Width |