boost/doc/html/metaparse/versioning.html
2021-10-05 21:37:46 +02:00

117 lines
9.6 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Versioning</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="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../metaparse.html" title="Chapter 24. Boost.Metaparse">
<link rel="prev" href="user_manual.html" title="User manual">
<link rel="next" href="performance.html" title="Performance">
</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="user_manual.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../metaparse.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="performance.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="metaparse.versioning"></a><a class="link" href="versioning.html" title="Versioning">Versioning</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="versioning.html#metaparse.versioning.template_classes">Template classes</a></span></dt>
<dt><span class="section"><a href="versioning.html#metaparse.versioning.macros">Macros</a></span></dt>
</dl></div>
<p>
This section describes how the library is prepared for supporting multiple
(not backward compatible) changes.
</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="metaparse.versioning.template_classes"></a><a class="link" href="versioning.html#metaparse.versioning.template_classes" title="Template classes">Template classes</a>
</h3></div></div></div>
<p>
The elements of the library are defined in the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">metaparse</span><span class="special">::</span><span class="identifier">v1</span></code> namespace.
For example the <code class="computeroutput"><span class="identifier">one_char</span></code>
class is <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">metaparse</span><span class="special">::</span><span class="identifier">v1</span><span class="special">::</span><span class="identifier">one_char</span></code>
and is available after including the <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">metaparse</span><span class="special">/</span><span class="identifier">v1</span><span class="special">/</span><span class="identifier">one_char</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
header file.
</p>
<p>
At the same time the library provides the <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">metaparse</span><span class="special">/</span><span class="identifier">one_char</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
header file which includes <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">metaparse</span><span class="special">/</span><span class="identifier">v1</span><span class="special">/</span><span class="identifier">one_char</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
and contains the following:
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span>
<span class="special">{</span>
<span class="keyword">namespace</span> <span class="identifier">metaparse</span>
<span class="special">{</span>
<span class="keyword">using</span> <span class="identifier">v1</span><span class="special">::</span><span class="identifier">one_char</span><span class="special">;</span>
<span class="special">}</span>
<span class="special">}</span>
</pre>
<p>
This makes it possible to use <code class="computeroutput"><span class="identifier">one_char</span></code>
as <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">metaparse</span><span class="special">::</span><span class="identifier">one_char</span></code>.
</p>
<p>
Future versions of the library may provide other namespaces (eg. <code class="computeroutput"><span class="identifier">v2</span></code>). The header files in <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">metaparse</span><span class="special">/...&gt;</span></code> provide the latest version of the
library. To always get version <code class="computeroutput"><span class="identifier">v1</span></code>,
one should use header files in <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">metaparse</span><span class="special">/</span><span class="identifier">v1</span><span class="special">/...&gt;</span></code>.
</p>
<p>
The library does not use inline namespaces to work on compilers that do not
support them.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="metaparse.versioning.macros"></a><a class="link" href="versioning.html#metaparse.versioning.macros" title="Macros">Macros</a>
</h3></div></div></div>
<p>
Macros defined by the library are prefixed with <code class="computeroutput"><span class="identifier">BOOST_METAPARSE_V1_</span></code>.
For example <code class="computeroutput"><span class="identifier">BOOST_METAPARSE_V1_STRING</span></code>.
It is defined in the <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">metaparse</span><span class="special">/</span><span class="identifier">v1</span><span class="special">/</span><span class="identifier">string</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
header file. The library provides the <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">metaparse</span><span class="special">/</span><span class="identifier">string</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
header file as well, which includes the definition of this macro and provides
the following definition:
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_METAPARSE_STRING</span> <span class="identifier">BOOST_METAPARSE_V1_STRING</span>
</pre>
<p>
This makes it possible to use the macro as <code class="computeroutput"><span class="identifier">BOOST_METAPARSE_STRING</span></code>.
Future versions of the library may define other versions of this macro (eg.
<code class="computeroutput"><span class="identifier">BOOST_METAPARSE_V2_STRING</span></code>).
<code class="computeroutput"><span class="identifier">BOOST_METAPARSE_STRING</span></code> will
refer to the latest version.
</p>
<p>
This versioning does not affect macros that may be overridden by the code
using the library. (eg. <code class="computeroutput"><span class="identifier">BOOST_METAPARSE_LIMIT_STRING_SIZE</span></code>)
</p>
</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 © 2015 Abel Sinkovics<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or 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="user_manual.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../metaparse.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="performance.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>