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. The Lounge
  3. The joys of friendship

The joys of friendship

Scheduled Pinned Locked Moved The Lounge
c++design
9 Posts 7 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.
  • R Offline
    R Offline
    Rama Krishna Vavilala
    wrote on last edited by
    #1

    After 10 years or so, I finally got to use friend in C++ again.

    friend class CAppDocument;

    An extremely specialized case where I could not think of any other way to have a clean design.

    S CPalliniC E C D 5 Replies Last reply
    0
    • R Rama Krishna Vavilala

      After 10 years or so, I finally got to use friend in C++ again.

      friend class CAppDocument;

      An extremely specialized case where I could not think of any other way to have a clean design.

      S Offline
      S Offline
      Single Step Debugger
      wrote on last edited by
      #2

      I’m familiar with the concept and have seen it in others code, but after almost 10 years I’ve never used it myself. I suppose this makes me friend virgin.

      There is only one Vera Farmiga and Salma Hayek is her prophet! Advertise here – minimum three posts per day are guaranteed.

      X 1 Reply Last reply
      0
      • R Rama Krishna Vavilala

        After 10 years or so, I finally got to use friend in C++ again.

        friend class CAppDocument;

        An extremely specialized case where I could not think of any other way to have a clean design.

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        Now the CAppDocument is expected to speak evil of the other class.

        Veni, vidi, vici.

        In testa che avete, signor di Ceprano?

        E 1 Reply Last reply
        0
        • S Single Step Debugger

          I’m familiar with the concept and have seen it in others code, but after almost 10 years I’ve never used it myself. I suppose this makes me friend virgin.

          There is only one Vera Farmiga and Salma Hayek is her prophet! Advertise here – minimum three posts per day are guaranteed.

          X Offline
          X Offline
          Xiangyang Liu
          wrote on last edited by
          #4

          Deyan Georgiev wrote:

          but after almost 10 years I’ve never used it myself

          Me neither. They say I am unfriendly. :-D

          My Younger Son & His "PET"

          1 Reply Last reply
          0
          • CPalliniC CPallini

            Now the CAppDocument is expected to speak evil of the other class.

            Veni, vidi, vici.

            E Offline
            E Offline
            Espen Harlinn
            wrote on last edited by
            #5

            I'll try to remember that one :laugh:

            Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile

            1 Reply Last reply
            0
            • R Rama Krishna Vavilala

              After 10 years or so, I finally got to use friend in C++ again.

              friend class CAppDocument;

              An extremely specialized case where I could not think of any other way to have a clean design.

              E Offline
              E Offline
              Espen Harlinn
              wrote on last edited by
              #6

              I've always found friend to be quite useful.

              Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile

              1 Reply Last reply
              0
              • R Rama Krishna Vavilala

                After 10 years or so, I finally got to use friend in C++ again.

                friend class CAppDocument;

                An extremely specialized case where I could not think of any other way to have a clean design.

                C Offline
                C Offline
                Chris Maunder
                wrote on last edited by
                #7

                I'm still waiting for the new sworn enemy modifier in C# 6.0, as well as the betray operator in the dynamic extensions that will allow a friend class to change at runtime into a sworn enemy class

                cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

                E 1 Reply Last reply
                0
                • C Chris Maunder

                  I'm still waiting for the new sworn enemy modifier in C# 6.0, as well as the betray operator in the dynamic extensions that will allow a friend class to change at runtime into a sworn enemy class

                  cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

                  E Offline
                  E Offline
                  Espen Harlinn
                  wrote on last edited by
                  #8

                  Is this a proposal? ;)

                  Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile

                  1 Reply Last reply
                  0
                  • R Rama Krishna Vavilala

                    After 10 years or so, I finally got to use friend in C++ again.

                    friend class CAppDocument;

                    An extremely specialized case where I could not think of any other way to have a clean design.

                    D Offline
                    D Offline
                    Diagon Alley
                    wrote on last edited by
                    #9

                    C++ - the only place where friends can access your privates ;P

                    If you need a hammer get C and shut up. If you need a nail gun get C++ and shut up. If you don't need *those* things (and good design should tell you) then by all means get a factory, factory, factory. --code-frog Why would you need to date, when C++ is your soul mate?! --Steve Echols

                    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