Should I use QScopedPointer or std::unique_ptr?

后端 未结 3 2244
后悔当初
后悔当初 2021-02-19 10:59

I\'m starting a new project, using Qt5 and QMAKE_CXXFLAGS += -std=c++1y. I\'m not sure whether I should prefer QScopedPointer or std::unique_ptr

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 11:24

    Why would you use something that's not from the standard library compared to something from the standard library?

    To me there's only one reason any good programmer would do that: If the external library provides something that the standard library doesn't provide. Is that the case?

    Consider your program's portability and updates in the future, and then make that decision.

提交回复
热议问题