gz-math icon indicating copy to clipboard operation
gz-math copied to clipboard

non-const `Color::operator[]` should return mutable reference

Open azeey opened this issue 6 months ago • 3 comments

Environment

  • OS Version: Ubuntu 22.04
  • Source or binary build? main, e0193a59072cc4a083dedaecf05957d059997b02

Description

  • Expected behavior: To be able to mutate a component of Color using operator[]
  • Actual behavior: Since it returns a value, any mutation is not applied to the component in Color https://github.com/gazebosim/gz-math/blob/e0193a59072cc4a083dedaecf05957d059997b02/include/gz/math/Color.hh#L162

azeey avatar Feb 05 '24 23:02 azeey