<div dir="ltr">It's not obvious to me that the behavior of max_size is correct.<div><br></div><div>To my reading, __allocate is required to throw std::bad_array_length if the multiplication overflows.</div><div><br></div>
<div>Your reinterpret_casts from void* to (const) _Tp* could be static_casts.</div><div><br></div><div>The constructor overloads look... horribly broken. This won't work:</div><div><br></div><div>  std::dynarray<long> arr(20, 0);</div>
<div><br></div><div>... because it picks the (size_t, const _Alloc&) constructor, not the (size_t, const value_type&) constructor. Is there an LWG issue for that?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Sep 9, 2013 at 9:06 AM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<dynarray> See <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3662.html" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3662.html</a><br>
<br>
Open Issues:<br>
1) This includes <tuple> because that's where __uses_alloc_ctor lives. I'm thinking that __uses_alloc_ctor should be hoisted into a common header. Maybe __functional_base.<br>
<br>
2) This includes a general implementation of user-allocator construction (named __user_alloc_construct). This should probably be hoisted as well; and possibly the code in scoped_allocator can be reworked to use it (if it simplifies things).<br>

<br>
3) There's no support for stack allocations at present; that requires compiler support. I'm working with some people on getting that into clang.<br>
<br>
4) There's an awful lot of duplication in the (many, many) constructors.<br>
<br>
-- Marshall<br>
<br>
Marshall Clow     Idio Software   <mailto:<a href="mailto:mclow.lists@gmail.com">mclow.lists@gmail.com</a>><br>
<br>
A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).<br>
        -- Yu Suzuki<br>
<br>
</blockquote></div><br></div>