mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
janitor: C++: make the code more readable by having the type explicit
This commit is contained in:
parent
172dcfa775
commit
f4dd08783c
1 changed files with 3 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue