[Qgis-developer] C++11 in QGIS

Hugo Mercier hugo.mercier at oslandia.com
Thu May 7 05:14:37 PDT 2015


Hi Jürgen,

On 07/05/2015 10:37, Jürgen E. Fischer wrote:
> Hi Hugo,
> 
> On Thu, 07. May 2015 at 10:17:55 +0200, Hugo Mercier wrote:
>> Lots of methods in QGIS are now decorated with the C++11 "override"
>> keyword. Which is good.
>> But it is only enabled for gcc and Clang compilers (not under MSVC for
>> instance).
>  
>> So ... what features of C++11 is allowed in QGIS source code ? Support
>> in GCC/CLang is excellent and the version of Visual Studio used for the
>> windows compilation (2010) has already support for some nice features.
>  
>> I'm thinking about auto, unique_ptr and move semantics especially ...
> 
> I'd say all that don't break platforms we currently build for (ie.
> http://dash.orfeo-toolbox.org/index.php?project=QGIS).
> 

Thanks for the clarification. But rules in the CMakeLists are a bit
different: it enables C++11 only for g++ >= 4.7 and for Clang (>= 4.1 on
mac and >= 3.2 elsewhere).

Does it mean we should always keep compatibility with non-c++11
compilers ? In this case, that means only features that have an
equivalent in C++03 are allowed ... which limits a lot the interest.

If we are ok to introduce c++11 features, it means we must state that a
c++11 compiler is needed (and not only optional). At least features
supported by the most limited one (MSVC 2010 in our case).



More information about the Qgis-developer mailing list