Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotBM to Hacker NewsEnglish · 2 hours ago

In C++, = default and {} are not the same constructor

lemire.me

external-link
message-square
1
link
fedilink
1
external-link

In C++, = default and {} are not the same constructor

lemire.me

RSS BotBM to Hacker NewsEnglish · 2 hours ago
message-square
1
link
fedilink
You can write an empty default constructor as span() = default or as span() {}. It can have remarkable effects on performance. struct span { const char *p; int len; const char *end; span() = default; // or span() {} span(const char *s, int n) : p(s), len(n), end(s + n) {} }; The constructor … Continue reading In C++, = default and {} are not the same constructor

Comments

alert-triangle
You must log in or register to comment.
  • Gladaed@feddit.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 hours ago

    Same goes for A + B and B + A.

Hacker News

hackernews

Subscribe from Remote Instance

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: !hackernews@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

NOTICE: The bot occasionally has downtime, sorry about that. I’m working on adding better monitoring and error recovery so I can get notified faster.

Posts from the RSS Feed of HackerNews.

The feed sometimes contains ads and posts that have been removed by the mod team at HN.

Source of the RSS Bot.

Visibility: Public
globe

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

  • 821 users / day
  • 1.91K users / week
  • 4.18K users / month
  • 8.79K users / 6 months
  • 2 local subscribers
  • 5.85K subscribers
  • 66.1K Posts
  • 36.5K Comments
  • Modlog
  • mods:
  • patrick
  • RSS BotB
  • BE: 0.19.21
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org