From 401dd6bdc0eb6ba2d3fb8112bda3df34a2d73c45 Mon Sep 17 00:00:00 2001 From: silverqx Date: Wed, 14 Jun 2023 15:25:56 +0200 Subject: [PATCH] made some methods const --- include/orm/tiny/types/modelscollection.hpp | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/orm/tiny/types/modelscollection.hpp b/include/orm/tiny/types/modelscollection.hpp index 8c3281bc8..4a13f51ce 100644 --- a/include/orm/tiny/types/modelscollection.hpp +++ b/include/orm/tiny/types/modelscollection.hpp @@ -242,18 +242,18 @@ namespace Types /*! Run a map over each of the models. */ ModelsCollection map(const std::function &callback); + size_type)> &callback) const; /*! Run a map over each of the models. */ ModelsCollection - map(const std::function &callback); + map(const std::function &callback) const; /*! Run a map over each of the models. */ template QVector map(const std::function &callback); + size_type)> &callback) const; /*! Run a map over each of the models. */ template - QVector map(const std::function &callback); + QVector map(const std::function &callback) const; /*! Run an associative map over each of the models (keyed by primary key). */ std::unordered_map mapWithModelKeys(); @@ -428,9 +428,9 @@ namespace Types /* EnumeratesValues */ /*! Get the collection of models as a vector with serialized models. */ - QVector> toVector(); + QVector> toVector() const; /*! Get the collection of models as a map with serialized models. */ - QVector toMap(); + QVector toMap() const; /*! Create a collection of all models that do not pass a given truth test. */ ModelsCollection @@ -1029,7 +1029,7 @@ namespace Types ModelsCollection::ModelRawType> ModelsCollection::map( const std::function &callback) + size_type)> &callback) const { const auto size = this->size(); @@ -1046,7 +1046,7 @@ namespace Types template ModelsCollection::ModelRawType> ModelsCollection::map( - const std::function &callback) + const std::function &callback) const { const auto size = this->size(); @@ -1063,7 +1063,7 @@ namespace Types template QVector ModelsCollection::map( - const std::function &callback) + const std::function &callback) const { const auto size = this->size(); @@ -1087,7 +1087,7 @@ namespace Types template QVector ModelsCollection::map( - const std::function &callback) + const std::function &callback) const { const auto size = this->size(); @@ -1819,7 +1819,7 @@ namespace Types template QVector> - ModelsCollection::toVector() + ModelsCollection::toVector() const { return map>([](ModelRawType &&model) { @@ -1829,7 +1829,7 @@ namespace Types template QVector - ModelsCollection::toMap() + ModelsCollection::toMap() const { return map([](ModelRawType &&model) {