- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following program works well with gcc-4.3. When I use icc12, it said:
move.cc(11): error: namespace "std" has no member "move"
fun(std::move(a));
^
Is there any workaround?
Thank you very much.
[cpp]#include void fun(const int&a){ std::cout<
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure why it doesn't compiler.
On Windows if you've got VS2010 and icl, icl will compile and run fine.
It's probably a bug on Linux. I'll file a bug report for it.
thanks,
Jennifer
On Windows if you've got VS2010 and icl, icl will compile and run fine.
It's probably a bug on Linux. I'll file a bug report for it.
thanks,
Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the definition of std::move in bits/stl_move.h (line 26 of the following code).
When compiled with gcc -std=c++0x, __GXX_EXPERIMENTAL_CXX0X__ was defined, so std::move was defined.
But when compiled with icpc -std=c++0x, __GXX_EXPERIMENTAL_CXX0X__ was not defined, as a result std::move was not defined.
part of bits/stl_move.h:
When compiled with gcc -std=c++0x, __GXX_EXPERIMENTAL_CXX0X__ was defined, so std::move was defined.
But when compiled with icpc -std=c++0x, __GXX_EXPERIMENTAL_CXX0X__ was not defined, as a result std::move was not defined.
part of bits/stl_move.h:
[cpp]#ifndef _STL_MOVE_H #define _STL_MOVE_H 1 #include#include #ifdef __GXX_EXPERIMENTAL_CXX0X__ #include _GLIBCXX_BEGIN_NAMESPACE(std) // 20.2.2, forward/move template struct identity { typedef _Tp type; }; template inline _Tp&& forward(typename std::identity<_Tp>::type&& __t) { return __t; } template inline typename std::remove_reference<_Tp>::type&& move(_Tp&& __t) { return __t; } _GLIBCXX_END_NAMESPACE #define _GLIBCXX_MOVE(_Tp) std::move(_Tp) #else #define _GLIBCXX_MOVE(_Tp) (_Tp) #endif [/cpp]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had the same issue with std::move() on Linux.
Apparently the -std=c++0x -D__GXX_EXPERIMENTAL_CXX0X approach didnt' work, I got lots of compilation errors regarding STL, so I hand copied the move() function into my program:
- template
- struct remove_reference
- { typedef _Tp type; };
- template
- struct remove_reference<_Tp&>
- { typedef _Tp type; };)
- template
- struct remove_reference<_Tp&&>
- { typedef _Tp type; };
- template
- inline typename remove_reference<_Tp>::type&&
- move(_Tp&& __t)
- { return __t; }
And my corresponding copy constructor was:
- template
matrix :: matrix(matrix && x) - {*this = move(x);}
then I got this error message:
error: an rvalue reference cannot be bound to an lvalue
{ return __t; }
^
detected during:
instantiation of "remove_reference<_Tp>::type &&move(_Tp &&) [with _Tp=matrix &]
Is my copy constructor wrong or something to do with the Intel compiler ??
I was using XE12 with update 4 and compiler option:
-std=c++0x -O3 -fno-omit-frame-pointer -opt-prefetch=3 -nolib-inline -inline-level=2 -parallel-Qoption,cpp,--extended_float_type,-mkl=parallel
Ubuntu 10.4 with gcc 4.4.3.
Thanks alot !!
Haining
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Good news. this issue has been fixed in the Intel C++ Composer XE 2013 for Linux.
if your support service is not expired, it is free for you to upgrade it.
Thanks,
Jennifer

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page