mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 00:25:35 +08:00
const corrections
This commit is contained in:
@@ -91,7 +91,7 @@ namespace BlackMisc
|
||||
template <class Predicate>
|
||||
bool contains(Predicate p) const
|
||||
{
|
||||
return std::any_of(derived().begin(), derived().end(), p);
|
||||
return std::any_of(derived().cbegin(), derived().cend(), p);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -99,7 +99,7 @@ namespace BlackMisc
|
||||
*/
|
||||
bool contains(const T &object) const
|
||||
{
|
||||
return derived().find(object) != derived().end();
|
||||
return derived().find(object) != derived().cend();
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -156,7 +156,7 @@ namespace BlackMisc
|
||||
{
|
||||
QString str;
|
||||
// qualifying stringify with this-> to workaround bug in GCC 4.7.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56402
|
||||
std::for_each(derived().begin(), derived().end(), [ & ](const T &value) { str += (str.isEmpty() ? "{" : ",") + this->stringify(value, i18n); });
|
||||
std::for_each(derived().cbegin(), derived().cend(), [ & ](const T &value) { str += (str.isEmpty() ? "{" : ",") + this->stringify(value, i18n); });
|
||||
if (str.isEmpty()) { str = "{"; }
|
||||
return str += "}";
|
||||
}
|
||||
@@ -183,7 +183,7 @@ namespace BlackMisc
|
||||
//const auto &o = static_cast<const CContainerBase &>(other);
|
||||
//if (derived().size() < o.derived().size()) { return -1; }
|
||||
//if (derived().size() > o.derived().size()) { return 1; }
|
||||
//for (auto i1 = derived().begin(), i2 = o.derived().begin(); i1 != derived().end() && i2 != o.derived().end(); ++i1, ++i2)
|
||||
//for (auto i1 = derived().cbegin(), i2 = o.derived().cbegin(); i1 != derived().cend() && i2 != o.derived().cend(); ++i1, ++i2)
|
||||
//{
|
||||
// if (*i1 < *i2) { return -1; }
|
||||
// if (*i1 > *i2) { return 1; }
|
||||
@@ -194,7 +194,7 @@ namespace BlackMisc
|
||||
virtual void marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument.beginArray(qMetaTypeId<T>());
|
||||
std::for_each(derived().begin(), derived().end(), [ & ](const T &value) { argument << value; });
|
||||
std::for_each(derived().cbegin(), derived().cend(), [ & ](const T &value) { argument << value; });
|
||||
argument.endArray();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user