Guillaume Munch wrote:

> Dear List,
> 
> 
> I have recently started using c++11 features, and, one thing leading to
> another, some cleaning of the tree happened. Apparently most of the
> changes below are supported by old compilers (exceptions below), i.e.
> MSVC 2012 and maybe MSVC 2010 (if lucky) since at least one developer
> seemed to care about it.

IMHO it does not make sense to require C++11 and at the same time allow 
MSVC2010. The subset of C++11 that is supported by MSVC2010 is so small that 
this effectively means that we do not require C++11.

MSVC 2010 somehow became a long term support release of MSVC (although it 
was never officially called like that, it just happened), but the lifetime 
of MSVC 2012 is much shorter. For example, the open source qt 5.6 is not 
offered precompiled for MSVC 2012, only for MSVC 2013 and MSVC 2015. 
Therefore I would vote to support MSVC 2013 and later, but nothing earlier.

> 1-3. Introduce lyx::unique_ptr and lyx::make_unique and remove auto_ptr.
> This is used by two other patches waiting to be committed. After the
> first commit, the option --disable-cxx11 will fail.

Looks good, I have only one minor comment: Please do not use _MSC_VER in the 
sources. This code is better located in config.h, like that:

#if (__cplusplus >= 201402L) || (defined(_MSC_VER)&&(_MSC_VER>=1800))
// C++14, MSVC >= 2013
#define HAVE_STD_MAKE_UNIQUE
#endif

This makes it easier to adapt the code to other compilers, and makes it more 
readable as well.

I know that we do already use internal compiler macros like _MSC_VER in a 
few places, but this is IMHO a mistake.


Concerning the order of committing, I would first change the --disable-cxx11 
switch to --disable-cxx14, so that we do not loose the infrastructure, and 
remove all code that is inside #ifndef LYX_USE_CXX11. Afterwards, we can 
gradually introduce more C++11 features like unique_ptr. I can do the 
configure stuff if you like btw.


I won't comment on the other items. IMHO, discussing all these in one 
message makes things more complicated. I would prefer to go step by step.


Georg


Reply via email to