A
A
azudem2014-04-06 19:07:29
C++ / C#
azudem, 2014-04-06 19:07:29

Explicit hiding (hide) of a base class function in C++

Is there a way in C++ to explicitly state that I want to hide a base class function? More precisely, I need to guarantee a compile-time error if the function I want to hide is virtual.
In other words, you need a specifier that is the opposite of override -- or something with similar semantics. In C#, the new specifier is used for this.
If there is no solution in the current standard, then maybe there are some GCC extensions? And in general, where can I read some official discussions of future changes to the standard;
Or maybe a similar feature is planned ... I also asked a question on StackOverflow. Silent...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Shvedov, 2014-04-07
@mmmaaak

what about PIMPL pattern?

O
OnYourLips, 2014-04-06
@OnYourLips

There is. This function must be private.

A
AxisPod, 2014-04-07
@AxisPod

There is no such possibility in C++.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question