If a variable is instantiated but not used, the compiler throws a warning.
If you don’t like to remove it, C++17 introduced the [[maybe_unused]] keyword. This tells the compiler to not freak out when it sees an unused variable. It suppresses compiler warnings.
There is no performance impact.
[[maybe_unused]] double pi { 3.14159 }; // Don't complain if pi is unused
[[maybe_unused]] double gravity { 9.8 }; // Don't complain if gravity is unused