226
24
227
12
228
6
229
4
230
18
231
11
232
11

This talk assumes no prior knowledge of functional programming.

233
19

I did a code that uses custom literals to allow indexing arrays with ordinals (1st, 2nd, 3rd), all at compile time. Additionally _st works only with 1, _nd only with 2, _rd only with 3. Zero and negative numbers are also not supported and fail compilation.

https://github.com/serpent7776/bits/blob/master/th.cpp/th.cpp

234
9

The spaceship operator took me longer than it should (my mistake). A note to my future self, and maybe of use to you.

235
5
236
6

From last year's CppCon, posted just 4 hours ago. A nice discussion about CTAD, how it works, deduction guides and some pitfalls.

237
8

Another great "back to basics", by the great O'Dwyer. Definitely a must-watch for those still struggling with C++ smart pointers.

238
12

The intersection of forwarding references and overload resolution has been bugging me, and I've been caught out a few times on the wrong overload, so here's an idea.

239
7
submitted 2 years ago* (last edited 10 months ago) by herzenschein@pawb.social to c/cpp@programming.dev

Best resource I've seen out there for template basics. It even briefly mentions variadic templates, concepts that are easy to understand, auto in function parameters (a.k.a. abbreviated function templates) and how to find out what type is chosen when you do class template automatic deduction (CTAD).

I feel like this is an absolute must-watch if you want to know about modern template practices.

240
6
submitted 2 years ago* (last edited 2 years ago) by AlmightySnoo@lemmy.world to c/cpp@programming.dev

C++03 does feel ancient now, but the sizeof trick to simulate what you could do today with std::void_t and decltype (or simply concepts since C++20) definitely blew me away!

241
1

The talk goes over compile-time parsing using Boost.MetaParse, Lexy, CTRE, CTPG and Macro Rules, and how it fits in with reflection.

242
11
submitted 2 years ago* (last edited 10 months ago) by herzenschein@pawb.social to c/cpp@programming.dev

I quite liked this talk. Especially where Vincent talks about aggregate initialization, invariants and avoiding invalid values.

243
7
244
10
245
11
submitted 2 years ago* (last edited 2 years ago) by AlmightySnoo@lemmy.world to c/cpp@programming.dev

The talk goes over std::any, std::variant, std::tuple, CRTP and deducing this.

246
15

Hello!

I've been working on this language for the past 5 years, ArkScript, which is:

  • as small as I could (language wise, 10 keywords, nothing I deemed too specific/useless)
  • running on a VM, compile once run anywhere, just ship your bytecode
  • can be used as a scripting language on its own, like python (though it's not its strength)
  • easy to embed, made in c++ 17 with simplicity in mind

I'm currently working on the v4 (I screwed up with the semver), redoing the imports syntax, and currently cleaning the code and rewriting all the unit tests using boosr-ext/ut.

I'm open to criticism, suggestions, discussions on how to enhance it, or just questions on that weird project.

247
9
248
7
submitted 2 years ago by ylai@lemmy.ml to c/cpp@programming.dev
249
7

KCP is an algorithmic transport protocol which provides reliability and sequencing for unreliable channels like UDP. By algorithmic it means it doesn't care about sockets, and even clock has to be provided externally.

It uses fast acknowledgements and has basic congestion+flow control, has an overhead of 24 bytes per packet/ack, but survives bad network conditions much better than TCP and doesn't require retransmitting all packets after the lost one, making it viable for realtime games.

Original code is written in C and hasn't been updated for a while so I decided to bring my own spin. Also fixed several bugs in the meantime.

This is my personal project which is currently in active development, but it has passed internal tests in our team and is considered semi-ready for production use. Basic tests for sanity checks are included.

250
9
submitted 2 years ago by ylai@lemmy.ml to c/cpp@programming.dev
view more: ‹ prev next ›

C++

2365 readers
1 users here now

The center for all discussion and news regarding C++.

Rules

founded 3 years ago
MODERATORS