Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. The myth of smart pointers

The myth of smart pointers

Scheduled Pinned Locked Moved The Insider News
c++phpcomgraphicslounge
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kent Sharkey
    wrote on last edited by
    #1

    Logikal[^]:

    While using std::vector<> is usually good, the opinion expressed on smart pointers is just that, an opinion, and it is baseless. Repeating it is damning generations of C++ programmers to tracking down random crashes.

    Once upon a time, there was a very clever pointer

    J D O 3 Replies Last reply
    0
    • K Kent Sharkey

      Logikal[^]:

      While using std::vector<> is usually good, the opinion expressed on smart pointers is just that, an opinion, and it is baseless. Repeating it is damning generations of C++ programmers to tracking down random crashes.

      Once upon a time, there was a very clever pointer

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      To illustrate why this is bad, I will write the worst possible contrived code.

      1 Reply Last reply
      0
      • K Kent Sharkey

        Logikal[^]:

        While using std::vector<> is usually good, the opinion expressed on smart pointers is just that, an opinion, and it is baseless. Repeating it is damning generations of C++ programmers to tracking down random crashes.

        Once upon a time, there was a very clever pointer

        D Offline
        D Offline
        Daniel Pfeffer
        wrote on last edited by
        #3

        In other news, poor design using smart pointers causes crash.

        Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

        1 Reply Last reply
        0
        • K Kent Sharkey

          Logikal[^]:

          While using std::vector<> is usually good, the opinion expressed on smart pointers is just that, an opinion, and it is baseless. Repeating it is damning generations of C++ programmers to tracking down random crashes.

          Once upon a time, there was a very clever pointer

          O Offline
          O Offline
          obermd
          wrote on last edited by
          #4

          Here's a picture of a smart pointer. [https://www.livelife.guide/wp-content/uploads/2018/03/Ariege-Pointer2.jpg\](https://www.livelife.guide/wp-content/uploads/2018/03/Ariege-Pointer2.jpg)

          K 1 Reply Last reply
          0
          • O obermd

            Here's a picture of a smart pointer. [https://www.livelife.guide/wp-content/uploads/2018/03/Ariege-Pointer2.jpg\](https://www.livelife.guide/wp-content/uploads/2018/03/Ariege-Pointer2.jpg)

            K Offline
            K Offline
            Kent Sharkey
            wrote on last edited by
            #5

            The smartest and goodest pointer! :-D

            TTFN - Kent

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups