Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-07-04 18:57:20


Author: danieljames
Date: 2008-07-04 18:57:20 EDT (Fri, 04 Jul 2008)
New Revision: 47085
URL: http://svn.boost.org/trac/boost/changeset/47085

Log:
Require explicit conversion from allocators.

(Not what it says in the draft standard, but I think that might be a defect).

Text files modified:
   trunk/boost/unordered_map.hpp | 5 ++---
   trunk/boost/unordered_set.hpp | 6 ++----
   trunk/libs/unordered/doc/ref.xml | 10 +++++-----
   3 files changed, 9 insertions(+), 12 deletions(-)

Modified: trunk/boost/unordered_map.hpp
==============================================================================
--- trunk/boost/unordered_map.hpp (original)
+++ trunk/boost/unordered_map.hpp 2008-07-04 18:57:20 EDT (Fri, 04 Jul 2008)
@@ -107,8 +107,7 @@
         {
         }
 
- // TODO: Should this be explicit?
- unordered_map(allocator_type const& a)
+ explicit unordered_map(allocator_type const& a)
             : base(boost::unordered_detail::default_initial_bucket_count,
                 hasher(), key_equal(), a)
         {
@@ -504,7 +503,7 @@
         {
         }
 
- unordered_multimap(allocator_type const& a)
+ explicit unordered_multimap(allocator_type const& a)
             : base(boost::unordered_detail::default_initial_bucket_count,
                 hasher(), key_equal(), a)
         {

Modified: trunk/boost/unordered_set.hpp
==============================================================================
--- trunk/boost/unordered_set.hpp (original)
+++ trunk/boost/unordered_set.hpp 2008-07-04 18:57:20 EDT (Fri, 04 Jul 2008)
@@ -104,8 +104,7 @@
         {
         }
 
- // TODO: Should this be explicit?
- unordered_set(allocator_type const& a)
+ explicit unordered_set(allocator_type const& a)
             : base(boost::unordered_detail::default_initial_bucket_count,
                 hasher(), key_equal(), a)
         {
@@ -473,8 +472,7 @@
         {
         }
 
- // TODO: Should this be explicit?
- unordered_multiset(allocator_type const& a)
+ explicit unordered_multiset(allocator_type const& a)
             : base(boost::unordered_detail::default_initial_bucket_count,
                 hasher(), key_equal(), a)
         {

Modified: trunk/libs/unordered/doc/ref.xml
==============================================================================
--- trunk/libs/unordered/doc/ref.xml (original)
+++ trunk/libs/unordered/doc/ref.xml 2008-07-04 18:57:20 EDT (Fri, 04 Jul 2008)
@@ -181,7 +181,7 @@
               <para>The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.</para>
             </description>
           </constructor>
- <constructor>
+ <constructor specifiers="explicit">
             <parameter name="a">
               <paramtype>Allocator const&amp;</paramtype>
             </parameter>
@@ -928,7 +928,7 @@
               <para>The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.</para>
             </description>
           </constructor>
- <constructor>
+ <constructor specifiers="explicit">
             <parameter name="a">
               <paramtype>Allocator const&amp;</paramtype>
             </parameter>
@@ -1685,7 +1685,7 @@
               <para>The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.</para>
             </description>
           </constructor>
- <constructor>
+ <constructor specifiers="explicit">
             <parameter name="a">
               <paramtype>Allocator const&amp;</paramtype>
             </parameter>
@@ -2483,7 +2483,7 @@
               <para>The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.</para>
             </description>
           </constructor>
- <constructor>
+ <constructor specifiers="explicit">
             <parameter name="a">
               <paramtype>Allocator const&amp;</paramtype>
             </parameter>
@@ -3062,4 +3062,4 @@
         </class>
       </namespace>
     </header>
- </library-reference>
\ No newline at end of file
+ </library-reference>


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