name-hiding Questions

2

Solved

Ran into an interesting issue today and am trying to understand why. Consider the following: class Base { public: Base(){} ~Base(){} static void function1(){} void function2() { int functio...
Aenea asked 19/1, 2016 at 21:17

3

I know this is not the first question on this subject, but all the other related questions (and answers) I read were slightly out of the point, according to me. Take the code #include <io...
Objectionable asked 5/10, 2015 at 10:29

1

Solved

I got recently bitten by (simplified) struct Base { typedef char T; }; template<typename T> struct Foo : Base { T x[50]; // This is Base::T, not the template parameter }; In other words...
Corkhill asked 31/3, 2015 at 7:5

5

I am getting below warning . part of my code is : class Base { public: virtual void process(int x) {;}; virtual void process(int a,float b) {;}; protected: int pd; float pb; }; class derived:...
Bivins asked 30/1, 2014 at 17:7

3

Solved

It recently came to my attention that member functions completely shadow free functions with the same name when inside the class. And by completely I mean that every free function with the same nam...
Disservice asked 27/7, 2012 at 21:42

4

Refering another so question Consider the code : class Base { public: virtual void gogo(int a){ printf(" Base :: gogo (int) \n"); }; virtual void gogo(int* a){ printf(" Base :: gogo (int*...
Brewery asked 16/4, 2012 at 11:26

2

Solved

Is there something in the C++ standard that prevents me from overloading a super class's function? Starting with this pair of classes: class A { // super class int x; public: void foo (int y) ...
Kimbra asked 4/1, 2011 at 18:29
1

© 2022 - 2024 — McMap. All rights reserved.