C++

2068 readers
5 users here now

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

Rules

founded 2 years ago
MODERATORS
126
 
 

The last in a series of blog posts on a C++ technique that I've put to use for a numerical library. Was a fun little exercise, sharing here.

127
128
129
130
131
132
133
134
 
 

This talk assumes no prior knowledge of functional programming.

135
 
 

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

136
 
 

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

137
138
 
 

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

139
 
 

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

140
 
 

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.

141
 
 

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.

142
 
 

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!

143
 
 

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

144
 
 

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

145
146
147
 
 

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

148
 
 

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.

149
150
view more: ‹ prev next ›