[cfe-dev] clang++ c++0x and std::move

mercurio7891 littlekid87 at gmail.com
Fri Mar 18 22:58:44 PDT 2011


I am using clang with xcode 4 along with the -std=c++0x option.

The clang compiler seems to generate an error and say that no matching
parameters can be found for the following move function. However the code
compiles perfectly find on MSVC2010. 

e.g
int a =10;
void rvalueFunc(std::move(a)); // clang produces an error at this line.

Just in case clang did not implement std::move, I wrote another version
myself too and tested it, but it still gives an error of a non matching
parameter.

here is the other version of Move that I wrote, which was taken from msvc.
template  struct RemoveReference {
     typedef T type;
};
 
template  struct RemoveReference<T&> {
     typedef T type;
};
 
template  struct RemoveReference<T&&> {
     typedef T type;
};
 
template  typename RemoveReference::type&& Move(T&& t) {
    return t;

regards
Dontino
}

--
View this message in context: http://clang-developers.42468.n3.nabble.com/clang-c-0x-and-std-move-tp2701280p2701280.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list