Chapter 9 : Miscellany

1. 
class B {

public:

 virtual void f() const;

};



class D: public B {

public:

 virtual void f();

};


The idea is for D::f to redefine the virtual functionB::f, but there's a mistake: inB, f is a const member function, but inD it's not declaredconst. One compiler I know says this about that:

warning: D::f() hides virtual B::f()
Hiding: only name the same, other thing different
Overload: name the same, parameter different. other thing doesn't matter
2.
 
 
  • The primary standard C++ library functionality consists of the STL, iostreams, and locales. The C99 standard library is also included.

  • TR1 adds support for smart pointers (e.g., tr1::shared_ptr), generalized function pointers (tr1::function), hash-based containers, regular expressions, and 10 other components.

  • TR1 itself is only a specification. To take advantage of TR1, you need an implementation. One source for implementations of TR1 components is Boost.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值