[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] Heads up - Allocator value_type vs container value_type
From:       Marshall Clow via cfe-dev <cfe-dev () lists ! llvm ! org>
Date:       2015-11-26 1:27:20
Message-ID: CAMBqOshEMZha=Gh6OxOq55wk9wY-TJmGHdWLUoGtRVOw5+Mk=w () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Tue, Nov 24, 2015 at 2:21 PM, Marshall Clow <mclow.lists@gmail.com>
wrote:

> The C++ standard requires that the value_type of an allocator match the
> value_type of the container that uses that allocator. (table 98, first row).
>
> libc++ has, for a long time, caused a compile-time failure if this is not
> true for many containers (list, string, unordered_[multi]map,
> unordered_[multi]set and vector), but not for all of them.
> Specifically, deque, forward_list, [multi]map and [multi]set are missing
> this check.
>
> I will be adding these checks very soon (tomorrow). These will turn
> run-time undefined behavior into a compile time error.
>
> Committed as revision 254119.

-- Marshall

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 24, 2015 \
at 2:21 PM, Marshall Clow <span dir="ltr">&lt;<a href="mailto:mclow.lists@gmail.com" \
target="_blank">mclow.lists@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div \
dir="ltr">The C++ standard requires that the value_type of an allocator match the \
value_type of the container that uses that allocator. (table 98, first \
row).<div><br></div><div>libc++ has, for a long time, caused a compile-time failure \
if this is not true for many containers (list, string, unordered_[multi]map, \
unordered_[multi]set and vector), but not for all of them. Specifically,  deque, \
forward_list, [multi]map and [multi]set are missing this \
check.</div><div><br></div><div>I will be adding these checks very soon (tomorrow). \
These will turn run-time undefined behavior into a compile time \
error.</div><div><br></div></div></blockquote><div>Committed as revision \
254119.</div><div>  </div></div>-- Marshall</div></div>


[Attachment #6 (text/plain)]

_______________________________________________
cfe-dev mailing list
cfe-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic