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. General Programming
  3. C / C++ / MFC
  4. Question on boost weak pointers

Question on boost weak pointers

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++com
9 Posts 3 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.
  • M Offline
    M Offline
    minkowski
    wrote on last edited by
    #1

    Hi, Have a quick question on Boost weak pointers. Hope this is the place to ask. I found the article Smart Pointers to boost your code[^] and on the paragraph "cyclic references" in the code there is the line child->myDad = dad; where does the dad come from? Can't seem to see it defined anywhere in the code. Thanks for any information.

    T S 2 Replies Last reply
    0
    • M minkowski

      Hi, Have a quick question on Boost weak pointers. Hope this is the place to ask. I found the article Smart Pointers to boost your code[^] and on the paragraph "cyclic references" in the code there is the line child->myDad = dad; where does the dad come from? Can't seem to see it defined anywhere in the code. Thanks for any information.

      T Offline
      T Offline
      tolw
      wrote on last edited by
      #2

      I think it's just a typo. Should be:

      child->myDad = parent;

      EDIT: You can download the sources just to be certain :)

      M 2 Replies Last reply
      0
      • T tolw

        I think it's just a typo. Should be:

        child->myDad = parent;

        EDIT: You can download the sources just to be certain :)

        M Offline
        M Offline
        minkowski
        wrote on last edited by
        #3

        Ha ha, yes I did think it should be parent. Thanks!

        1 Reply Last reply
        0
        • M minkowski

          Hi, Have a quick question on Boost weak pointers. Hope this is the place to ask. I found the article Smart Pointers to boost your code[^] and on the paragraph "cyclic references" in the code there is the line child->myDad = dad; where does the dad come from? Can't seem to see it defined anywhere in the code. Thanks for any information.

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          Why not post this message on that article rather than here? Looking at the article, I think that's a typo - dad should be parent

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          M 1 Reply Last reply
          0
          • S Stuart Dootson

            Why not post this message on that article rather than here? Looking at the article, I think that's a typo - dad should be parent

            Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

            M Offline
            M Offline
            minkowski
            wrote on last edited by
            #5

            Hmmm, if it was a typo to put "dad" instead of "parent", then is the diagram showing dad pointing to the CDad struct a mistake as well?

            S 1 Reply Last reply
            0
            • T tolw

              I think it's just a typo. Should be:

              child->myDad = parent;

              EDIT: You can download the sources just to be certain :)

              M Offline
              M Offline
              minkowski
              wrote on last edited by
              #6

              Actually, if it was a typo then why does the diagram underneath refer to "dad" and the dad.reset() ? Surely that can't be a typo as well?

              T 1 Reply Last reply
              0
              • M minkowski

                Hmmm, if it was a typo to put "dad" instead of "parent", then is the diagram showing dad pointing to the CDad struct a mistake as well?

                S Offline
                S Offline
                Stuart Dootson
                wrote on last edited by
                #7

                He probably used dad and son or boy throughout, then tried to remove the gender specificness as it could be seen as discriminatory? :-)

                Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                M 1 Reply Last reply
                0
                • S Stuart Dootson

                  He probably used dad and son or boy throughout, then tried to remove the gender specificness as it could be seen as discriminatory? :-)

                  Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                  M Offline
                  M Offline
                  minkowski
                  wrote on last edited by
                  #8

                  Hmmm, thats confusing! :confused: I'll try and email the author (if thats possible) as it is a good article and I want to get my head round it. Thanks !

                  1 Reply Last reply
                  0
                  • M minkowski

                    Actually, if it was a typo then why does the diagram underneath refer to "dad" and the dad.reset() ? Surely that can't be a typo as well?

                    T Offline
                    T Offline
                    tolw
                    wrote on last edited by
                    #9

                    As I said before - you really should download the sources first. The code will probably clear things up :)

                    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