Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Zhanghong_T_
Novice
256 Views

When could Intel C++ compiler support C++11 feature?

Dear all,

Recently I am trying to compiler some code by Intel C++ Compiler XE 13.0, the code is somewhat like the follows:

            for(uint i=0; i<skeleton.size(); i++) {
                for(auto &entry : skeleton) {
                    action(i, entry.vid, entry);
                }
            }

when compiling by Intel C++ Compiler XE 13.0, the following error displayed:

Error    17    error : cannot deduce "auto" type (initializer required)  

I got to know that this new feature is not supporttd by latest Intel C++ compiler. When could Intel C++ compiler support this feature?

Thanks,

Zhanghong Tang



0 Kudos
9 Replies
Marián__VooDooMan__M
New Contributor II
256 Views

Greetings,

As Intel's support person said recently, C++11 is the main goal, though, (IIRC it was Jeniffer) said thay cannot comment details for future Intel's plans.

PS: I am waiting impatiently for new release, since in recent one /MP switch under Windows is broken, so I'd like to have knowledge of the timeline, but as she said, they cannot provide comments about this...

SergeyKostrov
Valued Contributor II
256 Views

Did you try to compile the test-case with option /Qstd=c++0x? Also, Please follow a link to see all supported C++11 features: software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler
Zhanghong_T_
Novice
256 Views

Dear Dr. Sergey Kostrov,

Thank you very much for your instructioin, this option works for my issue.

Thanks,

Zhanghong Tang

Judith_W_Intel
Employee
256 Views

 

Yes the "auto" keyword and c++11 range based for loops (which is what this code is using) should be supported in C++ 13.0 if you use the option to turn on c++11 (-std=c++11 on Linux and /Qstd=c++11 on Windows).

Judy

Zhanghong_T_
Novice
256 Views

Dear Dr. Sergey Kostrov and Judith Ward,

Thank you very much for your kindly reply. I tested and found that both two options /Qstd=c++0x and /Qstd=c++11 are OK for me. Could you please tell me what's the difference between these two options?

Thanks,

Zhanghong Tang

TimP
Black Belt
256 Views

The effect of those options should be identical.  c++0x was chosen by gcc for early development; after the standard was confirmed, c++11 was recommended as the spelling for the future.

Zhanghong_T_
Novice
256 Views

Dear Dr. Timp,

Thanks again for your kindly explaination.

I suggest that this option be turned on by default.

Thanks,

Zhanghong Tang

SergeyKostrov
Valued Contributor II
256 Views

>>...I suggest that this option be turned on by default. Thanks for your suggestion. I think this is a very dangerous thing and a developer should decide if the option needs to be set on. In general, command line options of any C++ compiler are "switchers" and that approach is very flexible. If some default option is changed it could bring lots of unpredictable issues and problems with existing hundreds of millions C/C++ code lines already implemented, tested, verified, validated, stabilized, frozen, etc.
Judith_W_Intel
Employee
256 Views

 

Turning it on by default would break compatibility with the Microsoft compiler. We only enable those c++11 features by default which are already implemented by the reference Microsoft compiler on the user's system.

Reply