Added BOOST_NO_STD_UNORDERED config macro.

[SVN r50362]
This commit is contained in:
John Maddock
2008-12-22 09:45:31 +00:00
parent d0b83d60af
commit 167b63bd33
22 changed files with 195 additions and 17 deletions

View File

@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Acknowledgements</title> <title>Acknowledgements</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css"> <link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2"> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
<link rel="start" href="../index.html" title="Boost.Config"> <link rel="home" href="../index.html" title="Boost.Config">
<link rel="up" href="../index.html" title="Boost.Config"> <link rel="up" href="../index.html" title="Boost.Config">
<link rel="prev" href="rationale.html" title="Rationale"> <link rel="prev" href="rationale.html" title="Rationale">
</head> </head>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost Macro Reference</title> <title>Boost Macro Reference</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css"> <link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2"> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
<link rel="start" href="../index.html" title="Boost.Config"> <link rel="home" href="../index.html" title="Boost.Config">
<link rel="up" href="../index.html" title="Boost.Config"> <link rel="up" href="../index.html" title="Boost.Config">
<link rel="prev" href="../index.html" title="Boost.Config"> <link rel="prev" href="../index.html" title="Boost.Config">
<link rel="next" href="guidelines_for_boost_authors.html" title="Guidelines for Boost Authors"> <link rel="next" href="guidelines_for_boost_authors.html" title="Guidelines for Boost Authors">
@@ -2406,6 +2406,18 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">BOOST_NO_STD_UNORDERD</span></code>
</p>
</td>
<td>
<p>
The standard library does not support &lt;unordered_map&gt; and &lt;unordered_set&gt;.
</p>
</td>
</tr>
<tr>
<td> <td>
<p> <p>
<code class="computeroutput"><span class="identifier">BOOST_NO_UNICODE_LITERALS</span></code> <code class="computeroutput"><span class="identifier">BOOST_NO_UNICODE_LITERALS</span></code>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Guidelines for Boost Authors</title> <title>Guidelines for Boost Authors</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css"> <link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2"> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
<link rel="start" href="../index.html" title="Boost.Config"> <link rel="home" href="../index.html" title="Boost.Config">
<link rel="up" href="../index.html" title="Boost.Config"> <link rel="up" href="../index.html" title="Boost.Config">
<link rel="prev" href="boost_macro_reference.html" title="Boost Macro Reference"> <link rel="prev" href="boost_macro_reference.html" title="Boost Macro Reference">
<link rel="next" href="rationale.html" title="Rationale"> <link rel="next" href="rationale.html" title="Rationale">

View File

@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Rationale</title> <title>Rationale</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css"> <link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2"> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
<link rel="start" href="../index.html" title="Boost.Config"> <link rel="home" href="../index.html" title="Boost.Config">
<link rel="up" href="../index.html" title="Boost.Config"> <link rel="up" href="../index.html" title="Boost.Config">
<link rel="prev" href="guidelines_for_boost_authors.html" title="Guidelines for Boost Authors"> <link rel="prev" href="guidelines_for_boost_authors.html" title="Guidelines for Boost Authors">
<link rel="next" href="acknowledgements.html" title="Acknowledgements"> <link rel="next" href="acknowledgements.html" title="Acknowledgements">

View File

@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Config</title> <title>Boost.Config</title>
<link rel="stylesheet" href="../../../../doc/html/boostbook.css" type="text/css"> <link rel="stylesheet" href="../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2"> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
<link rel="start" href="index.html" title="Boost.Config"> <link rel="home" href="index.html" title="Boost.Config">
<link rel="next" href="boost_config/boost_macro_reference.html" title="Boost Macro Reference"> <link rel="next" href="boost_config/boost_macro_reference.html" title="Boost Macro Reference">
</head> </head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -28,7 +28,7 @@
</h3></div></div></div> </h3></div></div></div>
<div><p class="copyright">Copyright <20> 2001 -2007 Beman Dawes, Vesa Karvonen, John Maddock</p></div> <div><p class="copyright">Copyright <20> 2001 -2007 Beman Dawes, Vesa Karvonen, John Maddock</p></div>
<div><div class="legalnotice"> <div><div class="legalnotice">
<a name="id2843756"></a><p> <a name="id473249"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying 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>) 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> </p>
@@ -960,7 +960,7 @@
</div> </div>
</div> </div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: December 04, 2008 at 21:06:12 GMT</small></p></td> <td align="left"><p><small>Last revised: December 21, 2008 at 17:07:02 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td> <td align="right"><div class="copyright-footer"></div></td>
</tr></table> </tr></table>
<hr> <hr>

View File

@@ -565,6 +565,9 @@ scoped enumerations (`enum class`).
[[`BOOST_NO_STATIC_ASSERT`][The compiler does not support [[`BOOST_NO_STATIC_ASSERT`][The compiler does not support
`static_assert`. `static_assert`.
]] ]]
[[`BOOST_NO_STD_UNORDERD`][The standard library does not support
<unordered_map> and <unordered_set>.
]]
[[`BOOST_NO_UNICODE_LITERALS`][The compiler does not support [[`BOOST_NO_UNICODE_LITERALS`][The compiler does not support
Unicode (`u8`, `u`, `U`) literals. Unicode (`u8`, `u`, `U`) literals.
]] ]]

View File

@@ -78,6 +78,11 @@
# define BOOST_NO_STD_ITERATOR_TRAITS # define BOOST_NO_STD_ITERATOR_TRAITS
#endif #endif
//
// No std::unordered_* containers yet:
//
#define BOOST_NO_STD_UNORDERED
#if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310) #if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310)
// Intel C++ chokes over any non-trivial use of <locale> // Intel C++ chokes over any non-trivial use of <locale>
// this may be an overly restrictive define, but regex fails without it: // this may be an overly restrictive define, but regex fails without it:

View File

@@ -32,6 +32,10 @@
# define BOOST_HAS_HASH # define BOOST_HAS_HASH
# define BOOST_HAS_SLIST # define BOOST_HAS_SLIST
#endif #endif
//
// We never have the new C++0x unordered containers:
//
#define BOOST_NO_STD_UNORDERED
// //
// Intrinsic type_traits support. // Intrinsic type_traits support.

View File

@@ -76,3 +76,8 @@
# define BOOST_HASH_MAP_HEADER <backward/hash_map> # define BOOST_HASH_MAP_HEADER <backward/hash_map>
# endif # endif
#endif #endif
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# define BOOST_NO_STD_UNORDERED
#endif

View File

@@ -21,6 +21,10 @@
#ifndef MSIPL_WCHART #ifndef MSIPL_WCHART
#define BOOST_NO_STD_WSTRING #define BOOST_NO_STD_WSTRING
#endif #endif
//
// We never have the new C++0x unordered containers:
//
#define BOOST_NO_STD_UNORDERED
#define BOOST_STDLIB "Modena C++ standard library" #define BOOST_STDLIB "Modena C++ standard library"

View File

@@ -45,6 +45,10 @@
# define BOOST_NO_STD_USE_FACET # define BOOST_NO_STD_USE_FACET
# define BOOST_HAS_TWO_ARG_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET
#endif #endif
//
// We never have the new C++0x unordered containers:
//
#define BOOST_NO_STD_UNORDERED
#define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__) #define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__)

View File

@@ -151,3 +151,9 @@
# define _HP_INSTANTIATE_STD2_VL # define _HP_INSTANTIATE_STD2_VL
# endif # endif
#endif #endif
//
// We never have the new C++0x unordered containers:
//
#define BOOST_NO_STD_UNORDERED

View File

@@ -76,6 +76,7 @@
// //
#define BOOST_HAS_HASH #define BOOST_HAS_HASH
#define BOOST_HAS_SLIST #define BOOST_HAS_SLIST
#define BOOST_NO_STD_UNORDERED
// //
// If this is GNU libstdc++2, then no <limits> and no std::wstring: // If this is GNU libstdc++2, then no <limits> and no std::wstring:

View File

@@ -61,6 +61,9 @@
# endif # endif
#endif #endif
#if defined(_STLPORT_VERSION) && (_STLPORT_VERSION < 0x500)
# define BOOST_NO_STD_UNORDERED
#endif
// //
// Without member template support enabled, their are no template // Without member template support enabled, their are no template
// iterate constructors, and no std::allocator: // iterate constructors, and no std::allocator:

View File

@@ -11,6 +11,7 @@
#define BOOST_HAS_MACRO_USE_FACET #define BOOST_HAS_MACRO_USE_FACET
#define BOOST_NO_STD_MESSAGES #define BOOST_NO_STD_MESSAGES
#define BOOST_NO_STD_UNORDERED
#define BOOST_STDLIB "Visual Age default standard library" #define BOOST_STDLIB "Visual Age default standard library"

View File

@@ -1,7 +1,7 @@
# #
# Regression test Jamfile for boost configuration setup. # Regression test Jamfile for boost configuration setup.
# *** DO NOT EDIT THIS FILE BY HAND *** # *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on Wed Sep 24 11:44:22 2008 # This file was automatically generated on Tue Dec 16 16:41:41 2008
# by libs/config/tools/generate.cpp # by libs/config/tools/generate.cpp
# Copyright John Maddock. # Copyright John Maddock.
# Use, modification and distribution are subject to the # Use, modification and distribution are subject to the
@@ -337,6 +337,9 @@ test-suite "BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN" :
test-suite "BOOST_NO_STD_TYPEINFO" : test-suite "BOOST_NO_STD_TYPEINFO" :
[ run ../no_std_typeinfo_pass.cpp ] [ run ../no_std_typeinfo_pass.cpp ]
[ compile-fail ../no_std_typeinfo_fail.cpp ] ; [ compile-fail ../no_std_typeinfo_fail.cpp ] ;
test-suite "BOOST_NO_STD_UNORDERED" :
[ run ../no_std_unordered_pass.cpp ]
[ compile-fail ../no_std_unordered_fail.cpp ] ;
test-suite "BOOST_NO_STD_USE_FACET" : test-suite "BOOST_NO_STD_USE_FACET" :
[ run ../no_std_use_facet_pass.cpp ] [ run ../no_std_use_facet_pass.cpp ]
[ compile-fail ../no_std_use_facet_fail.cpp ] ; [ compile-fail ../no_std_use_facet_fail.cpp ] ;

View File

@@ -11,9 +11,17 @@
// or hash_map classes. // or hash_map classes.
#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0 #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx # ifdef BOOST_NO_STD_UNORDERED
#include <ext/hash_set> # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
#include <ext/hash_map> # include <ext/hash_set>
# include <ext/hash_map>
# else
// If we have BOOST_NO_STD_UNORDERED *not* defined, then we must
// not include the <ext/*> headers as they clash with the C++0x
// headers. ie in any given translation unit we can include one
// or the other, but not both.
# define DISABLE_BOOST_HAS_HASH_TEST
# endif
#else #else
#include <hash_set> #include <hash_set>
#include <hash_map> #include <hash_map>
@@ -25,6 +33,8 @@
namespace boost_has_hash{ namespace boost_has_hash{
#ifndef DISABLE_BOOST_HAS_HASH_TEST
template <class Key, class Eq, class Hash, class Alloc> template <class Key, class Eq, class Hash, class Alloc>
void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_set<Key,Eq,Hash,Alloc>& ) void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_set<Key,Eq,Hash,Alloc>& )
{ {
@@ -35,12 +45,16 @@ void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_map<Key,T,Eq,Hash,Alloc>& )
{ {
} }
#endif
int test() int test()
{ {
#ifndef DISABLE_BOOST_HAS_HASH_TEST
BOOST_STD_EXTENSION_NAMESPACE::hash_set<int> hs; BOOST_STD_EXTENSION_NAMESPACE::hash_set<int> hs;
foo(hs); foo(hs);
BOOST_STD_EXTENSION_NAMESPACE::hash_map<int, long> hm; BOOST_STD_EXTENSION_NAMESPACE::hash_map<int, long> hm;
foo(hm); foo(hm);
#endif
return 0; return 0;
} }

View File

@@ -0,0 +1,27 @@
// (C) Copyright John Maddock and Dave Abrahams 2002.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for most recent version.
// MACRO: BOOST_NO_STD_UNORDERED
// TITLE: <unordered_map> and <unordered_set>
// DESCRIPTION: Check for C++0x unordered container support
#include <unordered_map>
#include <unordered_set>
namespace boost_no_std_unordered{
int test()
{
std::unordered_map<int, int> im;
std::unordered_set<int> is;
std::unordered_multimap<int, int> imm;
std::unordered_multiset<int> ims;
return im.size() + is.size() + imm.size() + ims.size(); // all zero
}
}

View File

@@ -1001,6 +1001,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_STD_MIN_MAX); PRINT_MACRO(BOOST_NO_STD_MIN_MAX);
PRINT_MACRO(BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN); PRINT_MACRO(BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN);
PRINT_MACRO(BOOST_NO_STD_TYPEINFO); PRINT_MACRO(BOOST_NO_STD_TYPEINFO);
PRINT_MACRO(BOOST_NO_STD_UNORDERED);
PRINT_MACRO(BOOST_NO_STD_USE_FACET); PRINT_MACRO(BOOST_NO_STD_USE_FACET);
PRINT_MACRO(BOOST_NO_STD_WSTREAMBUF); PRINT_MACRO(BOOST_NO_STD_WSTREAMBUF);
PRINT_MACRO(BOOST_NO_STD_WSTRING); PRINT_MACRO(BOOST_NO_STD_WSTRING);
@@ -1041,6 +1042,7 @@ void print_boost_macros()
// END GENERATED BLOCK // END GENERATED BLOCK

View File

@@ -1,4 +1,4 @@
// This file was automatically generated on Wed Sep 24 11:44:22 2008 // This file was automatically generated on Tue Dec 16 16:41:41 2008
// by libs/config/tools/generate.cpp // by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4. // Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the // Use, modification and distribution are subject to the
@@ -292,6 +292,11 @@ namespace boost_no_std_output_iterator_assign = empty_boost;
#else #else
namespace boost_no_std_typeinfo = empty_boost; namespace boost_no_std_typeinfo = empty_boost;
#endif #endif
#ifndef BOOST_NO_STD_UNORDERED
#include "boost_no_std_unordered.ipp"
#else
namespace boost_no_std_unordered = empty_boost;
#endif
#ifndef BOOST_NO_STD_USE_FACET #ifndef BOOST_NO_STD_USE_FACET
#include "boost_no_std_use_facet.ipp" #include "boost_no_std_use_facet.ipp"
#else #else
@@ -1146,6 +1151,11 @@ int main( int, char *[] )
std::cerr << "Failed test for BOOST_NO_STD_TYPEINFO at: " << __FILE__ << ":" << __LINE__ << std::endl; std::cerr << "Failed test for BOOST_NO_STD_TYPEINFO at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count; ++error_count;
} }
if(0 != boost_no_std_unordered::test())
{
std::cerr << "Failed test for BOOST_NO_STD_UNORDERED at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_std_use_facet::test()) if(0 != boost_no_std_use_facet::test())
{ {
std::cerr << "Failed test for BOOST_NO_STD_USE_FACET at: " << __FILE__ << ":" << __LINE__ << std::endl; std::cerr << "Failed test for BOOST_NO_STD_USE_FACET at: " << __FILE__ << ":" << __LINE__ << std::endl;

View File

@@ -0,0 +1,37 @@
// This file was automatically generated on Tue Dec 16 16:41:40 2008
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id: generate.cpp 49281 2008-10-11 15:40:44Z johnmaddock $
//
// Test file for macro BOOST_NO_STD_UNORDERED
// This file should not compile, if it does then
// BOOST_NO_STD_UNORDERED should not be defined.
// See file boost_no_std_unordered.ipp for details
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include "test.hpp"
#ifdef BOOST_NO_STD_UNORDERED
#include "boost_no_std_unordered.ipp"
#else
#error "this file should not compile"
#endif
int main( int, char *[] )
{
return boost_no_std_unordered::test();
}

View File

@@ -0,0 +1,37 @@
// This file was automatically generated on Tue Dec 16 16:41:40 2008
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id: generate.cpp 49281 2008-10-11 15:40:44Z johnmaddock $
//
// Test file for macro BOOST_NO_STD_UNORDERED
// This file should compile, if it does not then
// BOOST_NO_STD_UNORDERED should be defined.
// See file boost_no_std_unordered.ipp for details
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include "test.hpp"
#ifndef BOOST_NO_STD_UNORDERED
#include "boost_no_std_unordered.ipp"
#else
namespace boost_no_std_unordered = empty_boost;
#endif
int main( int, char *[] )
{
return boost_no_std_unordered::test();
}