Golang-like defer operation in C++

This page summarizes the projects mentioned and recommended in the original post on /r/cpp

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • C-Python-like-Decorators

    How to write decorator functions in modern C++

    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.

  • C-Golang-like-Defer

    Discontinued Cursed defer() method in C++ achieves similar results as Go's defer keyword.

    Run the program in your browser at Godbolt Fork the code

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • GSL

    Guidelines Support Library

    Yeah which is basically final_action. Here is Microsoft's implementation: https://github.com/microsoft/GSL/blob/main/include/gsl/util

  • defer.hpp

    Go's defer implementation in C++17

    https://github.com/BlackMATov/defer.hpp Here is my variant of the defer implementation :-)

  • abseil-cpp

    Abseil Common Libraries (C++)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts