C-Python-like-Decorators VS GSL

Compare C-Python-like-Decorators vs GSL and see what are their differences.

C-Python-like-Decorators

How to write decorator functions in modern C++ (by TheMaverickProgrammer)

GSL

Guidelines Support Library (by microsoft)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
C-Python-like-Decorators GSL
2 22
157 5,944
- 1.5%
1.8 6.2
over 3 years ago 29 days ago
C++ C++
- GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.

C-Python-like-Decorators

Posts with mentions or reviews of C-Python-like-Decorators. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-01-18.
  • Golang-like defer operation in C++
    5 projects | /r/cpp | 18 Jan 2022
    When I learn a new programming language, I find little gems in them that I really wish C++ had. I've made a write-up before on making Python-like function decorators in modern C++ with no macro magic, but today I have been inspired by the Go programming language's defer keyword.
  • Are Metaclasses still coming to C++?
    2 projects | /r/cpp | 21 Sep 2021
    For example you could do a poor man's decorator by wrapping functions in C++: https://github.com/TheMaverickProgrammer/C-Python-like-Decorators

GSL

Posts with mentions or reviews of GSL. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-05-24.
  • 60 terrible tips for a C++ developer
    1 project | /r/cpp | 27 Jun 2023
    Already showed you how to use ranges and such above, gsl::final_action is here
  • Backward compatible implementations of newer standards constructs?
    5 projects | /r/cpp_questions | 24 May 2023
    For span I would recommend the guideline support library - gsl::span
  • Hey Rustaceans! Got a question? Ask here (20/2023)!
    4 projects | /r/rust | 15 May 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
    2 projects | /r/cpp | 30 Mar 2023
    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.
    6 projects | /r/programming | 18 Feb 2023
    Another solution: use std::span (or some alternative implementations if the codebase doesn't use C++20).
  • C++23 “Pandemic Edition” is complete
    5 projects | news.ycombinator.com | 14 Feb 2023
    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
    4 projects | news.ycombinator.com | 3 Dec 2022
    > 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
    3 projects | /r/cpp | 16 Sep 2022
  • I created a memory leak using smart pointers
    1 project | /r/cpp_questions | 27 Aug 2022
    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
    1 project | /r/ProgrammerHumor | 8 Aug 2022
    I instead use the GSL and the Core Guidelines, where

What are some alternatives?

When comparing C-Python-like-Decorators and GSL you can also consider the following projects:

C-Golang-like-Defer - Cursed defer() method in C++ achieves similar results as Go's defer keyword.

CppCoreGuidelines - The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++

papers - ISO/IEC JTC1 SC22 WG21 paper scheduling and management

cppinsights - C++ Insights - See your source code with the eyes of a compiler

defer.hpp - Go's defer implementation in C++17

sentry-native - Sentry SDK for C, C++ and native applications.

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++.

score-simple-api-2

CppCon2018 - Slides and other materials from CppCon 2018

boost - My personal boost mirror to be submoduled by my projects

span-lite - span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only library