考虑以下代码:
#include <iostream>
template<class C>
struct time { };
int main() { }
Run Code Online (Sandbox Code Playgroud)
它产生(GCC 4.5):
error: ‘template<class C> struct time’ redeclared as different kind of symbol
/usr/include/time.h:186:15: error: previous declaration of ‘time_t time(time_t*)’
Run Code Online (Sandbox Code Playgroud)
iostream包含time_t time(time_t*)?iostream包含time_t time(time_t*)外部std命名空间?template<class C>,我不会收到此错误?