Immutable QList
Solved
General and Desktop
-
@diredko
Hello.I wonder if there is a way to get immutable list from regular QList.
Is that what you're after?
QList<int> mutableList; const QList<int> & immutableList = mutableList;
A fail-safe list is better
What do you mean by fail-safe list?
-
Thanks for your reply)
I'd like to provide some clarifications:
By saying "immutable" I meant that after some elements are added to this list, its content cannot be modified - add, remove and insert operations are prohibited or just won't take any effect.
By saying "fails-safe" I meant that whenever such an operation is called on immutable list no application failure will arise and no exception will be thrown.