cppinsights
GSL
cppinsights | GSL | |
---|---|---|
24 | 22 | |
3,555 | 5,956 | |
- | 0.8% | |
8.1 | 5.9 | |
23 days ago | about 1 month ago | |
C++ | C++ | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cppinsights
-
C++ Insights – See your source code with the eyes of a compiler
Sorry, I don't know about an Emacs plugin. All the plugins/extensions I'm aware of are listed in the Readme.md: https://github.com/andreasfertig/cppinsights/#c-insights--vi...
I'm happy to add an entry for Emacs once somebody develops a plugin for that editor.
-
C++20 Idioms for Parameter Packs
Thank you! This is exactly the sort of thing I was looking for.
I found the source at https://github.com/andreasfertig/cppinsights
-
Why does ![]{} equate to 0?
You can put it into https://cppinsights.io/ and see the conversions that happen under the hood.
- C++ lernen
-
BitMasks in 2023
I tried this at https://cppinsights.io/ to see what is generated for something like:
-
Ask HN: Best way to learn C++ in 2022
> https://cppinsights.io/ it's a must so you can investigate what gets generated by templates behind the scenes.
> http://eel.is/c++draft/ bookmark this, you will need it!
Now, about books I would suggest the latest "A tour of C++" by Bjarne Stroustrup; it's ideal for experienced programmers that want to learn modern C++ rather fast.
Other books would be Scott Meyers' Effective Series, Andrei Alexandrescu and Herb Sutter are a must, and of course Jason Turner's "C++ Weekly" series [1]; of course apart from the books, the links I have originally shared are more than enough to cover everything around C++.
[1] https://www.youtube.com/c/lefticus1/videos
-
Ask HN: Where can I find C++ by Example?
https://cppinsights.io/ it's a must so you can investigate what gets generated by templates behind the scenes.
-
Ask HN: Any tool to look C++ interpretation template form syntax to substitution
Try https://cppinsights.io. For example, go to https://cppinsights.io/s/8401262a and click the play button at the top left.
If you're doing something more complex, you might need metashell. See http://metashell.org/manual/how_to/index.html#see-what-templ.... But you have to really, deeply, love C++ to get much out of it.
- Question on a For each loop.
- Can anyone recommend a good book/resource on C++/C++ compilers? With detailed discussions of what happens "under the hood".
GSL
-
60 terrible tips for a C++ developer
Already showed you how to use ranges and such above, gsl::final_action is here
-
Backward compatible implementations of newer standards constructs?
For span I would recommend the guideline support library - gsl::span
-
Hey Rustaceans! Got a question? Ask here (20/2023)!
Not sure how things are at this point so you might want to look up with those keywords, but a few years back clang-tidy was one of the suggested tools, or enabling the core guidelines checker in visual studio if you're using that. Maybe using GSL or something similar as well.
-
Hardening C++ with Bjarne Stroustrup
When I want safety guarantees, I use the original and run-time checked gsl::span, rather than std::span. https://github.com/microsoft/GSL .
-
I love building a startup in Rust. I wouldn't pick it again.
Another solution: use std::span (or some alternative implementations if the codebase doesn't use C++20).
-
C++23 “Pandemic Edition” is complete
If you ask me, the GSL [1] alone is a fairly radical departure from C++ that delivers a lot of safety. I don't know if it's gotten much popularity, though. Probably because it introduces a similar disruption like you might find from a brand new programming language.
[1] https://github.com/microsoft/GSL
-
Using Rust at a startup: A cautionary tale
> With Rust, though, one needs to learn entirely new ideas — things like lifetimes, ownership, and the borrow checker. These are not familiar concepts to most people working in other common languages ... Some of those “new” ideas are, of course, present in other languages — especially functional ones.
With C++, lifetime and ownership are just about as important but unfortunately no one's got your back. You can ignore lifetimes and ownership but you do so at your own peril. And the compiler won't tell you you're doing it wrong because the language wasn't designed for it to do so.
If you want a taste of rust's "mindset" (with respect to limitations imposed by some types) without jumping ship to a new language, try C++'s Guidelines Support Library [1]. It introduces some of the same benefits/friction as switching to rust but without a new language. Opting-in to some of these guidelines might be a gentler way to get some of the benefits of Rust. But it comes with a similarly higher bar.
[1] https://github.com/microsoft/GSL
- Passing a std:: array as a function parameter
-
I created a memory leak using smart pointers
It's also far more verbose than T* or T& (probably intentionally). If you really want a non-nullable pointer, gsl::not_null from the GSL is a good option. Writing your own version is also trivial, if you don't want to add a dependency.
-
I wanna go back to work at a car assembly plant
I instead use the GSL and the Core Guidelines, where
What are some alternatives?
LLVM-Guide - LLVM (Low Level Virtual Machine) Guide. Learn all about the compiler infrastructure, which is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs. Originally implemented for C/C++ , though, has a variety of front-ends, including Java, Python, etc.
CppCoreGuidelines - The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++
lsif-clang - Language Server Indexing Format (LSIF) generator for C, C++ and Objective C
sentry-native - Sentry SDK for C, C++ and native applications.
gcem - A C++ compile-time math library using generalized constant expressions
cpp-core-guidelines-cheatsheet - Cheatsheet for the C++ core guidelines, including a set of tried-and-true guidelines, rules, and best practices about coding in C++.
fccf - fccf: A command-line tool that quickly searches through C/C++ source code in a directory based on a search string and prints relevant code snippets that match the query.
C-Golang-like-Defer - Cursed defer() method in C++ achieves similar results as Go's defer keyword.
Xoshiro-cpp - Header-only Xoshiro/Xoroshiro PRNG wrapper library for modern C++ (C++17/C++20)
score-simple-api-2
opencilk-project - Monorepo for the OpenCilk compiler. Forked from llvm/llvm-project and based on Tapir/LLVM.
C-Python-like-Decorators - How to write decorator functions in modern C++