Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

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

Przemysław_O_
Beginner
1,452 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
1,452 Views

 

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

Thanks,

Viet

0 Kudos
Przemysław_O_
Beginner
1,452 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;
}

 

0 Kudos
Viet_H_Intel
Moderator
1,452 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 

0 Kudos
Przemysław_O_
Beginner
1,452 Views

The same with 15.7.3. Could you provide some workaround?

0 Kudos
Robert_B_6
Beginner
1,452 Views

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

0 Kudos
Viet_H_Intel
Moderator
1,452 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 

0 Kudos
Reply