[Tipz] c++ pitfall

Mark Logan mlogan at ccs.neu.edu
Thu May 8 19:12:55 EDT 2003


watch out for this (from a list @google):

<snip>
Even worse, if you have

class A {
public:
  void f(int i);
  void f(char c);
};
class B : public A {
public:
  void f(char c);
};

The f(int i) is still not visible in B.  You have to add a line in B

  using A::f(int i);

to make it visible.
<snip>

See the Stroustrup chapter "crack i have smoked"

-Mark



More information about the Tipz mailing list