<div dir="ltr"><div><div><div><div>Hi,<span class="im"><br><br>> Q1. Is it really necessary to use the std library directly in KDots?</span></div>It was just a historical reason. I tried to write a core part independently from Qt and KDE at the beginning. And<br>in addition some contrainers and structures in Qt4 didn't support C++11 properly.<span class="im"><br><br>> Q2. Why does not KDots use Qt classes for points, hashes, containers, etc? Using Qt is the usual way to make<br>> KDE Games portable.<br></span></div>If all things that I use in the code is in the standard too, then theoretically it also should be portable :)<span class="im"><br><br>>Q3. Is there any C++11 source code in KDots?<br></span></div>Yes, auto, lambdas, initialization_list, std::shared_ptr, std::unique_ptr etc. - they are in the new standard.<span class="im"><br><br>> Q4. Is KDE Community code beginning to use C++11 and versions of std lib that<br>
> have C++11 as a dependency? What is the KDE Policy on this?<br></span></div><div>As I understand Qt5 has already supported C++11, why don't we use these features then? :)<br></div><div><div><div><br></div></div></div><div class="gmail_extra">Kind Regards,<br clear="all"></div>Minh</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Minh<br></div></div></div>
<br><div class="gmail_quote">On 10 April 2015 at 09:47, Ian Wadham <span dir="ltr"><<a href="mailto:iandw.au@gmail.com" target="_blank">iandw.au@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Minh,<br>
<span class=""><br>
On 09/04/2015, at 9:11 PM, Minh Ngo wrote:<br>
> Possibly it's because of the different stdlib (clang in Linux requires gcc, but on Mac maybe it uses other stdlib<br>
> implementation), but I'm not sure about Mac. Is it possible to treat these errors as warnings?<br>
><br>
> In the point.hpp the thing I did is just implemented a class Point that consists from two coordinates and a hash function to store it in std::unordered_*. Therefore please be free to change and don't fear about breaking logic :).<br>
<br>
</span>I suspect now that I am not getting a C++11 version of std lib in my build,<br>
as is required for templated hash and std::unordered_set. At least, when<br>
I do make -k, to go past the errors regarding std::hash, at some point I get:<br>
<br>
In file included from /kdedev/kde4m/kdesrc/kde/kdegames/kdots/polygonfinder.cpp:26:<br>
/kdedev/kde4m/kdesrc/kde/kdegames/kdots/polygonfinder.hpp:29:10: fatal error:<br>
'unordered_set' file not found<br>
#include <unordered_set><br>
<br>
Something like this came up on the MacPorts Developers' list about 3 weeks<br>
ago. It appears that there is no uniform way to configure a C++11 compiler<br>
and corresponding std lib across the various Apple OS X platforms supported<br>
by MacPorts (e.g. 4.6 through to 4.10, spanning about 7 years of OS X releases).<br>
The discussion was mostly way over my head, re Apple and MacPorts technology,<br>
so I hope I did not misunderstand the main issue.<br>
<br>
Before I dive in at the deep end on the Mac lists and perhaps give rise to another long<br>
thread, may I ask some questions about KDots' coding and KDE Policy re C++11?.<br>
<br>
Q1. Is it really necessary to use the std library directly in KDots?<br>
<br>
Q2. Why does not KDots use Qt classes for points, hashes, containers, etc?<br>
Using Qt is the usual way to make KDE Games portable.<br>
<br>
Q3. Is there any C++11 source code in KDots?<br>
<br>
And for KF5 developers in general:<br>
<br>
Q4. Is KDE Community code beginning to use C++11 and versions of std lib that<br>
have C++11 as a dependency? What is the KDE Policy on this?<br>
<br>
Cheers, Ian W.<br>
<span class="im HOEnZb"><br>
> On 9 April 2015 at 12:25, Ian Wadham <<a href="mailto:iandw.au@gmail.com">iandw.au@gmail.com</a>> wrote:<br>
</span><div class="HOEnZb"><div class="h5">> Possibly the Clang compiler is picking up the wrong stdlib from somewhere or<br>
> maybe Clang does not like the mix of namespace and template features in this<br>
> particular code. Can it be paraphrased and simplified in some way?<br>
><br>
> It is similar to the final coding example in <a href="http://en.cppreference.com/w/cpp/utility/hash" target="_blank">http://en.cppreference.com/w/cpp/utility/hash</a>,<br>
> so it ought to compile OK, but it is not exactly the same. I might try modifying point.hpp<br>
> to be textually and syntactically more like the example, without changing semantics.<br>
><br>
> Another possibility is for me to try MacPorts' (Open Source) Clang, rather than Apple's,<br>
> but I use Apple's Clang successfully for all other code. Or I might be able to revert to<br>
> MacPorts' gcc.<br>
<br>
</div></div></blockquote></div><br></div>