Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
Next

Chapter 1. Boost.ScopeExit

Alexander Nasonov

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt )

Table of Contents

Introduction
Tutorial
Alternatives
Supported Compilers
Configuration
Reference
Acknowledge

Introduction

Nowadays, every C++ developer is familiar with RAII technique. It binds resource acquisition and release to initialization and destruction of a variable that holds the resource. But there are times when writing a special class for such variable is not worth the effort.

This is when ScopeExit macro comes into play. You put resource acquisition directly in your code and next to it you write a code that releases the resource.

Read Tutorial to find out how to write programs with ScopeExit or jump straight to the Reference section.

Last revised: January 28, 2009 at 15:23:21 GMT


Next