[webkit-dev] Using namespace std

Ryosuke Niwa rniwa at webkit.org
Thu May 17 12:02:52 PDT 2012


On Tue, May 15, 2012 at 11:46 AM, Peter Kasting <pkasting at chromium.org>wrote:

> On Tue, May 15, 2012 at 11:37 AM, Ryosuke Niwa <rniwa at webkit.org> wrote:
>
>> On May 15, 2012 10:53 AM, "Peter Kasting" <pkasting at chromium.org> wrote:
>> > Given how little of std:: we actually use (since WTF is used instead
>> for most things), what about just explicitly qualifying usages with std::
>> directly?
>>
>> Can we do that if and only if we have conflicts?
>>
> Well, I guess we can do anything we want :).  It might be nice to have a
> consistent rule though (much like the current style rule is consistent, if
> sometimes problematic).
>

That's a good point.

On Wed, May 16, 2012 at 12:04 PM, Anders Carlsson <andersca at apple.com>
 wrote:
>
> On May 16, 2012, at 9:31 AM, Darin Adler <darin at apple.com> wrote:
> > On May 16, 2012, at 9:20 AM, Allan Sandfeld Jensen wrote:
> >> there is another conflict which is entirely our own fault. It is
> between WTF::bind and the new std::bind from C++11
> > We should find a good solution for this. I’d suggest talking with Anders
> Carlsson about it.
>
> I've run into this and had to use the fully qualified WTF::bind in those
> cases.
>
> FWIW, I don't think we really need using directives for the std namespace
> - the fully qualified name is short enough and I like the additional
> clarity that we're calling something in the standard library.


A fair point especially since we don't use std functions / classes that
often.

It appears to me using fully qualified names (e.g. std::max(~) at call
site) is far superior to using directive for individual symbols (e.g. using
std::max).

- Ryosuke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120517/cb4ce75a/attachment.html>


More information about the webkit-dev mailing list