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

C++26 Contracts: Introduction to Preconditions and Postconditions

www.cppstories.com

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

C++26 Contracts: Introduction to Preconditions and Postconditions

www.cppstories.com

RSS BotBM to Hacker NewsEnglish · 24 days ago
message-square
0
link
fedilink
In the article about Standard Library hardening, we looked at checks for invalid Standard Library container access and other broken preconditions. I mentioned that those requirements are expressed in terms of “contracts”. But what about our code? In this post, we’ll explore contracts from C++26. We’ll start with a simple cassert, move the requirement into the function itself, and see how to check results.

Comments

alert-triangle
You must log in or register to comment.

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.

  • 901 users / day
  • 2.08K users / week
  • 4.05K users / month
  • 8.79K users / 6 months
  • 2 local subscribers
  • 5.73K subscribers
  • 64.7K Posts
  • 35.5K Comments
  • Modlog
  • mods:
  • patrick
  • RSS BotB
  • BE: 0.19.21
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org