以下代码VC6编译不过,VC8能过

简介: 以下代码VC6编译不过,VC8能过

以下代码VC6编译不过,不知道fun(m1)调用那个函数,VC8能过。

#include <iostream>
#include <string>
#include <map>
using namespace std ;
void fun(int x)
    {
    }
template<class _K, class _Ty>
        void fun(std::map<_K,_Ty>& m)
    {
    }
    template<class TYPE>
    void fun(TYPE x)
    {
    }
    class A
    {
    };
    void main()
    {
        std::map<long, A> m1;
        fun(3);
        fun("dd");
        fun(m1);
    }
-------------------------------
template<class T>
void Fun(T t1,T t2 )
{
}
template<class T1,class T2 >
int Fun(T1 t1,T2 t2)
{
    return 0 ;
}
void main()
{
    int x1 = Fun((short)1,(long)1);
}


VS2005(VS8)能过 VS2002(VC7)不能过。


目录
打赏
0
0
0
0
36
分享
相关文章
VC使用命令行编译很复杂
VC使用命令行编译很复杂
107 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等