|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
我在看《C++ Templates》时,遇到了如下代码在第74页
- ……
- template <typename T>
- void shell(T const& env)
- {
- class ShallowChecks{
- void deref(T::Index ptr){//不是应该用typename T::Index ptr吗?
- ignore(ptr);
- }
- };
- typename T::Index I;
- middle(I);
- }
复制代码 还有在第77页- ……
- friend boll operator<(SortTracer const& a,SortTracer const& b){//这是什么意思?为什么friend还有函数体
- ++n_compared;
- ……
- return a.value < b.value;
- }
- ……
复制代码 虽然我知道这本书有很多错误,比如经常写错变量名什么的,但是这几处错误就比较明显了吧。
如果不是错误,请高手解释,谢谢
|
|