[webkit-dev] More C++11 in WebKit2!
Hello everyone, just a friendly heads-up that I intend to land https://bugs.webkit.org/show_bug.cgi?id=115259 soon, which makes use of three more C++11 features, namely: - Not requiring a space between right angle brackets in templates. - Range-based for loops - Auto. Looks like the EFL and Qt ports need to start building as C++11! The rest of the ports are fine. Thanks, - Anders ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] More C++11 in WebKit2!
Hello, That is great direction, think EFL will be build as C++11 soon. In continuation of the topic I'd like also to know people's opinion about Pass*Ptr types deprecation: At the moment all the WTF smart ptr types have move semantics in place (WTF::RefPtr was the last http://trac.webkit.org/changeset/149184), some work is still to be done with WTF containers (basically removing Pass*Ptr from container's type traits) but that does not look as a huge work and once it is done we do not need Pass*Ptr types at all. What do you think? BR, Mikhail From: webkit-dev-boun...@lists.webkit.org [webkit-dev-boun...@lists.webkit.org] on behalf of Anders Carlsson [ander...@apple.com] Sent: Saturday, April 27, 2013 10:05 PM To: webkit-dev@lists.webkit.org Subject: [webkit-dev] More C++11 in WebKit2! Hello everyone, just a friendly heads-up that I intend to land https://bugs.webkit.org/show_bug.cgi?id=115259 soon, which makes use of three more C++11 features, namely: - Not requiring a space between right angle brackets in templates. - Range-based for loops - Auto. Looks like the EFL and Qt ports need to start building as C++11! The rest of the ports are fine. Thanks, - Anders ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev - Intel Finland Oy Registered Address: PL 281, 00181 Helsinki Business Identity Code: 0357606 - 4 Domiciled in Helsinki This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] More C++11 in WebKit2!
Hi Mikhail. > In continuation of the topic I'd like also to know people's opinion about > Pass*Ptr types deprecation: I don't think this is appropriate until the compilers on all our major target platforms support C++11. I believe Windows is currently the primary barrier. Once we have C++11 on all our major target platforms, I think it would great to adopt C++11 idioms throughout the project. I believe that part of our reasoning for deploying C++11 idioms in WebKit2 is that it meets this criterion. Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] More C++11 in WebKit2!
Hi, Just for clarification: This means dropping support for Visual Studio 2010 and requiring 2012 (released about a year ago). Simon Anders Carlsson wrote: Hello everyone, just a friendly heads-up that I intend to land https://bugs.webkit.org/show_bug.cgi?id=115259 soon, which makes use of three more C++11 features, namely: - Not requiring a space between right angle brackets in templates. - Range-based for loops - Auto. Looks like the EFL and Qt ports need to start building as C++11! The rest of the ports are fine. Thanks, - Anders ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] More C++11 in WebKit2!
Hello, that was not my intention. I was under the (wrong) impression that range-based for existed in VS2010. I'll back that change out. - Anders On Apr 28, 2013, at 1:26 PM, Hausmann Simon wrote: > Hi, > > Just for clarification: This means dropping support for Visual Studio 2010 > and requiring 2012 (released about a year ago). > > Simon > > Anders Carlsson wrote: > > > Hello everyone, > > just a friendly heads-up that I intend to land > https://bugs.webkit.org/show_bug.cgi?id=115259 soon, which makes use of three > more C++11 features, namely: > > - Not requiring a space between right angle brackets in templates. > - Range-based for loops > - Auto. > > Looks like the EFL and Qt ports need to start building as C++11! The rest of > the ports are fine. > > Thanks, > - Anders > ___ > webkit-dev mailing list > webkit-dev@lists.webkit.org > https://lists.webkit.org/mailman/listinfo/webkit-dev > ___ > webkit-dev mailing list > webkit-dev@lists.webkit.org > https://lists.webkit.org/mailman/listinfo/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] More C++11 in WebKit2!
On Apr 28, 2013, at 1:00 PM, Geoffrey Garen wrote: > Hi Mikhail. > >> In continuation of the topic I'd like also to know people's opinion about >> Pass*Ptr types deprecation: > > I don't think this is appropriate until the compilers on all our major target > platforms support C++11. I believe Windows is currently the primary barrier. > > Once we have C++11 on all our major target platforms, I think it would great > to adopt C++11 idioms throughout the project. > > I believe that part of our reasoning for deploying C++11 idioms in WebKit2 is > that it meets this criterion. I agree. In WebKit2 we have much more freedom to do C++11 experimentation, both due to not having to think about Windows but also due to the fact that WebKit2 is about one fifth the size of WebCore when it comes to number of lines of code. When we come up with successful C++11 design patterns and idioms in WebKit2, we can apply them to WebCore when the time is ready. (One thing I’m playing with in WebKit2 is to stop using PassOwnPtr and just using std::move instead). - Anders ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] More C++11 in WebKit2!
On Apr 29, 2013, at 10:33 AM, Anders Carlsson wrote: > > On Apr 28, 2013, at 1:00 PM, Geoffrey Garen wrote: > >> Hi Mikhail. >> >>> In continuation of the topic I'd like also to know people's opinion about >>> Pass*Ptr types deprecation: >> >> I don't think this is appropriate until the compilers on all our major >> target platforms support C++11. I believe Windows is currently the primary >> barrier. >> >> Once we have C++11 on all our major target platforms, I think it would great >> to adopt C++11 idioms throughout the project. >> >> I believe that part of our reasoning for deploying C++11 idioms in WebKit2 >> is that it meets this criterion. > > I agree. > > In WebKit2 we have much more freedom to do C++11 experimentation, both due to > not having to think about Windows but also due to the fact that WebKit2 is > about one fifth the size of WebCore when it comes to number of lines of code. > > When we come up with successful C++11 design patterns and idioms in WebKit2, > we can apply them to WebCore when the time is ready. (One thing I’m playing > with in WebKit2 is to stop using PassOwnPtr and just using std::move instead). I feel like consumeValue(std::move(localTemporary)) is less understandable than consumeValue(localTemporary.release()). But I guess that's just surface syntax. Here's a few things I am interested in about the effects effect of this. I think a lot of the helpfulness of the Pass* types is in the following scenarios: == Scenario A == PassOwnPtr valueProducer() { ... } void valueConsumer(const PassOwnPtr&) { ... } void someOtherFunc() { valueConsumer(valueProducer()); } -- Is this still doable with std::move / rvalues? If so what does it look like? -- Will it be possible to have typechecking fail if you try to give valueConsumer a regular smart pointer instead of a "movable" one? == Scenario B == PassOwnPtr valueProducer() { ... } void valueConsumer(const PassOwnPtr&) { ... } void someOtherFunc() { OwnPtr temporaryLocal = valueProducer(); temporaryLocal->someSideEffect(); valueConsumer(temporaryLocal.release()); } -- Is this still doable with std::move / rvalues? If so what does it look like? -- Will it be possible to have typechecking fail if you try to give valueConsumer a regular smart pointer instead of a "movable" one, i.e. you forget the release/move? ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev