I have the following code
class LambertianMaterial : public Material
Vector brdf(Vector wi) const
return mRho / M_PI; // Error here
Invalid operands to binary expression ('const Vector' and 'double')
Vector operator/(const float a);
friend Vector operator/(const Vector& v, const float& a);
You could make it a const member function, which could be applied for const and non-const object, if it won't (and it shouldn't) modify any non-static member variables.
Vector operator/(const float a) const;
As you thought, making it non-member function (and declared as friend if necessary) could do the work too. IMO I prefer to it for
operator/. See Operator overloading : member function vs. non-member function? for more informations.