Files
local_function/doc/html/boost_localfunction/Getting_Started.html
Lorenzo Caminiti f49e381fad Added LocalFunction docs.
[SVN r77020]
2012-02-15 00:34:25 +00:00

200 lines
14 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Getting Started</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
<link rel="prev" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
<link rel="next" href="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="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>
</div>
<div class="section boost_localfunction_Getting_Started">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_localfunction.Getting_Started"></a><a class="link" href="Getting_Started.html" title="Getting Started">Getting Started</a>
</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="Getting_Started.html#boost_localfunction.Getting_Started.this_documentation">This
Documentation</a></span></dt>
<dt><span class="section"><a href="Getting_Started.html#boost_localfunction.Getting_Started.compilers_and_platforms">Compilers
and Platforms</a></span></dt>
<dt><span class="section"><a href="Getting_Started.html#boost_localfunction.Getting_Started.installation">Installation</a></span></dt>
<dt><span class="section"><a href="Getting_Started.html#boost_localfunction.Getting_Started.configuration">Configuration</a></span></dt>
</dl></div>
<p>
This section explains how programmers can setup their system to use this library.
</p>
<div class="section boost_localfunction_Getting_Started_this_documentation">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_localfunction.Getting_Started.this_documentation"></a><a class="link" href="Getting_Started.html#boost_localfunction.Getting_Started.this_documentation" title="This Documentation">This
Documentation</a>
</h3></div></div></div>
<p>
Programmers should have enough knowledge to use this library after reading
the <a class="link" href="../index.html#boost_localfunction.Introduction" title="Introduction">Introduction</a>,
<a class="link" href="Getting_Started.html" title="Getting Started">Getting Started</a>,
and <a class="link" href="Tutorial.html" title="Tutorial">Tutorial</a> sections.
The <a class="link" href="Advanced_Topics.html" title="Advanced Topics">Advanced Topics</a>
and <a href="../reference.html" target="_top">Reference</a> sections can be consulted
at a later point to gain a more advanced knowledge of the library. All the
other sections of this documentation can be considered optional.
</p>
<p>
Some footnotes are marked by the word "<span class="bold"><strong>Rationale</strong></span>".
They explain reasons behind decisions made during the design and implementation
of this library.
</p>
<p>
In some of the examples presented in this documentation, the <a href="http://www.boost.org/libs/test" target="_top">Boost.Test</a>
macro <code class="computeroutput"><span class="identifier">BOOST_CHECK</span></code> is used
equivalently to <code class="computeroutput"><span class="identifier">assert</span></code> and
the <a href="http://www.boost.org/libs/test" target="_top">Boost.Test</a> macro
<code class="computeroutput"><span class="identifier">BOOST_AUTO_TEST_CASE</span></code> is used
equivalently to <code class="computeroutput"><span class="identifier">main</span></code>. <sup>[<a name="boost_localfunction.Getting_Started.this_documentation.f0" href="#ftn.boost_localfunction.Getting_Started.this_documentation.f0" class="footnote">3</a>]</sup>
</p>
</div>
<div class="section boost_localfunction_Getting_Started_compilers_and_platforms">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_localfunction.Getting_Started.compilers_and_platforms"></a><a class="link" href="Getting_Started.html#boost_localfunction.Getting_Started.compilers_and_platforms" title="Compilers and Platforms">Compilers
and Platforms</a>
</h3></div></div></div>
<p>
The implementation of this library uses preprocessor and template meta-programming
(as supported by <a href="http://www.boost.org/libs/preprocessor" target="_top">Boost.Preprocessor</a>
and <a href="http://www.boost.org/libs/mpl" target="_top">Boost.MPL</a>), templates
with partial specializations and function pointers (similarly to <a href="http://www.boost.org/libs/function" target="_top">Boost.Function</a>).
As a consequence, this library is fairly demanding on compilers' compliance
with the <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/standards" target="_top">C++03</a>
standard. At present, this library has been successfully compiled and tested
on the following compilers and platforms:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
GNU Compiler Collection (GCC) 4.5.1 on Ubuntu Linux 10.
</li>
<li class="listitem">
GCC 4.3.4 and 4.5.3 (with and without <a href="http://www.open-std.org/JTC1/SC22/WG21/" target="_top">C++11</a>
features enabled <code class="computeroutput"><span class="special">-</span><span class="identifier">std</span><span class="special">=</span><span class="identifier">c</span><span class="special">++</span><span class="number">0</span><span class="identifier">x</span></code>)
on Cygwin.
</li>
<li class="listitem">
Miscrosoft Visual Studio Compiler (MSVC) 8.0 on Windows XP and Windows
7.
</li>
</ol></div>
<p>
This library has not yet been tested on any other compiler and platform.
</p>
</div>
<div class="section boost_localfunction_Getting_Started_installation">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_localfunction.Getting_Started.installation"></a><a class="link" href="Getting_Started.html#boost_localfunction.Getting_Started.installation" title="Installation">Installation</a>
</h3></div></div></div>
<p>
This library is composed of header files only. Therefore there is no pre-compiled
object file which needs to be installed or linked. Programmers can simply
instruct the C++ compiler where to find the library header files (<code class="computeroutput"><span class="special">-</span><span class="identifier">I</span></code> option
for GCC, <code class="computeroutput"><span class="special">/</span><span class="identifier">I</span></code>
option for MSVC, etc) and they can start compiling code using this library.
</p>
<p>
This library implementation uses a number of <a href="http://www.boost.org" target="_top">Boost</a>
libraries among which: <a href="http://www.boost.org/libs/preprocessor" target="_top">Boost.Preprocessor</a>,
<a href="http://www.boost.org/libs/scope_exit" target="_top">Boost.ScopeExit</a>,
<a href="http://www.boost.org/libs/typeof" target="_top">Boost.Typeof</a>, <a href="http://www.boost.org/libs/type_traits" target="_top">Boost.TypeTraits</a>, and
<a href="http://www.boost.org/libs/mpl" target="_top">Boost.MPL</a>. These <a href="http://www.boost.org" target="_top">Boost</a> libraries must be properly installed
on your system in order for this library to work.
</p>
<p>
The followings are part of the library private API, they are not documented,
and they should not be directly used by programmers: <sup>[<a name="boost_localfunction.Getting_Started.installation.f0" href="#ftn.boost_localfunction.Getting_Started.installation.f0" class="footnote">4</a>]</sup>
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
Any symbol defined by files within the <code class="literal">boost/local_function/aux_/</code>
or <code class="literal">boost/local_function/detail/</code> directory (these header
files should not be directly included by programmers).
</li>
<li class="listitem">
Any symbol within the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">local_function</span><span class="special">::</span><span class="identifier">aux</span></code>
or <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">local_function</span><span class="special">::</span><span class="identifier">detail</span></code> namespace.
</li>
<li class="listitem">
Any symbol prefixed by <code class="computeroutput"><span class="identifier">boost_local_function_aux_</span><span class="special">...</span></code> or <code class="computeroutput"><span class="identifier">boost_local_function_detail_</span><span class="special">...</span></code> (regardless of its namespace).
</li>
<li class="listitem">
Any symbol prefixed by <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION_AUX_</span><span class="special">...</span></code> or <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION_DETAIL_</span><span class="special">...</span></code> (regardless of its namespace).
</li>
</ul></div>
</div>
<div class="section boost_localfunction_Getting_Started_configuration">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_localfunction.Getting_Started.configuration"></a><a class="link" href="Getting_Started.html#boost_localfunction.Getting_Started.configuration" title="Configuration">Configuration</a>
</h3></div></div></div>
<p>
Some of the library behaviour can be changed at compile-time by defining
special <span class="emphasis"><em>configuration macros</em></span>. If a configuration macro
is left undefined, the library will use an appropriate default value for
it.
</p>
<p>
All configuration macros are defined in the header file <code class="computeroutput"><a class="link" href="../reference.html#header.boost.local_function.config_hpp" title="Header &lt;boost/local_function/config.hpp&gt;">boost/local_function/config.hpp</a></code>.
It is strongly recommended not to change the library configuration macro
definitions unless strictly necessary.
</p>
</div>
<div class="footnotes">
<br><hr width="100" align="left">
<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Getting_Started.this_documentation.f0" href="#boost_localfunction.Getting_Started.this_documentation.f0" class="para">3</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> Using <a href="http://www.boost.org/libs/test" target="_top">Boost.Test</a>
allows to add the documentation examples to the library regression tests
so to make sure that the listed examples always compile and run correctly.
</p></div>
<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Getting_Started.installation.f0" href="#boost_localfunction.Getting_Started.installation.f0" class="para">4</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> This library concatenates symbols
specified by the programmers (e.g., the local function name) with other
symbols (e.g., special prefixes or preprocessor line numbers) to make internal
symbols with unique names to avoid name clashes. These symbols are separated
by the letter "<code class="computeroutput"><span class="identifier">X</span></code>"
when they are concatenated so they read more easily during debugging (the
underscore character "<code class="computeroutput"><span class="identifier">_</span></code>"
could not be used instead of the letter "<code class="computeroutput"><span class="identifier">X</span></code>"
because if the original symbols already contained a leading or trailing
underscore, the concatenation could result in a symbol with double underscores
"<code class="computeroutput"><span class="identifier">__</span></code>" which is
reserved by the C++ standard). The "aux" symbols are private
to this library while the "detail" symbols can be used within
Boost by other libraries but they are still not part of this library public
API.
</p></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2012 Lorenzo
Caminiti<p>
Distributed under the Boost Software License, Version 1.0 (see accompanying
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>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
</body>
</html>