添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Sorry, you must verify to complete this action. Please click the verification link in your email. You may re-send via your profile . Hi,
I just installed the Intel C++ Composer XE 2011. I've replaced all TR1 usage in my code with the Boost versions. However, std::pair is causing me problems.
The line of code is:
myMap.insert( std::pair ( boost::make_tuple(x, y, z), boost::make_tuple(A, B, C) ) );
Tuple is a typedef:
typedef boost::tuple Tuple;
myMap is a std:map:
std::map Map;
These all worked fine with gcc.
How can I resolve this?
The error I get is:
main.cpp(776): error: argument list for class template "std::pair" is missing
myMap.insert( std::pair( boost::make_tuple(x, y, z), boost::make_tuple(A, B, C) ) );
^
detected during instantiation of "void Foo ::run() [with dim=3]" at line 1163
/usr/include/c++/4.4.3/bits/stl_function.h(230): error: no operator "<" matches these operands
operand types are: const Tuple < const Tuple
{ return __x < __y; }
^
detected during:
instantiation of "bool std::less<_Tp>::operator()(const _Tp &, const _Tp &) const [with _Tp=Tuple]" at line 1170 of "/usr/include/c++/4.4.3/bits/stl_tree.h"
instantiation of "std::pair<:_rb_tree_iterator><_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(const _Val &) [with _Key=Tuple, _Val=std::pair , _KeyOfValue=std::_Select1st<:pair> >, _Compare=std::less , _Alloc=std::allocator<:pair> >]" at line 500 of "/usr/include/c++/4.4.3/bits/stl_map.h"
instantiation of "std::pair<:_rb_tree><_Key, std::pair , std::_Select1st<:pair> >, _Compare, _Alloc::rebind<:pair> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(const std::pair &) [with _Key=Tuple, _Tp=Tuple, _Compare=std::less , _Alloc=std::allocator<:pair> >]" at line 776 of "main.cpp"
instantiation of "void Foo ::setup_system() [with dim=3]" at line 1069 of "main.cpp"
instantiation of "void Foo ::run() [with dim=3]" at line 1163 of "main.cpp"
compilation aborted for main.cpp (code 2)
Many thanks,
Gennadiy

You say this line of code is causing the error:

> The line of code is:
> myMap.insert( std::pair ( boost::make_tuple(x, y, z), boost::make_tuple(A, B, C) ) );

and yet the error messageshows that the actual line is different:

> main.cpp(776): error: argument list for class template "std::pair" is missing
> myMap.insert( std::pair( boost::make_tuple(x, y, z), boost::make_tuple(A, B, C) ) );

Notice in the error message there is no explicit template argument list for std::pair.

Anyway if you can create a preprocessed file that compiles withg++ but not with our compiler please attach it. Use the -E option to create the file.

thanks
Judy

Community support is provided during standard business hours (Monday to Friday 7AM - 5PM PST). Other contact methods are available here .

Intel does not verify all solutions, including but not limited to any file transfers that may appear in this community. Accordingly, Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.

For more complete information about compiler optimizations, see our Optimization Notice .