I am trying to use the Intel C ++ compiler for different standard C ++ libraries than for standard compilers. The headers that the compiler will use by default, unfortunately, do not define the specific type / function of the type that I need.
$ icpc --version icpc (ICC) 16.0.2 20160204 Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
The headings I would like to use are located in
ls /opt/crtdc/gcc/4.8.5-4/include/c++/4.8.5/: algorithm cfenv condition_variable cstring ext iostream numeric sstream tuple array cfloat csetjmp ctgmath fenv.h istream ostream stack typeindex atomic chrono csignal ctime forward_list iterator parallel stdexcept typeinfo backward cinttypes cstdalign cwchar fstream limits profile streambuf type_traits bits ciso646 cstdarg cwctype functional list queue string unordered_map bitset climits cstdbool cxxabi.h future locale random system_error unordered_set cassert clocale cstddef debug initializer_list map ratio tgmath.h utility ccomplex cmath cstdint decimal iomanip memory regex thread valarray cctype complex cstdio deque ios mutex scoped_allocator tr1 vector cerrno complex.h cstdlib exception iosfwd new set tr2 x86_64-redhat-linux
But no matter what I try, I either get
icpc -std=c++11 -o test test.cc -Qlocation,cxxinc,/opt/crtdc/gcc/4.8.5-4/include/c++/4.8.5/ error: namespace "std" has no member "declval"
(here I think the compiler uses it by default for the header) or
icpc -std=c++11 -o test test.cc -nostdinc++ -Qlocation,cxxinc,/opt/crtdc/gcc/4.8.5-4/include/c++/4.8.5/ test.cc(2): catastrophic error: cannot open source file "utility"
(here it doesn't use C ++ headers at all, because the -nostdinC ++ flag disables it all together, I think)
The test.cc program simply uses the standard C ++ 11 library, which I will need:
// declval example
EDIT:
Just to make sure it is properly motivated. The default C ++ 11 headers on this system do not support std :: declval. Therefore, I am trying to use GCC that support it.
$ icpc -std=c++11 -o test test.cc opa.cc(19): error: namespace "std" has no member "declval" decltype(std::declval<A>().value()) a;