随笔分类 - Compiler
摘要:自己在写动态数组的时候遇到的问题。首先代码如下:// CMyArray.h: interface for the CMyArray class.////////////////////////////////////////////////////////////////////////#if !defined(AFX_CMYARRAY_H__C38AE5B7_BD54_4FBB_A839_7188271EAD03__INCLUDED_)#define AFX_CMYARRAY_H__C38AE5B7_BD54_4FBB_A839_7188271EAD03__INCLUDED_#if _MSC
阅读全文
摘要:今天在写迭代器的时候,准备做模版,于是把实现从声明类中提出来。写到声明的下面。类似于这样。Ca.Hclass A{public: A();}A::A(){}准备把迭代器的构造函数和重载的运算符函数都提出来,结果发现报错。同样的代码。在VC6.0中和2005结果就不一样。#include <iostream>using std::cout;using std::endl;template <typename T1>class A{public: class B { public: B(); };public: A();};template <typename T1&
阅读全文

浙公网安备 33010602011771号