Here's the breakdown:
t_group&
The function returns a reference to a t_group
.
t_group::
The function is in the t_group
namespace. Since t_group
is the name of a struct
, union
, or class
, it is a member of t_group
.
operator=
The function is an overload of the =
operator. Since it is a method, the object is the left-hand-side of the =
operator.
(const t_group &a)
This is the parameter to the function: it's the right-hand-side of the =
operator. This says the right-hand-side is a const
reference to a t_group
, which means the function will not alter the t_group
.
Taken together, this is the copy assignment operation for the t_group
class. It is invoked by code like:
t_group a, b;
b = a;
The latter line is equivalent to b.operator=(a);
.
P.S. assignment operator functions typically end with return *this;
. This is so you can chain the assignments (e.g. a = b = c
) just like the regular =
operator.