Informally, a method that expects a parameter by reference assumes that it is passed something that can be legally placed on the left side of the assignment operator (sometimes called an "lvalue").
int main() { my_class a; my_class b(&a);
In this case, it is worth noting that in most cases, passing a pointer by value is inexpensive and will work. If you really need a pointer to modify (passed by reference), you need to pass an lvalue.
Another option is to have a const link. Then I believe that you can just pass rvalues .
source share