Improving C++: Adding defer from Go

The problem

C-style solution: Goto

C++ style solution: Managed Objects

Go-style solution: Defer

C++ defer implementation

--

--

--

A software specialist passionate about elegant and efficient technology. I Love learning and sharing my knowledge.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Deploy Serverless Django to AWS Lambda

Version Control Systems: Source Code Banking

Daily Scrum — a 3-min overview

10 Tips to Help You Stand Out as a Java Developer

#100DaysOfCode Day 11: Password Reset, Creating Unit Tests, Circular Dependency, Test Isolation.

RMS, titanic

Best Practices to Stay Safe with GitHub

Incident Management

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Daniel Trugman

Daniel Trugman

A software specialist passionate about elegant and efficient technology. I Love learning and sharing my knowledge.

More from Medium

Understanding Golang “Concurrency” using Arduino UNO.

Coding Problems, TDD, and CI

Using Delve Debugger to Inspect and Analyze Go Programs

Reinvent the Wheel Ep. 1: Removing Unused Files