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

List:       kde-frameworks-devel
Subject:    Re: New test with C++11 and lambda (UDSEntry testcase)
From:       Mark <markg85 () gmail ! com>
Date:       2013-09-22 18:13:50
Message-ID: CAPd6JnF8XpOGG2MK+JO6CNUA0VD-PJZq0SfFStyZsr9GH=-wXQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sun, Sep 22, 2013 at 11:57 AM, Volker Krause <vkrause@kde.org> wrote:

> On Saturday 21 September 2013 19:18:01 Mark wrote:
> > I've just created a quite complicated testcase for frameworks which uses
> > the new signal/slot connection syntax (since Qt 5.0) and uses a lambda as
> > slot. The reason i did this is so that i can keep then entire testcase
> > (minus the initialization) contained in one testcase method. Otherwise i
> > would have to make signal/slot connections to member functions which is
> > probably not something you want for testcases..
> >
> > You can find the patch here: http://paste.kde.org/p9f82c70a/
> >
> > Would this be OK to commit?
> >
> > This testcase would obviously have to be extended a bit to test the
> > different detail states for UDSEntry. This test only tests the case where
> > UDSEntry is filled with details set to 0. The default is details set to 2
> > which this test doesn't test (yet).
> >
> > I guess the question really is:
> > - Can i use C++11 for testcases?
> > - Can i use Lambda? The Lambda spec is supported since GCC 4.5.
> > http://gcc.gnu.org/projects/cxx0x.html
>
> yes:
>
> http://community.kde.org/Frameworks/Policies#Frameworks_compiler_requirements_and_C.2B.2B11
>
> Unconditionally adding -std=c++0x as you did it will probably break MSVC
> though. There it's on by default, so a if(NOT MSVC) should fix that. This
> might be something we want to set globally together with other compiler
> flags,
> ecm's KDECompilerSettings.cmake comes to mind.
>
> Looking in there, I see we still set -ansi in some cases (ICC only,
> probably
> too rare for anyone to notice), we had fun with that in Akonadi since it
> sets
> the standard back to C++98...
>
> regards,
> Volker
>
> Hi Volker,

I knew it was documented somewhere.. I'm glad i can just use the stuff in
the patch.
I'm certainly OK with having C++11 enabled by default!

[Attachment #5 (text/html)]

<div dir="ltr">On Sun, Sep 22, 2013 at 11:57 AM, Volker Krause <span dir="ltr">&lt;<a \
href="mailto:vkrause@kde.org" target="_blank">vkrause@kde.org</a>&gt;</span> \
wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div class="im">On Saturday 21 September 2013 19:18:01 Mark \
wrote:<br> &gt; I&#39;ve just created a quite complicated testcase for frameworks \
which uses<br> &gt; the new signal/slot connection syntax (since Qt 5.0) and uses a \
lambda as<br> &gt; slot. The reason i did this is so that i can keep then entire \
testcase<br> &gt; (minus the initialization) contained in one testcase method. \
Otherwise i<br> &gt; would have to make signal/slot connections to member functions \
which is<br> &gt; probably not something you want for testcases..<br>
&gt;<br>
&gt; You can find the patch here: <a href="http://paste.kde.org/p9f82c70a/" \
target="_blank">http://paste.kde.org/p9f82c70a/</a><br> &gt;<br>
&gt; Would this be OK to commit?<br>
&gt;<br>
&gt; This testcase would obviously have to be extended a bit to test the<br>
&gt; different detail states for UDSEntry. This test only tests the case where<br>
&gt; UDSEntry is filled with details set to 0. The default is details set to 2<br>
&gt; which this test doesn&#39;t test (yet).<br>
&gt;<br>
&gt; I guess the question really is:<br>
&gt; - Can i use C++11 for testcases?<br>
&gt; - Can i use Lambda? The Lambda spec is supported since GCC 4.5.<br>
&gt; <a href="http://gcc.gnu.org/projects/cxx0x.html" \
target="_blank">http://gcc.gnu.org/projects/cxx0x.html</a><br> <br>
</div>yes:<br>
<a href="http://community.kde.org/Frameworks/Policies#Frameworks_compiler_requirements_and_C.2B.2B11" \
target="_blank">http://community.kde.org/Frameworks/Policies#Frameworks_compiler_requirements_and_C.2B.2B11</a><br>
 <br>
Unconditionally adding -std=c++0x as you did it will probably break MSVC<br>
though. There it&#39;s on by default, so a if(NOT MSVC) should fix that. This<br>
might be something we want to set globally together with other compiler flags,<br>
ecm&#39;s KDECompilerSettings.cmake comes to mind.<br>
<br>
Looking in there, I see we still set -ansi in some cases (ICC only, probably<br>
too rare for anyone to notice), we had fun with that in Akonadi since it sets<br>
the standard back to C++98...<br>
<br>
regards,<br>
Volker<br><br></blockquote><div>Hi Volker,</div><div><br></div><div>I knew it was \
documented somewhere.. I&#39;m glad i can just use the stuff in the \
patch.</div><div>I&#39;m certainly OK with having C++11 enabled by default!</div>

</div></div></div>



_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


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

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