Good day!
I created a structure that looks like this:
struct variables { double x,y,z; double u,v,w; vector <double> J; vector <double> Omega; variables(); }; which I would like to be able to multiply by a double type, i.e. Each element of the structure is multiplied by this same number (including elements of arrays).
At the moment I have implemented this using the function inside the structure, but I would like to do this by redefining the multiplication operator.
Actually, the question is how to do it? Is it necessary for this to separately implement two operators within the structure of type
friend const variables operator*(const variables& left, const double& right); friend const variables operator*(const double& left, const variables& right); or can it be done somehow else? Thank you in advance!