mirror of
https://github.com/boostorg/multi_index.git
synced 2025-05-09 23:14:04 +00:00
315 lines
12 KiB
HTML
315 lines
12 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.1 Transitional//EN">
|
|
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>Boost.MultiIndex Documentation - Compiler specifics</title>
|
|
<link rel="stylesheet" href="style.css" type="text/css">
|
|
</head>
|
|
|
|
<body>
|
|
<h1><img src="../../../c++boost.gif" alt="c++boost.gif (8819 bytes)" align=
|
|
"middle" width="277" height="86">Boost.MultiIndex Compiler specifics</h1>
|
|
|
|
<div class="prev_link"><a href="reference/key_extraction.html"><img src="prev.gif" alt="key extraction" border="0"><br>
|
|
Key extraction
|
|
</a></div>
|
|
<div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
|
|
Index
|
|
</a></div>
|
|
<div class="next_link"><a href="performance.html"><img src="next.gif" alt="performance" border="0"><br>
|
|
Performance
|
|
</a></div><br clear="all" style="clear: all;">
|
|
|
|
<hr>
|
|
|
|
<p>
|
|
Boost.MultiIndex has been tried in different compilers, with
|
|
various degrees of success. We list the limitations encountered,
|
|
along with suitable workarounds when available. Up to date information
|
|
on compatibility of Boost.MultiIndex with several compilers can
|
|
be found at the <a href="http://boost.sourceforge.net/regression-logs/">
|
|
Boost Compiler Status Summary</a>.
|
|
</p>
|
|
|
|
<h2>Contents</h2>
|
|
|
|
<ul>
|
|
<li><a href="#bcb_64">Borland C++ Builder 6.4</a></li>
|
|
<li><a href="#gcc_32_cygwin">GNU GCC 3.3.1 (cygming special)</a></li>
|
|
<li><a href="#intel_7_win">Intel C++ Compiler for Windows 32-bit 7.0/7.1</a></li>
|
|
<li><a href="#intel_8_win">Intel C++ Compiler for Windows 32-bit 8.0</a></li>
|
|
<li><a href="#cw_92_mac">Metrowerks CodeWarrior 9.2 for Mac OS</a></li>
|
|
<li><a href="#msvc_60">Microsoft Visual C++ 6.0 Service Pack 5</a></li>
|
|
<li><a href="#msvc_60_stlport_462">Microsoft Visual C++ 6.0 Service Pack 5 + STLport 4.6.2</a></li>
|
|
<li><a href="#msvc_71">Microsoft Visual C++ 7.1</a></li>
|
|
</ul>
|
|
|
|
<h2><a name="bcb_64">Borland C++ Builder 6.4</a></h2>
|
|
|
|
<p>
|
|
Currently, Boost.MultiIndex cannot be used with BCB 6.4. The
|
|
number of problems encountered during the tests makes it unlikely that
|
|
future versions of the library can be made to work under
|
|
this compiler.
|
|
</p>
|
|
|
|
<h2><a name="gcc_32_cygwin">GNU GCC 3.3.1 (cygming special)</a></h2>
|
|
|
|
<p>
|
|
No problems have been detected with this compiler. The tests were
|
|
performed under Cygwin 1.5.7. Most likely Boost.MultiIndex will work seamlessly
|
|
for GNU GCC 3.3 or later under any platform.
|
|
</p>
|
|
|
|
<h2><a name="intel_7_win">Intel C++ Compiler for Windows 32-bit 7.0/7.1</a></h2>
|
|
|
|
<p>
|
|
<a href="reference/key_extraction.html#member"><code>member</code></a> not supported,
|
|
replace with
|
|
<a href="reference/key_extraction.html#member_offset"><code>member_offset</code></a> or
|
|
use the cross-platform macro
|
|
<a href="reference/key_extraction.html#boost_multi_index_member">
|
|
<code>BOOST_MULTI_INDEX_MEMBER</code></a>.
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<p>
|
|
Altough Koenig lookup seems to be officially supported by this compiler,
|
|
some issues have arisen seemingly due to bugs related to this facility.
|
|
In these cases you might need to explicitly qualify global names with
|
|
<code>::boost::multi_index</code>.
|
|
</p>
|
|
|
|
<h2><a name="intel_8_win">Intel C++ Compiler for Windows 32-bit 8.0</a></h2>
|
|
|
|
<p>
|
|
No problems have been detected with this compiler.
|
|
</p>
|
|
|
|
<h2><a name="cw_92_mac">Metrowerks CodeWarrior 9.2 for Mac OS</a></h2>
|
|
|
|
<p>
|
|
No problems have been detected with this compiler.
|
|
</p>
|
|
|
|
|
|
<h2><a name="msvc_60">Microsoft Visual C++ 6.0 Service Pack 5</a></h2>
|
|
|
|
<p>
|
|
<a href="reference/key_extraction.html#member"><code>member</code></a> not supported,
|
|
replace with
|
|
<a href="reference/key_extraction.html#member_offset"><code>member_offset</code></a> or
|
|
use the cross-platform macro
|
|
<a href="reference/key_extraction.html#boost_multi_index_member">
|
|
<code>BOOST_MULTI_INDEX_MEMBER</code></a>.
|
|
</p>
|
|
|
|
<p>
|
|
<a href="reference/key_extraction.html#const_mem_fun"><code>const_mem_fun</code></a> not
|
|
supported, replace with
|
|
<a href="reference/key_extraction.html#const_mem_fun_explicit">
|
|
<code>const_mem_fun_explicit</code></a>
|
|
or use the cross-platform macro
|
|
<a href="reference/key_extraction.html#boost_multi_index_const_mem_fun">
|
|
<code>BOOST_MULTI_INDEX_CONST_MEM_FUN</code></a>.
|
|
</p>
|
|
|
|
<p>
|
|
<a href="reference/key_extraction.html#mem_fun"><code>mem_fun</code></a> is not
|
|
supported, replace with
|
|
<a href="reference/key_extraction.html#mem_fun_explicit">
|
|
<code>mem_fun_explicit</code></a> or
|
|
use the cross-platform macro
|
|
<a href="reference/key_extraction.html#boost_multi_index_mem_fun">
|
|
<code>BOOST_MULTI_INDEX_MEM_FUN</code></a>.
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<p>
|
|
No support for <a href="reference/multi_index_container.html#index_retrieval">index retrieval</a>
|
|
and <a href="reference/multi_index_container.html#projection">projection</a>
|
|
nested types and member functions:
|
|
<ul>
|
|
<li><code>nth_index</code>,</li>
|
|
<li><code>index</code>,</li>
|
|
<li><code>nth_index_iterator</code>,</li>
|
|
<li><code>nth_index_const_iterator</code>,</li>
|
|
<li><code>index_iterator</code>,</li>
|
|
<li><code>index_const_iterator</code>,</li>
|
|
<li><code>get</code>,</li>
|
|
<li><code>project</code>.</li>
|
|
</ul>
|
|
You can use instead their global equivalents. Also, this compiler does not
|
|
implement Koenig lookup, so you might need to explicitly qualify these
|
|
global names with <code>::boost::multi_index</code>.
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<p>
|
|
The lack of partial template specialization support in MSVC++ 6.0
|
|
results in some inconveniences when using <code>composite_key</code> that
|
|
can be remedied as explained in
|
|
<a href="advanced_topics.html#composite_key_no_pts">"<code>composite_key</code>
|
|
in compilers without partial template specialization"</a> on the advanced
|
|
topics section.
|
|
</p>
|
|
|
|
<hr>
|
|
<p>
|
|
MSVC++ 6.0 presents serious limitations for the maximum length of
|
|
symbol names generated by the compiler, which might result in the
|
|
linker error
|
|
<code><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/lnk1179.asp">LNK1179</a>:
|
|
invalid or corrupt file: duplicate comdat
|
|
comdat</code>. To overcome this problem, you can restrict the maximum
|
|
number of elements accepted by
|
|
<a href="reference/indices.html#indexed_by"><code>indexed_by</code></a>,
|
|
<a href="reference/indices.html#tag"><code>tag</code></a> and
|
|
<a href="reference/key_extraction.html#composite_key"><code>composite_key</code></a>
|
|
by globally setting the values of the macros
|
|
<ul>
|
|
<li><code>BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE</code>
|
|
(default in MSVC++ 6.0: 5),</li>
|
|
<li><code>BOOST_MULTI_INDEX_LIMIT_TAG_SIZE</code>
|
|
(default in MSVC++ 6.0: 3),</li>
|
|
<li><code>BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE</code>
|
|
(default in MSVC++ 6.0: 5).</li>
|
|
</ul>
|
|
This operation results in a modest reduction of the lengths of symbol
|
|
names.
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<p>
|
|
Under some circumstances, the compiler emits the error
|
|
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/C2587.asp">
|
|
<code>C2587</code></a><code>: '_U' : illegal use of local variable as
|
|
default parameter</code>, inside the MSVC internal header
|
|
<code><xlocnum></code>.
|
|
This problem is a recurrent bug of the compiler, and has been reported in
|
|
other unrelated libraries, like the
|
|
<a href="../../../libs/graph/doc/table_of_contents.html">Boost Graph Library</a>,
|
|
<a href="../../../libs/multi_array/doc/index.html">Boost.MultiArray</a>,
|
|
<a href="../../../libs/regex/doc/index.html">Boost.Regex</a>,
|
|
<a href="http://www.cgal.org/">CGAL</a> and
|
|
<a href="http://www.mysql.com/downloads/api-mysql++.html">MySQL++</a>.
|
|
The error is triggered, though not in a systematic manner, by the use
|
|
of <code>multi_index_container</code> iterator constructor. Two workarounds exist:
|
|
the first consists of avoiding this constructor and replacing
|
|
code like:
|
|
</p>
|
|
|
|
<blockquote><pre>
|
|
<span class=identifier>multi_index_container</span><span class=special><...></span> <span class=identifier>s</span><span class=special>(</span><span class=identifier>c</span><span class=special>.</span><span class=identifier>begin</span><span class=special>(),</span><span class=identifier>c</span><span class=special>.</span><span class=identifier>end</span><span class=special>());</span>
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
with equivalent operations:
|
|
</p>
|
|
|
|
<blockquote><pre>
|
|
<span class=identifier>multi_index_container</span><span class=special><...></span> <span class=identifier>s</span><span class=special>;</span>
|
|
<span class=identifier>s</span><span class=special>.</span><span class=identifier>insert</span><span class=special>(</span><span class=identifier>c</span><span class=special>.</span><span class=identifier>begin</span><span class=special>(),</span><span class=identifier>c</span><span class=special>.</span><span class=identifier>end</span><span class=special>());</span>
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
The second workaround has not been confirmed by the author, but it is given
|
|
on the Internet in connection with this error appearing in other libraries.
|
|
Replace line 84 of <code><xlocnum></code>
|
|
|
|
<blockquote><pre>
|
|
<span class=preprocessor>#define</span> <span class=identifier>_VIRTUAL</span> <span class=keyword>virtual</span>
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
with the following:
|
|
</p>
|
|
|
|
<blockquote><pre>
|
|
<span class=preprocessor>#define</span> <span class=identifier>_VIRTUAL</span>
|
|
</pre></blockquote>
|
|
</p>
|
|
|
|
<p>
|
|
<b>Warning</b>: it is not known whether this
|
|
replacement can result in unexpected side effects in code implicitly
|
|
using <code><xlocnum></code>.
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<p>
|
|
In general, the extensive use of templates by Boost.MultiIndex puts this compiler
|
|
under severe stress, so that several internal limitations may be reached.
|
|
The following measures can help alleviate these problems:
|
|
<ul>
|
|
<li>Set the compiler option <code>/Zm</code> (Specify Memory Allocation Limit)
|
|
to increase the amount of memory available for compilation. Usual values for
|
|
this option range from 300 to 800.</li>
|
|
<li>If in debug mode, try switching from <code>/ZI</code> (Program Database for
|
|
Edit and Continue) to a less demanding type of debugging information
|
|
(<code>/Zi</code>, <code>/Z7</code> or <code>Zd</code>.)</li>
|
|
<li>Play with the precompiled headers options. Usually, turning this feature
|
|
off yields the best results.</li>
|
|
<li>If the compiler emits the error
|
|
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/c1055.asp">
|
|
<code>C1055</code></a><code>: compiler limit : out of keys</code>, try
|
|
disabling the option <code>/Gm</code> (Enable Minimal Rebuild.) In these
|
|
cases, it is also beneficial to split the project into smaller
|
|
subprojects.</li>
|
|
</ul>
|
|
</p>
|
|
|
|
<h2>
|
|
<a name="msvc_60_stlport_462">Microsoft Visual C++ 6.0 Service Pack 5
|
|
+ STLport 4.6.2</a>
|
|
</h2>
|
|
|
|
<p>
|
|
Boost.MultiIndex works for this configuration. The same limitations apply as
|
|
in MSVC++ 6.0 with its original Dinkumware standard library.
|
|
</p>
|
|
|
|
<h2><a name="msvc_71">Microsoft Visual C++ 7.1</a></h2>
|
|
|
|
<p>
|
|
Problems have been reported when compiling the library with the <code>/Gm</code>
|
|
option (Enable Minimal Rebuild.) Seemingly, this is due to an
|
|
internal defect of the compiler (see for instance
|
|
<a href="http://lists.boost.org/MailArchives/boost-users/msg05988.php">
|
|
this mention of a similar issue</a> in the Boost Users mailing list.)
|
|
If <code>/Gm</code> is turned off, Boost.MultiIndex compiles and runs
|
|
without further problems.
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<div class="prev_link"><a href="reference/key_extraction.html"><img src="prev.gif" alt="key extraction" border="0"><br>
|
|
Key extraction
|
|
</a></div>
|
|
<div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
|
|
Index
|
|
</a></div>
|
|
<div class="next_link"><a href="performance.html"><img src="next.gif" alt="performance" border="0"><br>
|
|
Performance
|
|
</a></div><br clear="all" style="clear: all;">
|
|
|
|
<br>
|
|
|
|
<p>Revised May 7th 2004</p>
|
|
|
|
<p>Copyright © 2003-2004 Joaquín M López Muñoz.
|
|
Use, modification, and distribution are subject to the Boost Software
|
|
License, Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt">
|
|
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
|
|
www.boost.org/LICENSE_1_0.txt</a>)
|
|
</p>
|
|
|
|
</body>
|
|
</html>
|