STYLE: Change some declarations to use trailing return type#4020
Conversation
This fixes some of the compile errors on VS2017. They were introduced around the time C++17 was enabled. The first error message was: m:\dashboard\itk\modules\numerics\statistics\include\itkHistogram.hxx(474): error C2244: 'itk::Statistics::Histogram<TMeasurement,TFrequencyContainer>::GetMeasurementVector': unable to match function definition to an existing declaration m:\dashboard\itk\modules\numerics\statistics\include\itkHistogram.hxx(473): note: see declaration of 'itk::Statistics::Histogram<TMeasurement,TFrequencyContainer>::GetMeasurementVector' m:\dashboard\itk\modules\numerics\statistics\include\itkHistogram.hxx(474): note: definition m:\dashboard\itk\modules\numerics\statistics\include\itkHistogram.hxx(474): note: 'const Histogram<TMeasurement,TFrequencyContainer>::MeasurementVectorType &itk::Statistics::Histogram<TMeasurement,TFrequencyContainer>::GetMeasurementVector(const itk::Statistics::Histogram<TMeasurement,TFrequencyContainer>::IndexType &) const' m:\dashboard\itk\modules\numerics\statistics\include\itkHistogram.hxx(474): note: existing declarations m:\dashboard\itk\modules\numerics\statistics\include\itkHistogram.hxx(474): note: 'const Histogram<TMeasurement,TFrequencyContainer>::Sample<itk::Array<TValue>>::MeasurementVectorType &itk::Statistics::Histogram<TMeasurement,TFrequencyContainer>::GetMeasurementVector(const itk::Statistics::Histogram<TMeasurement,TFrequencyContainer>::IndexType &) const' m:\dashboard\itk\modules\numerics\statistics\include\itkHistogram.hxx(474): note: 'const Histogram<TMeasurement,TFrequencyContainer>::Sample<itk::Array<TValue>>::MeasurementVectorType &itk::Statistics::Histogram<TMeasurement,TFrequencyContainer>::GetMeasurementVector(Histogram<TMeasurement,TFrequencyContainer>::Sample<itk::Array<TValue>>::InstanceIdentifier) const'
|
Thanks @dzenanz, for doing a follow-up to PR #2780 commit c54ad67 Did you do same the regular expression as in c54ad67 ? Honestly I don't really understand why theses errors reappear now, as I thought they were solved by PR #2780. |
|
No regex, I went by compiler error messages. VS2017 is tested nightly, and the errors started appearing on April 1st. I looked at the log and that was about time we flipped the switch on C++17, and you did a first round of refactoring. I did not narrow it down to a specific commit, though. |
N-Dekker
left a comment
There was a problem hiding this comment.
I'm sorry that pull request #2780 appeared incomplete. For the sake of completeness, could you please rerun the regex, to ensure that no cases are forgotten this time? I think Core\Common\include\itkResourceProbe.hxx could still be included with this commit.
Approved anyway.
|
OK, let's merge this one. The remaining use cases for trailing return types can always be addressed afterwards. Thanks @dzenanz |
|
Follow-up in #4026. |
This fixes some of the compile errors on VS2017.
They were introduced around the time C++17 was enabled. The first error message was:
PR Checklist