Upvote!
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
qaz@lemmy.world to Programmer Humor@programming.devEnglish · 6 months ago

The C++ experience

lemmy.world

message-square
14
fedilink
131

The C++ experience

lemmy.world

qaz@lemmy.world to Programmer Humor@programming.devEnglish · 6 months ago
message-square
14
fedilink
alert-triangle
You must log in or # to comment.
  • bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    23
    ·
    6 months ago

    0 3 * * * reboot

  • MyNameIsRichard@lemmy.ml
    link
    fedilink
    arrow-up
    20
    arrow-down
    2
    ·
    6 months ago

    There’s always a destructor though. It may do nothing but it’s there.

    • Valmond@lemmy.world
      link
      fedilink
      arrow-up
      16
      ·
      6 months ago

      No need to declare it though ofc.

      Rule of 0/3/5

      • MyNameIsRichard@lemmy.ml
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        6 months ago

        Yeah the compiler generates it so it’s always there

        • Valmond@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          6 months ago

          Well yes, except when you allocate stuff in the constructor.

          • MyNameIsRichard@lemmy.ml
            link
            fedilink
            arrow-up
            4
            ·
            6 months ago

            The compiler will still generate one. It won’t be any use but it will be generated :)

            • Valmond@lemmy.world
              link
              fedilink
              arrow-up
              2
              arrow-down
              1
              ·
              6 months ago

              Well no because if you allocate stuff in the constructor, you are going to write a destructor now, freeing that allocated stuff up / closing that socket, pipe whatever etc.

              Right?

              Right??

              • MyNameIsRichard@lemmy.ml
                link
                fedilink
                arrow-up
                4
                ·
                edit-2
                6 months ago

                If I do it straight after the constructor, then definitely but if I get distracted by something else then it’s only probably until I run it through valgrind and see the leak. These days, I mostly use smart pointers in new code though so there are fewer opportunities to need a destructor. It’s funny that I never forget when opening a file or db connection!

                • Valmond@lemmy.world
                  link
                  fedilink
                  arrow-up
                  5
                  arrow-down
                  3
                  ·
                  6 months ago

                  After the constructor?

                  No need for a destructir bc smart pointers?

                  Man you does not make any sense.

  • Appoxo@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    15
    ·
    6 months ago

    • DaPorkchop_@lemmy.ml
      link
      fedilink
      arrow-up
      4
      ·
      6 months ago

      The longer I look at this the more uncertain I am whether or not this is AI.

      The fingers look weirdly long, but all of the text is actually written and oriented correctly, but the shading across the surface of all the cards seems to change brightness randomly, …

      • Appoxo@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        12
        ·
        6 months ago

        https://youtube.com/shorts/3G8CUUcpsUg

      • SkyeStarfall@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        2
        ·
        6 months ago

        Some people just have unusual features

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 2.28K users / day
  • 4.66K users / week
  • 9.33K users / month
  • 17.8K users / 6 months
  • 1 local subscriber
  • 23.1K subscribers
  • 1.31K Posts
  • 43.1K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.6
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org