Re: [umbrello] [Bug 442134] "const" correctness in Umbrello sources
Robert Hairgrove <[email protected]>
| Newsgroups | gmane.linux.umbrello.devel |
|---|---|
| Message-ID | <[email protected]> |
> The compiler reports > "assignment of member ‘CodeDocument::m_lastTagIndex’ in read-only object". Sounds to me like a reason to declare the member "CodeDocument::m_lastTagIndex" mutable? -- On 08.09.21 21:16, Oliver Kellogg wrote: > https://bugs.kde.org/show_bug.cgi?id=442134 > > --- Comment #1 from Oliver Kellogg <[email protected]> --- > Thanks for making the attachment, it is helpful. > > Minor point: >> File: codedocument.h >> virtual QString getUniqueTag(const QString& prefix = QString()); // const > This one can't be made const due to a side effect this the function body, > > QString CodeDocument::getUniqueTag (const QString& prefix) const > { > [...] > m_lastTagIndex = number; > > The compiler reports > "assignment of member ‘CodeDocument::m_lastTagIndex’ in read-only object". >