• "C++ Smart Pointers and Arrays" by Bartlomiej Filipek

    From Lynn McGuire@21:1/5 to All on Tue Oct 26 15:55:09 2021
    "C++ Smart Pointers and Arrays" by Bartlomiej Filipek
    https://www.cppstories.com/2021/smartptr-array/

    "Smart pointers are very versatile and can hold pointers not only to
    single instances but also to arrays. Is that only a theoretical use
    case? or maybe they might be handy in some cases? Let’s have a look."

    Lynn

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard@21:1/5 to All on Mon Nov 8 20:20:21 2021
    [Please do not mail me a copy of your followup]

    Lynn McGuire <lynnmcguire5@gmail.com> spake the secret code <sl9pvf$rcv$1@dont-email.me> thusly:

    "C++ Smart Pointers and Arrays" by Bartlomiej Filipek
    https://www.cppstories.com/2021/smartptr-array/

    "Smart pointers are very versatile and can hold pointers not only to
    single instances but also to arrays. Is that only a theoretical use
    case? or maybe they might be handy in some cases? Let’s have a look."

    It's so useful they called it std::vector.
    (No, I have not read the article)
    --
    "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
    The Terminals Wiki <http://terminals-wiki.org>
    The Computer Graphics Museum <http://computergraphicsmuseum.org>
    Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to All on Mon Nov 8 23:16:04 2021
    08.11.2021 22:20 Richard kirjutas:
    [Please do not mail me a copy of your followup]

    Lynn McGuire <lynnmcguire5@gmail.com> spake the secret code <sl9pvf$rcv$1@dont-email.me> thusly:

    "C++ Smart Pointers and Arrays" by Bartlomiej Filipek
    https://www.cppstories.com/2021/smartptr-array/

    "Smart pointers are very versatile and can hold pointers not only to
    single instances but also to arrays. Is that only a theoretical use
    case? or maybe they might be handy in some cases? Let’s have a look."

    It's so useful they called it std::vector.
    (No, I have not read the article)

    +1

    That said, I have had some situations where the profiler identified the
    zero initialization of a std::vector as a bottleneck. My solution was to
    define a "noinit_buffer" class using malloc(), but in retrospect this
    feels much like C++20's std::make_unique_for_overwrite<T[]>(n).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)