"parameter <X> may be const" for an object of a class with constexpr methods only

I have code like this:
gsl::span<const uint8_t> arr_view;
gsl::span: https://github.com/Microsoft/GSL/blob/master/include/gsl/span

The same problem with gsl::cstring_span<>.

The gsl::span<> is templated class like string_view<>.

My arr_view object is immutable in any case.

Can ReSharper C++ parse non-trivial object and detect const-behavior?




Thanks for the suggestion, but it is probably not feasible for us performance-wise. Adding such an inspection would require R++ to instantiate the template class with a different template argument and verify that the new instantiation contains no errors.



Thank you for fast response.
I think you are right, this requires too many works for "const" suggest. A template class can use SFINAE which require full compilation.


Please sign in to leave a comment.