| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> |
| <title>Chapter 1. Boost.ScopeExit</title> |
| <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> |
| <link rel="home" href="index.html" title="Chapter 1. Boost.ScopeExit"> |
| <link rel="next" href="scope_exit/tutorial.html" title="Tutorial"> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <table cellpadding="2" width="100%"><tr> |
| <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> |
| <td align="center"><a href="../../../../index.html">Home</a></td> |
| <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> |
| <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> |
| <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> |
| <td align="center"><a href="../../../../more/index.htm">More</a></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"><a accesskey="n" href="scope_exit/tutorial.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div> |
| <div class="chapter"> |
| <div class="titlepage"><div> |
| <div><h2 class="title"> |
| <a name="scope_exit"></a>Chapter 1. Boost.ScopeExit</h2></div> |
| <div><div class="author"><h3 class="author"> |
| <span class="firstname">Alexander</span> <span class="surname">Nasonov</span> |
| </h3></div></div> |
| <div><p class="copyright">Copyright © 2006 -2009 Alexander Nasonov</p></div> |
| <div><div class="legalnotice"> |
| <a name="id759689"></a><p> |
| Distributed under the Boost Software License, Version 1.0. (See accompanying |
| file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.org/LICENSE_1_0.txt"> |
| http://www.boost.org/LICENSE_1_0.txt </ulink>) |
| </p> |
| </div></div> |
| </div></div> |
| <div class="toc"> |
| <p><b>Table of Contents</b></p> |
| <dl> |
| <dt><span class="section"><a href="index.html#scope_exit.intro"> Introduction</a></span></dt> |
| <dt><span class="section"><a href="scope_exit/tutorial.html"> Tutorial</a></span></dt> |
| <dt><span class="section"><a href="scope_exit/alternatives.html"> Alternatives</a></span></dt> |
| <dt><span class="section"><a href="scope_exit/compilers.html"> Supported Compilers</a></span></dt> |
| <dt><span class="section"><a href="scope_exit/conf.html"> Configuration</a></span></dt> |
| <dt><span class="section"><a href="scope_exit/ref.html"> Reference</a></span></dt> |
| <dt><span class="section"><a href="scope_exit/acknowledge.html"> Acknowledge</a></span></dt> |
| </dl> |
| </div> |
| <div class="section"> |
| <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
| <a name="scope_exit.intro"></a> Introduction</h2></div></div></div> |
| <p> |
| Nowadays, every C++ developer is familiar with <a href="http://www.research.att.com/~bs/glossary.html#Gresource-acquisition-is-initialization" target="_top">RAII</a> |
| 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. |
| </p> |
| <p> |
| This is when <a class="link" href="index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> macro comes into play. |
| You put resource acquisition directly in your code and next to it you write |
| a code that releases the resource. |
| </p> |
| <p> |
| Read <a class="link" href="scope_exit/tutorial.html" title="Tutorial">Tutorial</a> to find out how to |
| write programs with <a class="link" href="index.html" title="Chapter 1. Boost.ScopeExit">ScopeExit</a> or jump straight |
| to the <a class="link" href="scope_exit/ref.html" title="Reference">Reference</a> section. |
| </p> |
| </div> |
| </div> |
| <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> |
| <td align="left"><p><small>Last revised: July 08, 2010 at 22:36:27 GMT</small></p></td> |
| <td align="right"><div class="copyright-footer"></div></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"><a accesskey="n" href="scope_exit/tutorial.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div> |
| </body> |
| </html> |