出错代码如下:
//main.cpp
#include"aa.h"
int main()
{
return 0;
}
//aa.h
#ifndef _AA_H_
#define _AA_H_
#include"bb.h"
template<class>
struct is_sned{};
#endif
//bb.h
#ifndef _BB_H_
#define _BB_H_
#include"aa.h"
template<>
struct is_sned<int>{};
#endif
vs报错:
这是什么问题?
另外,如果我把bb.h中模板特化的部分放到aa.h中,就发现不报错了。
其中的原因是什么?