stdlib versus Qt template library
Is there a strong preference for stdlib over the Qt template library? I remember seeing that there was a shift towards std, but I still see a lot of Qt templates in the code. I'm wondering if I should start using std for any new code I write.
Comments
Yes, you should.
The preference is documented (especially with regards to containers and loops) in https://github.com/musescore/MuseScore/blob/master/mscore3.txt#L124
In reply to The preference is documented… by jeetee
OK, I did not know that there was documentation in that file. Thanks for pointing that out.
In reply to The preference is documented… by jeetee
What about qreal? Should I be using double or float?
In reply to What about qreal? Should I… by sideways
IMHO leave qreal, it masks platform diffs
In reply to IMHO leave qreal, it masks… by Jojo-Schmitz
And QString? I kind of like that one. But I have used std::basic_string in the past (almost 2 decades ago now), so I can refresh my memory on it, if necessary.
Or am I taking this too far, and it only applies to container templates? I see plenty of places where I could std instead of Qt.
In reply to And QString? I kind of like… by sideways
QString is used al over the place, so just do that too
In reply to QString is used al over the… by Jojo-Schmitz
I'm only going to change new code for now, certainly anything I put in a PR. I use a lot of collections in my working branch, and I don't want to debug all that right now. I was already using std::set because QSet isn't really a set, which took me by surprise.
I do think this is a positive change for several reasons. Hopefully I'll make the time to convert all my code to stdlib sometime soon.