> What would you then name a Qt counterpart of std::unique_ptr, considering that
>  QScopedPointer is not such a counterpart?

I'd suggest QUniquePointer. Honestly, I don't think we have too many 
alternatives here. We can try Rust-like naming (something like QBox), but it 
just looks weird and tells nothing about ownership semantics.

After that we can write "using QScopedPointer = QUniquePointer" for people who 
get used to old scoped pointer and want to highlight the fact that a resource 
will be released at the end of the scope. But personally I think we don't need 
to have one more entity without a real reason to do that.

On 31/01/2020, 21:07, "Development on behalf of Ville Voutilainen" 
<development-boun...@qt-project.org on behalf of ville.voutilai...@gmail.com> 
wrote:

    On Fri, 31 Jan 2020 at 21:23, Alberto Mardegan
    <ma...@users.sourceforge.net> wrote:
    >
    > Old man here:
    >
    > On 31/01/20 13:07, Vitaly Fanaskov wrote:
    > > But how to use them in the API and which way is preferable is still
    > > unclear. There are two main options we have:
    > >
    > > 1) Use std::*  smart pointers as-is.
    > >
    > > 2) Add Qt-style wrappers around std::* smart pointers and move old
    > > implementations of Qt smart pointers to the Qt5Compact module.
    >
    > 2.
    >
    > I still have trouble understanding why std::unique_ptr is called like
    > this, whereas I could immediately understand what QScopedPointer does
    > even before reading its documentation.
    
    What would you then name a Qt counterpart of std::unique_ptr, considering 
that
    QScopedPointer is not such a counterpart?
    _______________________________________________
    Development mailing list
    Development@qt-project.org
    https://lists.qt-project.org/listinfo/development
    

_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to