Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make default constructor non-explicit #48

Merged
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -144,8 +144,11 @@ <h3><a id ="synopsis">Synopsis</a></h3>

typedef bool <a href="#const_reference">const_reference</a>;

<a href=
"#cons0">dynamic_bitset</a>();

explicit <a href=
"#cons1">dynamic_bitset</a>(const Allocator&amp; alloc = Allocator());
"#cons1">dynamic_bitset</a>(const Allocator&amp; alloc);

explicit <a href=
"#cons2">dynamic_bitset</a>(size_type num_bits, unsigned long value = 0,
@@ -570,20 +573,31 @@ <h3><a id="constructors">Constructors</a></h3>
<hr />
<pre>
<a id=
"cons1">dynamic_bitset</a>(const Allocator&amp; alloc = Allocator())
"cons0">dynamic_bitset</a>()
</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>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-&gt;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 />
<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&amp; 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-&gt;size() == 0</tt>.<br />
<b>Throws:</b> nothing.

<hr />
<pre>
<a id="cons2">dynamic_bitset</a>(size_type num_bits,
@@ -128,8 +128,10 @@ class dynamic_bitset
typedef bool const_reference;

// constructors, etc.
dynamic_bitset() : m_num_bits(0) {}

explicit
dynamic_bitset(const Allocator& alloc = Allocator());
dynamic_bitset(const Allocator& alloc);

explicit
dynamic_bitset(size_type num_bits, unsigned long value = 0,
@@ -517,6 +517,11 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
bitset_test<Bitset>::max_size(b);
}
#endif
// Test copy-initialize with default constructor
{
boost::dynamic_bitset<Block> b[1] = {};
(void)b;
}
}

int
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.