File: getting_started.html

package info (click to toggle)
boost1.62 1.62.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 686,420 kB
  • sloc: cpp: 2,609,004; xml: 972,558; ansic: 53,674; python: 32,437; sh: 8,829; asm: 3,071; cs: 2,121; makefile: 964; perl: 859; yacc: 472; php: 132; ruby: 94; f90: 55; sql: 13; csh: 6
file content (192 lines) | stat: -rw-r--r-- 14,072 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<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.79.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">
<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 class="toc">
<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>
</dl></div>
<p>
      This section explains how to setup a system to use this library.
    </p>
<div class="section">
<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 most of the examples presented in this documentation, the Boost.Detail/LightweightTest
        (<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
        conditions. The <code class="computeroutput"><span class="identifier">BOOST_TEST</span></code>
        macro is conceptually similar to <code class="computeroutput"><span class="identifier">assert</span></code>
        but a failure of the checked condition does not abort the program, instead
        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
        exit code. <a href="#ftn.boost_localfunction.getting_started.this_documentation.f0" class="footnote" name="boost_localfunction.getting_started.this_documentation.f0"><sup class="footnote">[3]</sup></a>
      </p>
</div>
<div class="section">
<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>),
        and automatic type deduction (as supported by <a href="http://www.boost.org/libs/typeof" target="_top">Boost.Typeof</a>).
        The authors originally developed and tested the library on:
      </p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
            GNU Compiler Collection (GCC) C++ 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 C++ (MSVC) 8.0 on Windows XP and Windows 7.
          </li>
</ol></div>
<p>
        See the library <a href="http://www.boost.org/development/tests/release/developer/local_function.html" target="_top">regressions
        test results</a> for detailed information on supported compilers and
        platforms.
      </p>
</div>
<div class="section">
<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>
        The library implementation uses <a href="http://www.boost.org/libs/typeof" target="_top">Boost.Typeof</a>
        to automatically deduce the types of bound variables (see the <a class="link" href="tutorial.html" title="Tutorial">Tutorial</a>
        section). In order to compile code in type-of emulation 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 <a href="http://www.boost.org/libs/typeof" target="_top">Boost.Typeof</a>
        headers should be included (see the source code of most examples presented
        in this documentation).
      </p>
<p>
        The followings are part of the library private API, they are not documented,
        and they should not be directly used by programmers: <a href="#ftn.boost_localfunction.getting_started.installation.f0" class="footnote" name="boost_localfunction.getting_started.installation.f0"><sup class="footnote">[4]</sup></a>
      </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-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>
<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. All configuration macros are defined in the header file <code class="computeroutput">boost/local_function/config.hpp</code>.
        It is strongly recommended not to change the library configuration macro
        definitions unless strictly necessary.
      </p>
</div>
<div class="footnotes">
<br><hr style="width:100; text-align:left;margin-left: 0">
<div id="ftn.boost_localfunction.getting_started.this_documentation.f0" class="footnote"><p><a href="#boost_localfunction.getting_started.this_documentation.f0" class="para"><sup class="para">[3] </sup></a>
          <span class="bold"><strong>Rationale.</strong></span> Using Boost.Detail/LightweightTest
          allows to add the examples to the library regression tests so to make sure
          that they always compile and run correctly.
        </p></div>
<div id="ftn.boost_localfunction.getting_started.installation.f0" class="footnote"><p><a href="#boost_localfunction.getting_started.installation.f0" class="para"><sup class="para">[4] </sup></a>
          <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 file 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 may 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>