<tfoot id='Krb48'></tfoot>
  • <i id='Krb48'><tr id='Krb48'><dt id='Krb48'><q id='Krb48'><span id='Krb48'><b id='Krb48'><form id='Krb48'><ins id='Krb48'></ins><ul id='Krb48'></ul><sub id='Krb48'></sub></form><legend id='Krb48'></legend><bdo id='Krb48'><pre id='Krb48'><center id='Krb48'></center></pre></bdo></b><th id='Krb48'></th></span></q></dt></tr></i><div id='Krb48'><tfoot id='Krb48'></tfoot><dl id='Krb48'><fieldset id='Krb48'></fieldset></dl></div>
    <legend id='Krb48'><style id='Krb48'><dir id='Krb48'><q id='Krb48'></q></dir></style></legend>

    <small id='Krb48'></small><noframes id='Krb48'>

      • <bdo id='Krb48'></bdo><ul id='Krb48'></ul>

        VS 2012 中的可变参数模板(Visual C++ 2012 年 11 月 CTP)

        时间:2023-06-03
        <i id='peSuB'><tr id='peSuB'><dt id='peSuB'><q id='peSuB'><span id='peSuB'><b id='peSuB'><form id='peSuB'><ins id='peSuB'></ins><ul id='peSuB'></ul><sub id='peSuB'></sub></form><legend id='peSuB'></legend><bdo id='peSuB'><pre id='peSuB'><center id='peSuB'></center></pre></bdo></b><th id='peSuB'></th></span></q></dt></tr></i><div id='peSuB'><tfoot id='peSuB'></tfoot><dl id='peSuB'><fieldset id='peSuB'></fieldset></dl></div>

            <tfoot id='peSuB'></tfoot>
            • <bdo id='peSuB'></bdo><ul id='peSuB'></ul>
              • <small id='peSuB'></small><noframes id='peSuB'>

              • <legend id='peSuB'><style id='peSuB'><dir id='peSuB'><q id='peSuB'></q></dir></style></legend>
                    <tbody id='peSuB'></tbody>
                  本文介绍了VS 2012 中的可变参数模板(Visual C++ 2012 年 11 月 CTP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我安装了 Visual C++ Compiler 2012 年 11 月 CTP并创建了一个 C++ 控制台项目.我在

                  I installed Visual C++ Compiler November 2012 CTP and created a C++ console project. I wrote this in

                  template<typename T>
                  void Test(T value){
                  }
                  template<typename T, typename... Args>
                  void Test(T value, Args... args){
                      Test(value);
                      Test(args...);
                  }
                  
                  int main(){
                      Test(1,2,3);
                  }
                  

                  然后我按 F6 在 IDE 中构建.我在第 4 行收到此错误

                  Then I pressed F6 to build in the IDE. I got this error on line 4

                  error C2143: syntax error : missing ',' before '...'
                  

                  编译列表可变参数模板",所以我相信这应该可行.我确实理解智能感知可能不正确,但是编译器"应该可以工作.我不能从 IDE 构建吗?我必须在某处启用某些东西吗?int i{4}; 似乎也不起作用,我确定这是有效的统一初始化.

                  The compile list "variadic templates" so I believe this should work. I do understand intellisense may be incorrect however the 'compiler' should work. Can I not build from the IDE? Do I have to enable something somewhere? int i{4}; doesn't seem to work either and I am sure thats valid uniform initialization.

                  推荐答案

                  在项目属性中,确保选择Microsoft Visual C++ Compiler Nov 2012 CTP:

                  In the Project Properties, make sure to select the Microsoft Visual C++ Compiler Nov 2012 CTP:

                  新工具链不会替换现有的 Visual C++ 2012 工具链,并且默认情况下未启用.它与现有工具链并排安装.

                  The new toolchain does not replace the existing Visual C++ 2012 toolchain, and it is not enabled by default. It's installed side-by-side with the existing toolchain.

                  如果您选择新的工具链,您的程序将编译无误.

                  If you select the new toolchain, your program will compiler without error.

                  这篇关于VS 2012 中的可变参数模板(Visual C++ 2012 年 11 月 CTP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:初始值设定项列表不适用于 Visual Studio 2012 中的向量? 下一篇:初始化程序列表与 2013 中的双重删除

                  相关文章

                    1. <small id='w1pMJ'></small><noframes id='w1pMJ'>

                    2. <i id='w1pMJ'><tr id='w1pMJ'><dt id='w1pMJ'><q id='w1pMJ'><span id='w1pMJ'><b id='w1pMJ'><form id='w1pMJ'><ins id='w1pMJ'></ins><ul id='w1pMJ'></ul><sub id='w1pMJ'></sub></form><legend id='w1pMJ'></legend><bdo id='w1pMJ'><pre id='w1pMJ'><center id='w1pMJ'></center></pre></bdo></b><th id='w1pMJ'></th></span></q></dt></tr></i><div id='w1pMJ'><tfoot id='w1pMJ'></tfoot><dl id='w1pMJ'><fieldset id='w1pMJ'></fieldset></dl></div>
                        <bdo id='w1pMJ'></bdo><ul id='w1pMJ'></ul>
                    3. <legend id='w1pMJ'><style id='w1pMJ'><dir id='w1pMJ'><q id='w1pMJ'></q></dir></style></legend>

                      <tfoot id='w1pMJ'></tfoot>