Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

using std::any, compiler options /std:c++17, /Qstd=c++17 not compatible

Przemysław_O_
Beginner
705 Views

Hello,

I have tried to use std::any class, but I cannot enable C++17 support for Intel Compiler.

If I use it with VC++ I have to enable Language->C++ Language Standard->ISO C++17 Standard (/std:c++17) then it works fine.

If I use Intel with this option it says: class any is only available with C++17:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\any(14): error : #error directive: class any is only available with C++17.

if !_HAS_CXX17
 #error class any is only available with C++17.
#endif /* _HAS_CXX17 */

If I enable C++17 on C++->Language[Intel C++]-> C/C++ Language support->C++17 Support (/Qstd=c++17)

then I become error: icl: : error : '/Qstd:<arg>' conflicts with '/std:<arg>'

Command line:

/permissive- /Yu"stdafx.h" /GS /W3 /Zc:wchar_t /ZI /Od /Fd"Debug\vc141.pdb" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Zc:forScope /RTC1 /Gd /MDd /std:c++17 /FC /Fa"Debug\" /EHsc /nologo /Fo"Debug\" /Qstd=c++17 /Qprof-dir "Debug\" /Fp"Debug\anyintel.pch"

 

0 Kudos
6 Replies
Viet_H_Intel
Moderator
705 Views

 

Can you remove /std:c++17 from the command line?

Thanks,

Viet

Przemysław_O_
Beginner
705 Views

I have tried all combinations. Without /std:c++17 and with /Qstd=c++17 comes:

 #error class any is only available with C++17.

I use latest 2018.3 ICC with latest 15.7.4 VC.

Repro:

#include <any>

int main()
{
    std::any a;
    a = 42;
    return 0;
}

 

Viet_H_Intel
Moderator
705 Views

2018 Update 3 was release on May-29-2018 but VS 15.7.4 was released a couple week later. So, if you try an older VS version (i.e 15.6*), you may not see the error.

Thanks,

Viet 

Przemysław_O_
Beginner
705 Views

The same with 15.7.3. Could you provide some workaround?

Robert_B_6
Beginner
705 Views

The problem still exists with Intel 19.0 and VS 15.8.5.  Is there a work-around available?

Viet_H_Intel
Moderator
705 Views

 

Please see https://software.intel.com/en-us/articles/intel-compilers-integration-support-for-microsoft-visual-studio-2017 for VS2017 versions support by Intel Compiler versions. Let's know if the problem still occurs within a VS2017 version that supports by Intel compiler version.

Thanks,

Viet 

Reply