|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50118 - in trunk: boost/config/compiler boost/unordered libs/config/doc libs/config/doc/html libs/config/doc/html/boost_config libs/config/test libs/config/test/all libs/unordered/doc libs/unordered/test/unordered
From: daniel_james_at_[hidden]
Date: 2008-12-04 16:30:22
Author: danieljames
Date: 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
New Revision: 50118
URL: http://svn.boost.org/trac/boost/changeset/50118
Log:
Add support for initializer lists to config and the unordered containers.
Added:
trunk/libs/config/test/boost_no_initializer_lists.ipp
- copied unchanged from r48950, /branches/initializer-list/libs/config/test/boost_no_initializer_lists.ipp
trunk/libs/config/test/no_initializer_lists_fail.cpp
- copied unchanged from r48950, /branches/initializer-list/libs/config/test/no_initializer_lists_fail.cpp
trunk/libs/config/test/no_initializer_lists_pass.cpp
- copied unchanged from r48950, /branches/initializer-list/libs/config/test/no_initializer_lists_pass.cpp
Text files modified:
trunk/boost/config/compiler/borland.hpp | 2 ++
trunk/boost/config/compiler/common_edg.hpp | 5 +++++
trunk/boost/config/compiler/digitalmars.hpp | 1 +
trunk/boost/config/compiler/gcc.hpp | 4 ++++
trunk/boost/config/compiler/metrowerks.hpp | 1 +
trunk/boost/config/compiler/mpw.hpp | 2 ++
trunk/boost/config/compiler/pgi.hpp | 1 +
trunk/boost/config/compiler/sgi_mipspro.hpp | 2 ++
trunk/boost/config/compiler/sunpro_cc.hpp | 1 +
trunk/boost/config/compiler/vacpp.hpp | 1 +
trunk/boost/config/compiler/visualc.hpp | 4 ++++
trunk/boost/unordered/unordered_map.hpp | 36 ++++++++++++++++++++++++++++++++++++
trunk/boost/unordered/unordered_set.hpp | 36 ++++++++++++++++++++++++++++++++++++
trunk/libs/config/doc/html/boost_config/acknowledgements.html | 4 ++--
trunk/libs/config/doc/html/boost_config/boost_macro_reference.html | 16 ++++++++++++++--
trunk/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html | 4 ++--
trunk/libs/config/doc/html/boost_config/rationale.html | 4 ++--
trunk/libs/config/doc/html/index.html | 8 ++++----
trunk/libs/config/doc/macro_reference.qbk | 3 +++
trunk/libs/config/test/all/Jamfile.v2 | 5 ++++-
trunk/libs/config/test/config_info.cpp | 2 ++
trunk/libs/config/test/config_test.cpp | 12 +++++++++++-
trunk/libs/unordered/doc/changes.qbk | 2 ++
trunk/libs/unordered/test/unordered/assign_tests.cpp | 16 ++++++++++++++++
trunk/libs/unordered/test/unordered/constructor_tests.cpp | 11 +++++++++++
25 files changed, 169 insertions(+), 14 deletions(-)
Modified: trunk/boost/config/compiler/borland.hpp
==============================================================================
--- trunk/boost/config/compiler/borland.hpp (original)
+++ trunk/boost/config/compiler/borland.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -158,6 +158,8 @@
# #endif //__BORLANDC__ >= 0x610
#endif
+#define BOOST_NO_INITIALIZER_LISTS
+
#if __BORLANDC__ >= 0x590
# define BOOST_HAS_TR1_HASH
Modified: trunk/boost/config/compiler/common_edg.hpp
==============================================================================
--- trunk/boost/config/compiler/common_edg.hpp (original)
+++ trunk/boost/config/compiler/common_edg.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -43,6 +43,11 @@
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#endif
+#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG)
+// No support for initializer lists
+# define BOOST_NO_INITIALIZER_LISTS
+#endif
+
// See also kai.hpp which checks a Kai-specific symbol for EH
# if !defined(__KCC) && !defined(__EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
Modified: trunk/boost/config/compiler/digitalmars.hpp
==============================================================================
--- trunk/boost/config/compiler/digitalmars.hpp (original)
+++ trunk/boost/config/compiler/digitalmars.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -26,6 +26,7 @@
#define BOOST_NO_SFINAE
#define BOOST_NO_USING_TEMPLATE
#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#define BOOST_NO_INITIALIZER_LISTS
#endif
//
Modified: trunk/boost/config/compiler/gcc.hpp
==============================================================================
--- trunk/boost/config/compiler/gcc.hpp (original)
+++ trunk/boost/config/compiler/gcc.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -116,6 +116,10 @@
# endif
#endif
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
+# define BOOST_NO_INITIALIZER_LISTS
+#endif
+
//
// Potential C++0x features
//
Modified: trunk/boost/config/compiler/metrowerks.hpp
==============================================================================
--- trunk/boost/config/compiler/metrowerks.hpp (original)
+++ trunk/boost/config/compiler/metrowerks.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -42,6 +42,7 @@
# if(__MWERKS__ <= 0x3206) || !defined(BOOST_STRICT_CONFIG) // 9.5
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_IS_ABSTRACT
+# define BOOST_NO_INITIALIZER_LISTS
# endif
#if !__option(wchar_type)
Modified: trunk/boost/config/compiler/mpw.hpp
==============================================================================
--- trunk/boost/config/compiler/mpw.hpp (original)
+++ trunk/boost/config/compiler/mpw.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -32,6 +32,8 @@
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
# define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */
+
+# define BOOST_NO_INITIALIZER_LISTS
#endif
//
Modified: trunk/boost/config/compiler/pgi.hpp
==============================================================================
--- trunk/boost/config/compiler/pgi.hpp (original)
+++ trunk/boost/config/compiler/pgi.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -21,6 +21,7 @@
#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_SWPRINTF
+#define BOOST_NO_INITIALIZER_LISTS
#else
Modified: trunk/boost/config/compiler/sgi_mipspro.hpp
==============================================================================
--- trunk/boost/config/compiler/sgi_mipspro.hpp (original)
+++ trunk/boost/config/compiler/sgi_mipspro.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -21,6 +21,8 @@
#undef BOOST_NO_SWPRINTF
#undef BOOST_DEDUCED_TYPENAME
+
+#define BOOST_NO_INITIALIZER_LISTS
//
// version check:
// probably nothing to do here?
Modified: trunk/boost/config/compiler/sunpro_cc.hpp
==============================================================================
--- trunk/boost/config/compiler/sunpro_cc.hpp (original)
+++ trunk/boost/config/compiler/sunpro_cc.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -74,6 +74,7 @@
//
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_ADL_BARRIER
+#define BOOST_NO_INITIALIZER_LISTS
#if(__SUNPRO_CC >= 0x590)
# define BOOST_HAS_LONG_LONG
Modified: trunk/boost/config/compiler/vacpp.hpp
==============================================================================
--- trunk/boost/config/compiler/vacpp.hpp (original)
+++ trunk/boost/config/compiler/vacpp.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -27,6 +27,7 @@
#if (__IBMCPP__ <= 600) || !defined(BOOST_STRICT_CONFIG)
# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
+# define BOOST_NO_INITIALIZER_LISTS
#endif
//
Modified: trunk/boost/config/compiler/visualc.hpp
==============================================================================
--- trunk/boost/config/compiler/visualc.hpp (original)
+++ trunk/boost/config/compiler/visualc.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -93,6 +93,10 @@
# define BOOST_NO_ADL_BARRIER
#endif
+#if _MSC_VER <= 1500 || !defined(BOOST_STRICT_CONFIG) // 1500 == VC++ 9.0
+# define BOOST_NO_INITIALIZER_LISTS
+#endif
+
#ifndef _NATIVE_WCHAR_T_DEFINED
# define BOOST_NO_INTRINSIC_WCHAR_T
#endif
Modified: trunk/boost/unordered/unordered_map.hpp
==============================================================================
--- trunk/boost/unordered/unordered_map.hpp (original)
+++ trunk/boost/unordered/unordered_map.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -135,6 +135,24 @@
#endif
#endif
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+ unordered_map(std::initializer_list<value_type> list,
+ size_type n = boost::unordered_detail::default_initial_bucket_count,
+ const hasher &hf = hasher(),
+ const key_equal &eql = key_equal(),
+ const allocator_type &a = allocator_type())
+ : base(list.begin(), list.end(), n, hf, eql, a)
+ {
+ }
+
+ unordered_map& operator=(std::initializer_list<value_type> list)
+ {
+ base.data_.clear();
+ base.insert_range(list.begin(), list.end());
+ return *this;
+ }
+#endif
+
private:
BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
@@ -523,6 +541,24 @@
#endif
#endif
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+ unordered_multimap(std::initializer_list<value_type> list,
+ size_type n = boost::unordered_detail::default_initial_bucket_count,
+ const hasher &hf = hasher(),
+ const key_equal &eql = key_equal(),
+ const allocator_type &a = allocator_type())
+ : base(list.begin(), list.end(), n, hf, eql, a)
+ {
+ }
+
+ unordered_multimap& operator=(std::initializer_list<value_type> list)
+ {
+ base.data_.clear();
+ base.insert_range(list.begin(), list.end());
+ return *this;
+ }
+#endif
+
private:
Modified: trunk/boost/unordered/unordered_set.hpp
==============================================================================
--- trunk/boost/unordered/unordered_set.hpp (original)
+++ trunk/boost/unordered/unordered_set.hpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -133,6 +133,24 @@
#endif
#endif
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+ unordered_set(std::initializer_list<value_type> list,
+ size_type n = boost::unordered_detail::default_initial_bucket_count,
+ const hasher &hf = hasher(),
+ const key_equal &eql = key_equal(),
+ const allocator_type &a = allocator_type())
+ : base(list.begin(), list.end(), n, hf, eql, a)
+ {
+ }
+
+ unordered_set& operator=(std::initializer_list<value_type> list)
+ {
+ base.data_.clear();
+ base.insert_range(list.begin(), list.end());
+ return *this;
+ }
+#endif
+
private:
BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
@@ -493,6 +511,24 @@
#endif
#endif
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+ unordered_multiset(std::initializer_list<value_type> list,
+ size_type n = boost::unordered_detail::default_initial_bucket_count,
+ const hasher &hf = hasher(),
+ const key_equal &eql = key_equal(),
+ const allocator_type &a = allocator_type())
+ : base(list.begin(), list.end(), n, hf, eql, a)
+ {
+ }
+
+ unordered_multiset& operator=(std::initializer_list<value_type> list)
+ {
+ base.data_.clear();
+ base.insert_range(list.begin(), list.end());
+ return *this;
+ }
+#endif
+
private:
BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
Modified: trunk/libs/config/doc/html/boost_config/acknowledgements.html
==============================================================================
--- trunk/libs/config/doc/html/boost_config/acknowledgements.html (original)
+++ trunk/libs/config/doc/html/boost_config/acknowledgements.html 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Acknowledgements</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
-<link rel="home" href="../index.html" title="Boost.Config">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Boost.Config">
<link rel="up" href="../index.html" title="Boost.Config">
<link rel="prev" href="rationale.html" title="Rationale">
</head>
Modified: trunk/libs/config/doc/html/boost_config/boost_macro_reference.html
==============================================================================
--- trunk/libs/config/doc/html/boost_config/boost_macro_reference.html (original)
+++ trunk/libs/config/doc/html/boost_config/boost_macro_reference.html 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost Macro Reference</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
-<link rel="home" href="../index.html" title="Boost.Config">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" 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="next" href="guidelines_for_boost_authors.html" title="Guidelines for Boost Authors">
@@ -2335,6 +2335,18 @@
<tr>
<td>
<p>
+ <code class="computeroutput"><span class="identifier">BOOST_NO_INITIALIZER_LISTS</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The C++ compiler does not support C++0x initializer lists.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
<code class="computeroutput"><span class="identifier">BOOST_NO_LONG_LONG</span></code>
</p>
</td>
Modified: trunk/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html
==============================================================================
--- trunk/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html (original)
+++ trunk/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Guidelines for Boost Authors</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
-<link rel="home" href="../index.html" title="Boost.Config">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" 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="next" href="rationale.html" title="Rationale">
Modified: trunk/libs/config/doc/html/boost_config/rationale.html
==============================================================================
--- trunk/libs/config/doc/html/boost_config/rationale.html (original)
+++ trunk/libs/config/doc/html/boost_config/rationale.html 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Rationale</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
-<link rel="home" href="../index.html" title="Boost.Config">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" 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="next" href="acknowledgements.html" title="Acknowledgements">
Modified: trunk/libs/config/doc/html/index.html
==============================================================================
--- trunk/libs/config/doc/html/index.html (original)
+++ trunk/libs/config/doc/html/index.html 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Config</title>
<link rel="stylesheet" href="../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
-<link rel="home" href="index.html" title="Boost.Config">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="index.html" title="Boost.Config">
<link rel="next" href="boost_config/boost_macro_reference.html" title="Boost Macro Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -28,7 +28,7 @@
</h3></div></div></div>
<div><p class="copyright">Copyright © 2001 -2007 Beman Dawes, Vesa Karvonen, John Maddock</p></div>
<div><div class="legalnotice">
-<a name="id527120"></a><p>
+<a name="id2843756"></a><p>
Distributed under 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)
</p>
@@ -960,7 +960,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: November 20, 2008 at 16:52:46 GMT</small></p></td>
+<td align="left"><p><small>Last revised: December 04, 2008 at 21:06:12 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: trunk/libs/config/doc/macro_reference.qbk
==============================================================================
--- trunk/libs/config/doc/macro_reference.qbk (original)
+++ trunk/libs/config/doc/macro_reference.qbk 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -548,6 +548,9 @@
[[`BOOST_NO_EXTERN_TEMPLATE`][The compiler does not support
explicit instantiation declarations for templates (`explicit template`).
]]
+[[`BOOST_NO_INITIALIZER_LISTS`][
+The C++ compiler does not support C++0x initializer lists.
+]]
[[`BOOST_NO_LONG_LONG`][The compiler does not support `long long`.
]]
[[`BOOST_NO_RAW_LITERALS`][The compiler does not support
Modified: trunk/libs/config/test/all/Jamfile.v2
==============================================================================
--- trunk/libs/config/test/all/Jamfile.v2 (original)
+++ trunk/libs/config/test/all/Jamfile.v2 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -1,7 +1,7 @@
#
# Regression test Jamfile for boost configuration setup.
# *** DO NOT EDIT THIS FILE BY HAND ***
-# This file was automatically generated on Sat Sep 20 09:49:52 2008
+# This file was automatically generated on Wed Sep 24 11:44:22 2008
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@@ -232,6 +232,9 @@
test-suite "BOOST_NO_MS_INT64_NUMERIC_LIMITS" :
[ run ../no_i64_limits_pass.cpp ]
[ compile-fail ../no_i64_limits_fail.cpp ] ;
+test-suite "BOOST_NO_INITIALIZER_LISTS" :
+[ run ../no_initializer_lists_pass.cpp ]
+[ compile-fail ../no_initializer_lists_fail.cpp ] ;
test-suite "BOOST_NO_INCLASS_MEMBER_INITIALIZATION" :
[ run ../no_inline_memb_init_pass.cpp ]
[ compile-fail ../no_inline_memb_init_fail.cpp ] ;
Modified: trunk/libs/config/test/config_info.cpp
==============================================================================
--- trunk/libs/config/test/config_info.cpp (original)
+++ trunk/libs/config/test/config_info.cpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -969,6 +969,7 @@
PRINT_MACRO(BOOST_NO_FUNCTION_TEMPLATE_ORDERING);
PRINT_MACRO(BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS);
PRINT_MACRO(BOOST_NO_INCLASS_MEMBER_INITIALIZATION);
+ PRINT_MACRO(BOOST_NO_INITIALIZER_LISTS);
PRINT_MACRO(BOOST_NO_INTEGRAL_INT64_T);
PRINT_MACRO(BOOST_NO_INTRINSIC_WCHAR_T);
PRINT_MACRO(BOOST_NO_IOSFWD);
@@ -1041,6 +1042,7 @@
+
// END GENERATED BLOCK
PRINT_MACRO(BOOST_INTEL);
Modified: trunk/libs/config/test/config_test.cpp
==============================================================================
--- trunk/libs/config/test/config_test.cpp (original)
+++ trunk/libs/config/test/config_test.cpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -1,4 +1,4 @@
-// This file was automatically generated on Sat Sep 20 09:49:52 2008
+// This file was automatically generated on Wed Sep 24 11:44:22 2008
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
@@ -117,6 +117,11 @@
#else
namespace boost_no_ms_int64_numeric_limits = empty_boost;
#endif
+#ifndef BOOST_NO_INITIALIZER_LISTS
+#include "boost_no_initializer_lists.ipp"
+#else
+namespace boost_no_initializer_lists = empty_boost;
+#endif
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
#include "boost_no_inline_memb_init.ipp"
#else
@@ -966,6 +971,11 @@
std::cerr << "Failed test for BOOST_NO_MS_INT64_NUMERIC_LIMITS at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
+ if(0 != boost_no_initializer_lists::test())
+ {
+ std::cerr << "Failed test for BOOST_NO_INITIALIZER_LISTS at: " << __FILE__ << ":" << __LINE__ << std::endl;
+ ++error_count;
+ }
if(0 != boost_no_inclass_member_initialization::test())
{
std::cerr << "Failed test for BOOST_NO_INCLASS_MEMBER_INITIALIZATION at: " << __FILE__ << ":" << __LINE__ << std::endl;
Modified: trunk/libs/unordered/doc/changes.qbk
==============================================================================
--- trunk/libs/unordered/doc/changes.qbk (original)
+++ trunk/libs/unordered/doc/changes.qbk 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -59,5 +59,7 @@
the allocator's `construct` method - once for the pointers and once for the
value. It now constructs the node with a single call to construct and
then constructs the value using in place construction.
+* Add support for C++0x initializer lists where they're available (currently
+ only g++ 4.4 in C++0x mode).
[endsect]
Modified: trunk/libs/unordered/test/unordered/assign_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/assign_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/assign_tests.cpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -103,6 +103,22 @@
((default_generator)(generate_collisions))
)
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+
+UNORDERED_AUTO_TEST(assign_initializer_list)
+{
+ std::cerr<<"Initializer List Tests\n";
+
+ boost::unordered_set<int> x;
+ x.insert(10);
+ x.insert(20);
+ x = { 1, 2, -10 };
+ BOOST_CHECK(x.find(10) == x.end());
+ BOOST_CHECK(x.find(-10) != x.end());
+}
+
+#endif
+
}
RUN_TESTS()
Modified: trunk/libs/unordered/test/unordered/constructor_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/constructor_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/constructor_tests.cpp 2008-12-04 16:30:19 EST (Thu, 04 Dec 2008)
@@ -288,6 +288,17 @@
((test_map)(test_multimap))
)
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+
+UNORDERED_AUTO_TEST(test_initializer_list) {
+ std::cerr<<"Initializer List Tests\n";
+ boost::unordered_set<int> x1 = { 2, 10, 45, -5 };
+ BOOST_CHECK(x1.find(10) != x1.end());
+ BOOST_CHECK(x1.find(46) == x1.end());
+}
+
+#endif
+
}
RUN_TESTS()
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk