campreilly / UnderSeaModelingLibrary

The Under Sea Modeling Library (USML) is a collection of C++ software development modules for sonar modeling and simulation.
Other
44 stars 22 forks source link

hidden-overload warning for `data_grid_svp::interpolate` #278

Open cconvey opened 2 months ago

cconvey commented 2 months ago

As reported by clang++-17 -Wall:

home/cconvey/r/cconvey/usml/usml/../usml/types/data_grid_svp.h:154:12: warning: 'usml::types::data_grid_svp::interpolate' hides overloaded virtual function [-Woverloaded-virtual]
  154 |     double interpolate(double* location, double* derivative = nullptr) const {
      |            ^
/home/cconvey/r/cconvey/usml/usml/../usml/types/gen_grid.h:83:15: note: hidden overloaded virtual function 'usml::types::gen_grid<3>::interpolate' declared here: type mismatch at 1st parameter ('const double *' vs 'double *')
   83 |     DATA_TYPE interpolate(const double location[],
      |               ^

My guess at what's happening:

This gets into some of the gnarlier parts of the C++ spec, but here's some background:

Ideas Would it make sense to just replace location[] with *location in these signatures? I'm not sure this would work, but it might be the easiest solution if it does.

campreilly commented 1 month ago

Feel free to make this change.