janitor: C++: make the code more readable by having the type explicit

This commit is contained in:
Olivier Goffart 2023-10-19 17:05:47 +02:00 committed by Olivier Goffart
parent 172dcfa775
commit f4dd08783c

View file

@ -339,7 +339,7 @@ struct ModelChangeListener
using ModelPeer = std::weak_ptr<ModelChangeListener>;
template<typename M>
auto access_array_index(const M &model, size_t index)
auto access_array_index(const std::shared_ptr<M> &model, size_t index)
{
if (!model) {
return decltype(*model->row_data_tracked(index)) {};
@ -351,7 +351,8 @@ auto access_array_index(const M &model, size_t index)
}
template<typename M>
long int model_length(const M &model) {
long int model_length(const std::shared_ptr<M> &model)
{
if (!model) {
return 0;
} else {