mirror of
https://github.com/boostorg/dynamic_bitset.git
synced 2026-01-19 04:12:09 +00:00
Make default constructor non-explicit (#48)
It is better to support copy-initialization with default constructor. cf. LWG Issue 2193. Default constructors for standard library containers are explicit.
This commit is contained in:
committed by
Glen Fernandes
parent
26918f80d5
commit
ab192ca5f1
@@ -144,8 +144,11 @@ public:
|
||||
|
||||
typedef bool <a href="#const_reference">const_reference</a>;
|
||||
|
||||
<a href=
|
||||
"#cons0">dynamic_bitset</a>();
|
||||
|
||||
explicit <a href=
|
||||
"#cons1">dynamic_bitset</a>(const Allocator& alloc = Allocator());
|
||||
"#cons1">dynamic_bitset</a>(const Allocator& alloc);
|
||||
|
||||
explicit <a href=
|
||||
"#cons2">dynamic_bitset</a>(size_type num_bits, unsigned long value = 0,
|
||||
@@ -570,19 +573,30 @@ The maximum value of <tt>size_type</tt>.
|
||||
<hr />
|
||||
<pre>
|
||||
<a id=
|
||||
"cons1">dynamic_bitset</a>(const Allocator& alloc = Allocator())
|
||||
"cons0">dynamic_bitset</a>()
|
||||
</pre>
|
||||
|
||||
<b>Effects:</b> Constructs a bitset of size zero. The allocator
|
||||
for this bitset is a default-constructed object of type
|
||||
<tt>Allocator</tt>.<br />
|
||||
<b>Postconditions:</b> <tt>this->size() == 0</tt>.<br />
|
||||
<b>Throws:</b> Nothing unless the default constructor of
|
||||
<tt>Allocator</tt> throws an exception.<br />
|
||||
(Required by <a href=
|
||||
"https://boost.org/sgi/stl/DefaultConstructible.html">Default
|
||||
Constructible</a>.)
|
||||
|
||||
<hr />
|
||||
<pre>
|
||||
<a id=
|
||||
"cons1">dynamic_bitset</a>(const Allocator& alloc)
|
||||
</pre>
|
||||
|
||||
<b>Effects:</b> Constructs a bitset of size zero. A copy of the
|
||||
<tt>alloc</tt> object will be used in subsequent bitset
|
||||
operations such as <tt>resize</tt> to allocate memory.<br />
|
||||
<b>Postconditions:</b> <tt>this->size() == 0</tt>.<br />
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if
|
||||
<tt>Allocator=std::allocator</tt>).<br />
|
||||
(Required by <a href=
|
||||
"https://boost.org/sgi/stl/DefaultConstructible.html">Default
|
||||
Constructible</a>.)
|
||||
<b>Throws:</b> nothing.
|
||||
|
||||
<hr />
|
||||
<pre>
|
||||
|
||||
Reference in New Issue
Block a user