[cmake-developers] Can we please require TR1 to build CMake?

Daniel Pfeifer daniel at pfeifer-mail.de
Mon Jan 9 05:46:18 EST 2017


Hi and happy 2017,

I am currently doing some refactoring (more on that later) and I would like
to start using TR1/C++11 library features, namely std::function, std::bind,
std::placeholders, std::shared_ptr, std::make_shared.

Some background information:

The Dinkumware standard library introduced TR1 in version 5.05. Visual
Studio 2008 (without Service Pack) ships with version 5.03. Visual Studio
2008 SP1 has version 5.05. Visual Studio 2010 has version 5.20. This
version puts the symbols into namespace std. The version number is stored
in _CPPLIB_VER.

The GNU libstdc++ introduced TR1 in version 4.0. The TR1 headers have been
put into a subdirectory. Starting with version 4.3, the headers can be
included as in C++11 and the symbols are in namespace std, but only if the
language mode is set to C++0x or higher. The library version number is
stored in __GLIBCXX__.

The LLVM libc++ was designed for C++11 from the beginning.

I could not find information about TR1 availability in other standard
library implementations. So I made a test run on the nightly dashboard
builds. The results are here:
https://open.cdash.org/index.php?project=CMake&date=2016-12-29
I was very surprised by the small number of failed builds.

Five expected nightly builds failed on dash2win64.kitware. Apparently
Visual Studio 2008 SP1 is not installed. The Intel compiler uses the
standard library of Visual Studio.

AIX-7.1_IBM-12.1 reports that __IBMCPP_TR1__ must be defined to use TR1.
That should be easy to fix.

Xcode 2.1 and 3.2 fail. These builds are not marked as "expected".

This leaves HP-UX.11iv2.ia64-aCC and Solaris-10-8.11_Oracle-12.3.

Here is my concrete proposal:

* Explicitly require SP1 for Visual Studio 2008.
* Drop support for Xcode 2.1 and 3.2 or mark builds as expected.
* Disallow compiling in C++98 mode if compiler is capable of C++11.
* Require TR1 by all means. This may require setting up Boost.TR1 on a very
small number of exotic platforms.

Cheers, Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20170109/02ee3ac1/attachment.html>


More information about the cmake-developers mailing list