1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Getting Started</title> 5<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../index.html" title="Chapter 1. Boost.ScopeExit 1.1.0"> 8<link rel="up" href="../index.html" title="Chapter 1. Boost.ScopeExit 1.1.0"> 9<link rel="prev" href="../index.html" title="Chapter 1. Boost.ScopeExit 1.1.0"> 10<link rel="next" href="tutorial.html" title="Tutorial"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="../index.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 27<a name="scope_exit.getting_started"></a><a class="link" href="getting_started.html" title="Getting Started">Getting Started</a> 28</h2></div></div></div> 29<div class="toc"><dl class="toc"> 30<dt><span class="section"><a href="getting_started.html#scope_exit.getting_started.this_documentation">This Documentation</a></span></dt> 31<dt><span class="section"><a href="getting_started.html#scope_exit.getting_started.compilers_and_platforms">Compilers 32 and Platforms</a></span></dt> 33<dt><span class="section"><a href="getting_started.html#scope_exit.getting_started.installation">Installation</a></span></dt> 34</dl></div> 35<p> 36 This section explains how to setup a system to use this library. 37 </p> 38<div class="section"> 39<div class="titlepage"><div><div><h3 class="title"> 40<a name="scope_exit.getting_started.this_documentation"></a><a class="link" href="getting_started.html#scope_exit.getting_started.this_documentation" title="This Documentation">This Documentation</a> 41</h3></div></div></div> 42<p> 43 Programmers should have enough knowledge to use this library after reading 44 the <a class="link" href="../index.html#scope_exit.introduction" title="Introduction">Introduction</a>, <a class="link" href="getting_started.html" title="Getting Started">Getting 45 Started</a>, and <a class="link" href="tutorial.html" title="Tutorial">Tutorial</a> sections. 46 The <a href="../reference.html" target="_top">Reference</a> section can be consulted 47 at a later point for quick reference. All the other sections of this documentation 48 can be considered optional. 49 </p> 50<p> 51 Some footnotes are marked by the word "<span class="bold"><strong>Rationale</strong></span>". 52 They explain reasons behind decisions made during the design and implementation 53 of this library. 54 </p> 55<p> 56 In most of the examples presented in this documentation, the Boost.Detail/LightweightTest 57 (<code class="literal">boost/detail/lightweight_test.hpp</code>) macro <code class="computeroutput"><span class="identifier">BOOST_TEST</span></code> is used to check correctness 58 conditions. The <code class="computeroutput"><span class="identifier">BOOST_TEST</span></code> 59 macro is conceptually similar to <code class="computeroutput"><span class="identifier">assert</span></code> 60 but a failure of the checked condition does not abort the program, instead 61 it makes <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span></code> return a non-zero program 62 exit code. <a href="#ftn.scope_exit.getting_started.this_documentation.f0" class="footnote" name="scope_exit.getting_started.this_documentation.f0"><sup class="footnote">[2]</sup></a> 63 </p> 64</div> 65<div class="section"> 66<div class="titlepage"><div><div><h3 class="title"> 67<a name="scope_exit.getting_started.compilers_and_platforms"></a><a class="link" href="getting_started.html#scope_exit.getting_started.compilers_and_platforms" title="Compilers and Platforms">Compilers 68 and Platforms</a> 69</h3></div></div></div> 70<p> 71 The authors originally developed and tested the library on GNU Compiler Collection 72 (GCC) C++ 3.3, 3.4, 4.1, 4.2, 4.5.3 (with and without C++11 features <code class="literal">-std=c++0x</code>), 73 Microsoft Visual C++ (MSVC) 8.0, and Intel 10.1 under Linux, Cygwin, and 74 Windows 7. However, this library should be usable on any compiler that supports 75 <a href="http://www.boost.org/libs/typeof" target="_top">Boost.Typeof</a> except: 76 </p> 77<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 78<li class="listitem"> 79 MSVC 7.1 and 8.0 fail to link if a function with <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit 1.1.0">Boost.ScopeExit</a> 80 is included by multiple translation units. 81 </li> 82<li class="listitem"> 83 GCC 3.3 cannot compile <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit 1.1.0">Boost.ScopeExit</a> 84 inside a template (see <a href="http://lists.boost.org/Archives/boost/2007/02/116235.php" target="_top">http://lists.boost.org/Archives/boost/2007/02/116235.php</a> 85 for details). 86 </li> 87</ul></div> 88<p> 89 See the library <a href="http://www.boost.org/development/tests/release/developer/scope_exit.html" target="_top">regression 90 test results</a> for detailed information on supported compilers and 91 platforms. Check the library regression test <a href="../../../test/Jamfile.v2" target="_top"><code class="literal">Jamfile.v2</code></a> 92 for any special configuration that might be required for a specific compiler. 93 </p> 94</div> 95<div class="section"> 96<div class="titlepage"><div><div><h3 class="title"> 97<a name="scope_exit.getting_started.installation"></a><a class="link" href="getting_started.html#scope_exit.getting_started.installation" title="Installation">Installation</a> 98</h3></div></div></div> 99<p> 100 This library is composed of header files only. Therefore there is no pre-compiled 101 object file which needs to be installed. Programmers can simply instruct 102 the compiler where to find the library header files (<code class="computeroutput"><span class="special">-</span><span class="identifier">I</span></code> option on GCC, <code class="computeroutput"><span class="special">/</span><span class="identifier">I</span></code> option on MSVC, etc) and compile code 103 using the library. 104 </p> 105<p> 106 The library implementation uses <a href="http://www.boost.org/libs/typeof" target="_top">Boost.Typeof</a> 107 to automatically deduce the types of the <a class="link" href="../index.html" title="Chapter 1. Boost.ScopeExit 1.1.0">Boost.ScopeExit</a> 108 captured variables (see the <a class="link" href="tutorial.html" title="Tutorial">Tutorial</a> 109 section). In order to compile code in <a href="http://www.boost.org/libs/typeof" target="_top">type-of 110 emulation</a> mode, all types should be properly registered using <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TYPE</span></code> and <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TEMPLATE</span></code>, or appropriate 111 <a href="http://www.boost.org/libs/typeof" target="_top">Boost.Typeof</a> headers 112 should be included (see the source code of most examples presented in this 113 documentation). 114 </p> 115</div> 116<div class="footnotes"> 117<br><hr style="width:100; text-align:left;margin-left: 0"> 118<div id="ftn.scope_exit.getting_started.this_documentation.f0" class="footnote"><p><a href="#scope_exit.getting_started.this_documentation.f0" class="para"><sup class="para">[2] </sup></a> 119 <span class="bold"><strong>Rationale.</strong></span> Using Boost.Detail/LightweightTest 120 allows to add the examples to the library regression tests so to make sure 121 that they always compile and run correctly. 122 </p></div> 123</div> 124</div> 125<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 126<td align="left"></td> 127<td align="right"><div class="copyright-footer">Copyright © 2006-2012 Alexander Nasonov, Lorenzo Caminiti<p> 128 Distributed under the Boost Software License, Version 1.0 (see accompanying 129 file LICENSE_1_0.txt or a copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 130 </p> 131</div></td> 132</tr></table> 133<hr> 134<div class="spirit-nav"> 135<a accesskey="p" href="../index.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 136</div> 137</body> 138</html> 139