Before C++11, I would write my functions like so:

```
struct Color {
    float R,G,B,A;
    Color(float NewR,float NewG,float NewB,float NewA):
        R(NewR),G(NewG),B(NewB),A(NewA)
};
struct Item {
    Color color;

    void SetColor(const Color& new_color)
    {
        color=new_color; // Copy is created
    }
};

```

And then call it like so:

```
a_item.SetColor(Color(1.0f,1.0f,1.0f,1.0f));

Color new_color(1.0f,0.0f,0.0f,1.0f); // alternative way 
a_item.SetColor(new_color);

```

Now with C++11, I write my functions like this when applicable:

```
struct Item {
    Color color;

    void SetColor(Color new_color)
    {
        color=std::move(new_color); // No extra copy is created
    }
};

```

And then call it like so:

```
a_item.SetColor(Color(1.0f,1.0f,1.0f,1.0f)); // already Rvalue

Color new_color(1.0f,0.0f,0.0f,1.0f); // alternative way 
a_item.SetColor(std::move(new_color));

```

I was wondering if this was a good practice. It seems that when an object ownership is transferred, my functions become pass-by-value with move semantics.

Speaking of const correctness, should my constructor be defined like this:

```
    Color(const float NewR,const float NewG,const float NewB,const float NewA):
        R(NewR),G(NewG),B(NewB),A(NewA)

```

And my SetColor function defined like this?:

```
    void SetColor(const Color new_color)
    {
        color=std::move(new_color); // No extra copy is created
    }

```