Skip to content

Where possible, QList member functions should be marked with const #16

@aatwo

Description

@aatwo

Where possible, QList member functions that do not modify the QList should be marked with const. For example size(), length(). At present, the following simple function prototype will produce a compilation error:

void update(const QList<MyStruct>& myList)
{
  ...
}

The workaround (removing the const qualifier) is unsafe because the update() function can now modify the list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions