C++0x doubts: RValues and Move semantics

Can anyone give me an explanation about the new features of C + +.
I wonder what kind of reference that is represented by two & (is a reference, right?). What is and when should I use? If you can give me an example. The "Move Semantics" is something like a copy constructor or operator? Would use it to move data from one container to another? If you can give me rough example of where these features apply?
-------------------------------------------------- ---------------------------
And the variadic template? It would be nice if this separate head to tail, like the lists in haskell and prolog. Or you can do this?
This is a tutorial on Rvalue references:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2027.html

You can separate the head type of a variadic template like this:

1
2
3
4
5
6
7
8
9
template < class T >
void F ( T v )  // specialization for only one type passed 
{
}
template < class head_type, class ...types >
void F ( head_type head, types&... args ) // get the head and rest of the arguments
{
   F ( args... ); // (sort-of) recursive call, expanding the tail
}
Last edited on
thanks, Bazzy. I did not think the specialization of templates to separate each element of variadic.
I'll read the tutorial you gave me.
Topic archived. No new replies allowed.