Poeng.link
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Hellfire103@lemmy.ca to Programmer Humor@lemmy.mlEnglish · 3 months ago

Does this exist anywhere outside of C++?

lemmy.ml

message-square
60
link
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
176

Does this exist anywhere outside of C++?

lemmy.ml

Hellfire103@lemmy.ca to Programmer Humor@lemmy.mlEnglish · 3 months ago
message-square
60
link
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
  • SpaceNoodle@lemmy.worldBanned
    link
    fedilink
    arrow-up
    50
    ·
    edit-2
    27 days ago

    Removed by mod

    • Oriel Jutty :hhHHHAAAH:@infosec.exchange
      link
      fedilink
      arrow-up
      36
      ·
      3 months ago

      std::endl provides zero portability benefits. C++ does have a portable newline abstraction, but it is called \n, not endl.

      • Albbi@lemmy.ca
        link
        fedilink
        arrow-up
        49
        ·
        3 months ago

        Thank you two for demonstrating the image in the post so well.

      • SpaceNoodle@lemmy.worldBanned
        link
        fedilink
        arrow-up
        7
        ·
        edit-2
        27 days ago

        Removed by mod

        • Oriel Jutty :hhHHHAAAH:@infosec.exchange
          link
          fedilink
          arrow-up
          16
          ·
          3 months ago

          The same is true of std::endl. std::endl is simply defined as << '\n' << std::flush; nothing more, nothing less. In all cases where endl gives you a “properly translated” newline, so does \n.

          • SpaceNoodle@lemmy.worldBanned
            link
            fedilink
            arrow-up
            7
            ·
            edit-2
            27 days ago

            Removed by mod

            • AnyOldName3@lemmy.world
              link
              fedilink
              arrow-up
              4
              ·
              3 months ago

              It’s controlled by whether the stream’s opened in text mode or binary mode. On Unix, they’re the same, but on Windows, text mode has line ending conversion.

          • zenforyen@feddit.org
            link
            fedilink
            arrow-up
            3
            ·
            3 months ago

            Yeah it’s an artificial dichotomy based on a popular misconception of what std::endl is and how \n is interpreted.

            Ultimately it does not ask about line endings, but about flushing, which is a completely orthogonal question.

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

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: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

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

  • 106 users / day
  • 817 users / week
  • 3.04K users / month
  • 5.19K users / 6 months
  • 1 local subscriber
  • 36.6K subscribers
  • 327 Posts
  • 1.36K Comments
  • Modlog
  • mods:
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org