Bug 121523 - Add make_unique and start using it
Summary: Add make_unique and start using it
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-17 14:41 PDT by Sam Weinig
Modified: 2013-09-18 18:43 PDT (History)
4 users (show)

See Also:


Attachments
Patch (7.07 KB, patch)
2013-09-17 14:43 PDT, Sam Weinig
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2013-09-17 14:41:39 PDT
Add make_unique and start using it
Comment 1 Sam Weinig 2013-09-17 14:43:45 PDT
Created attachment 211946 [details]
Patch
Comment 2 Sam Weinig 2013-09-17 14:44:59 PDT
Committed r156000: <http://trac.webkit.org/changeset/156000>
Comment 3 Darin Adler 2013-09-18 18:30:35 PDT
Comment on attachment 211946 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=211946&action=review

> Source/WTF/wtf/StdLibExtras.h:311
> +// For standard libraries that do not yet include it, this adds the std::make_unique
> +// type. It is defined in the same namespaces as it would be in library that had the
> +// support.

But this is not conditional. How does it not cause a problem in libraries that do include it?

Also, std::make_unique is a function template, not a type.
Comment 4 Sam Weinig 2013-09-18 18:43:49 PDT
(In reply to comment #3)
> (From update of attachment 211946 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=211946&action=review
> 
> > Source/WTF/wtf/StdLibExtras.h:311
> > +// For standard libraries that do not yet include it, this adds the std::make_unique
> > +// type. It is defined in the same namespaces as it would be in library that had the
> > +// support.
> 
> But this is not conditional. How does it not cause a problem in libraries that do include it?

When libraries that support it come into existence (e.g. we get a compile failure), I plan to add a conditional #if STANDARD_LIBRARY_SUPPORTS(...) or something like that.

> Also, std::make_unique is a function template, not a type.

Good point.