RESOLVED DUPLICATE of bug 177473 177568
default_construct_at
https://bugs.webkit.org/show_bug.cgi?id=177568
Summary default_construct_at
JF Bastien
Reported 2017-09-27 14:08:13 PDT
https://bugs.webkit.org/show_bug.cgi?id=177473 has so pretty ugly code to default construct a generic ArrayPtr<T>: new (&container.get()[i]) std::remove_reference_t<decltype(*container.get())>(); Let's add default_construct_at, which jyasskin suggested I do.
Attachments
patch (1.60 KB, patch)
2017-09-27 14:10 PDT, JF Bastien
no flags
JF Bastien
Comment 1 2017-09-27 14:10:33 PDT
Build Bot
Comment 2 2017-09-27 14:12:08 PDT
Attachment 322015 [details] did not pass style-queue: ERROR: Source/WTF/wtf/StdLibExtras.h:164: default_construct_at is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
JF Bastien
Comment 3 2017-09-28 11:34:43 PDT
cdumez suggested I do this change straight in #177473 and use it there. Closing to do that instead. *** This bug has been marked as a duplicate of bug 177473 ***
Darin Adler
Comment 4 2017-11-22 11:30:00 PST
Comment on attachment 322015 [details] patch Unlike the others who commented on this, I do think this might possibly make some call sites a little easier to read, and why not get on board now if it’s the future of C++ anyway. But I don’t think we should land the change without using it anywhere.
Darin Adler
Comment 5 2017-11-22 11:30:20 PST
Oh, this bug is obsolete. Clearing the flags.
JF Bastien
Comment 6 2017-11-27 10:03:32 PST
(In reply to Darin Adler from comment #4) > Comment on attachment 322015 [details] > patch > > Unlike the others who commented on this, I do think this might possibly make > some call sites a little easier to read, and why not get on board now if > it’s the future of C++ anyway. But I don’t think we should land the change > without using it anywhere. I liked it too, it made the sample code way more readable, but it's admittedly a rare thing so I'm happy not pushing it and leaving the obscure placement new code as-is.
Note You need to log in before you can comment on or make changes to this bug.