[clazy] [Bug 356699] detaching-member: don't warn when non-const method is called on item

Sergio Martins via KDE Bugzilla bugzilla_noreply at kde.org
Mon Dec 14 22:51:45 GMT 2015


https://bugs.kde.org/show_bug.cgi?id=356699

--- Comment #3 from Sergio Martins <smartins at kde.org> ---
you can use .at(0), which doesn't detach:

#include <QVector>
#include <QDebug>

struct T
{
    void nonConst()
    {
        qDebug() << "T::nonConst";
    }
};

int main()
{
    QVector<T*> vec = {new T()};
    vec.at(0)->nonConst();

    return 0;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Unassigned-bugs mailing list