кто-то может сказать зачем эти альтернативно одарённые скрыли перегрузки в документации? Чтобы ИИ запутать?
#if !defined(Q_QDOC)
[[nodiscard]] QByteArray toLower() const &
{ return toLower_helper(*this); }
[[nodiscard]] QByteArray toLower() &&
{ return toLower_helper(*this); }
[[nodiscard]] QByteArray toUpper() const &
{ return toUpper_helper(*this); }
[[nodiscard]] QByteArray toUpper() &&
{ return toUpper_helper(*this); }
[[nodiscard]] QByteArray trimmed() const &
{ return trimmed_helper(*this); }
[[nodiscard]] QByteArray trimmed() &&
{ return trimmed_helper(*this); }
[[nodiscard]] QByteArray simplified() const &
{ return simplified_helper(*this); }
[[nodiscard]] QByteArray simplified() &&
{ return simplified_helper(*this); }
#else
[[nodiscard]] QByteArray toLower() const;
[[nodiscard]] QByteArray toUpper() const;
[[nodiscard]] QByteArray trimmed() const;
[[nodiscard]] QByteArray simplified() const;
#endif
Имеем такой код:
for (QByteArray line: data.split('\n'))
{
line = std::move(line).trimmed();
Нормальный человек посмотрит в документацию — перегрузки для && нет — уберёт std::move как излишний и на ровном месте ухудшит производительность.