奇怪的问题,请高手指点,关于在VC中使用标准模板库
smq 2003-12-03 09:02:14 程序如下:
// test1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <list>
using namespace std;
class CTest
{
private:
int m_iTest1;
friend inline CTest& operator + (CTest& a, CTest& b);
public:
list<int*> _list;
};
inline CTest& operator + (CTest& a, CTest& b)
{
CTest tmp;
tmp.m_iTest1 = a.m_iTest1 + b.m_iTest1;
return tmp;
}
int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}
编译报如下错误
--------------------Configuration: test1 - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
test1.cpp
E:\test1\test1.cpp(16) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Error executing cl.exe.
test1.exe - 1 error(s), 0 warning(s)
如果将using namespace std 和list声明的变量去掉,则没有问题,不知是什么原因,请高手指点