是时候告别VC6编译器了吗? [英] Is it time to say goodbye to VC6 compiler?

查看:151
本文介绍了是时候告别VC6编译器了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我面对的问题,指向VC6编译器。

Of late I'm facing the issues that points finger to VC6 compiler.

其中很少有:


  1. 功能块不工作。 相关问题

  2. 同类常数不起作用。

  3. __ FUNCTION_(获取函数名称的宏)不起作用

  4. 最新添加 it doesn'
  1. A function-try-block doesn't work. Related Q
  2. in-class constant doesn't work.
  3. __FUNCTION_ (Macro to get function name) doesn't work
  4. The latest addition is it doesn't allow void functions to be passed as part of for_each.

下面的示例不是使用VC6编译器编译的。它说错误C2562:'()':'void'函数返回一个值。看起来VC6不喜欢void函数传递给for_each。

The below example is not compiling with VC6 compiler. It says "error C2562: '()' : 'void' function returning a value". It looks like VC6 doesn't like void functions to be passed to for_each.

class Temp
{
public:
    Temp(int i):m_ii(i)
    {}

    int getI() const
    {
        return m_ii;
    }

    void printWithVoid()
    {
        cout<< "i = "<<m_ii<<endl;

    }
    bool printWithBool()
    {
        cout<< "i = "<<m_ii<<endl;
        return true;
    }
private:
    int m_ii;
};

int main(void) 
{
    std::vector<Temp>  arrTempObjects;

    arrTempObjects.push_back(Temp(0));
    arrTempObjects.push_back(Temp(2));

    //Doesnot work, compiler error 
    std::for_each(arrTempObjects.begin(), arrTempObjects.end(), std::mem_fun_ref(&Temp::printWithVoid));

    //Works
    std::for_each(arrTempObjects.begin(), arrTempObjects.end(), std::mem_fun_ref(&Temp::printWithBool));

    return 0;
}

您是否遇到过任何与VC6.0相关的其他问题。解决这些问题的任何解决方法?

Have you faced any other issues related to VC6.0. Any workaround to resolve these issues ? Or is it time to change the compiler?

推荐答案

坦白说,我几乎不明白为什么不买现代计算机和切换到Visual Studio 2008.

Quite frankly I can hardly understand why you wouldn't buy a modern computer and switch to Visual Studio 2008.

VC6的STL不足,C ++标准合规性较差和过时的GUI。

VC6 has got a deficient STL, poor C++ standard compliance and obsolete GUI.

你不应该让你的竞争对手使用比你更好的工具。

You shouldn't let your competitors use better tools than you.

这篇关于是时候告别VC6编译器了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆