3

Are there any open-source 100% C++11 compatible(*) implementations of standard C++ library?

(*) An implementation which is proven to match the standard completely or an implementation which has no known defects.

Luigi
  • 4,129
  • 6
  • 37
  • 57
Kolyunya
  • 5,973
  • 7
  • 46
  • 81
  • boost library ? Many things of C++11 came from boost like std::chrono – jordsti Mar 06 '14 at 19:56
  • 4
    Boost is not the implementation of `std` as far as I know... – Kolyunya Mar 06 '14 at 19:57
  • 1
    If you had a open-source 100% C++11 compatible implementation sitting in front of you, you could not know that you had it, because determining if something is 100% C++11 compatible is intractable. – Yakk - Adam Nevraumont Mar 06 '14 at 20:11
  • 2
    Does _with no proven defects_ mean _with no known bugs_? If so, then the answer is an unqualified "no." – James McNellis Mar 06 '14 at 20:12
  • @Yakk I've defined `100% C++11 compatible` in the topic as `having no proven defects` – Kolyunya Mar 06 '14 at 20:12
  • 2
    Oh, then no. There is no software of any reasonable size that has no proven defects in it, unless you go off and redefine "defect" to be nearly meaningless, or nearly nobody is looking. There is no formal specification of any reasonable size that has no proven defects in it either: almost certainly C++11 standard implies requirements that it clearly did not intend to require. Perfection in a sufficiently complex system is unattained by humankind: there may be a handful of exceptions, but I left enough weasel words to make this statement true regardless I suspect. :) – Yakk - Adam Nevraumont Mar 06 '14 at 20:14
  • I do not believe there is any non-trivial software that contains no known bugs. I'm not aware of one operating system, compiler, or library with that property. Even the TeX typesetting system (which I don't believe has "known" bugs) has been putting out bug fixes since version 3 in 1989, with the latest release being two months ago. – Elliott Frisch Mar 06 '14 at 20:18
  • The Standard itself has hundreds of Issues which are areas where implementers ask for clarification or changes to the wording. Some compilers decide to resolve them one way even before an official resolution has been given: should that count as a proven bug? – TemplateRex Mar 06 '14 at 20:21
  • @ElliotFrisch I stand corrected! ;) I forgot about Knuth's TeX. – Yakk - Adam Nevraumont Mar 06 '14 at 21:38

3 Answers3

3

There is no certification process, and C++11 is a moving target as defect reports continue to be processed, so I'm not sure your question is entirely meaningful. Or if it is, the answer is and always will be "No".

But (amongst others) the libstdc++ crew are doing a pretty good job of tracking the best known approximation of what the standard library should be.

Alan Stokes
  • 18,815
  • 3
  • 45
  • 64
  • Even after adding regex a few months ago, libstdc++ is missing far too much of the C++11 to be called "the best" (codecvt, movable streams, put_time, even something as trivial as std::align): http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.200x – Cubbi Mar 08 '14 at 14:29
2

You can look at libc++ of llvm, http://libcxx.llvm.org/, you can access the SVN repos from their Website and one of their main feature is "Correctness as defined by the C++11 standard"

jordsti
  • 746
  • 8
  • 12
  • Thank you for you answer. Could you please tell me why does clang has the `gcc` implementation of `std` in the official Debian repos? – Kolyunya Mar 06 '14 at 20:04
  • I couldn't tell you, maybe the gcc implementation is more stable and that why debian choose this one at the moment. – jordsti Mar 06 '14 at 20:06
  • Well, that you again. – Kolyunya Mar 06 '14 at 20:06
  • Clang doesn't "have" libstdc++, but it uses it by default on linux. This is probably because all other packaged binaries are built with libstdc++ and libc++ is not ABI compatible. Ubuntu Saucy contains a libc++ (saucy/universe), Debian is generally more conservative than Ubuntu. – BenPope Mar 07 '14 at 06:23
2

The libc++ standard library team that is part of the LLVM project claim that they have a full C++1y compliant implementation.

Here you can see the status of the library .

There is one big cons with libc++ and it's the fact that libc++ it's not even nearly as popular as libstdc++v3 for now, for example no GNU/Linux distribution is adopting this standard library yet. It's not a secret the fact that the main focus of this library is on MAC OS X/FreeBSD, at least for now.

user2485710
  • 9,451
  • 13
  • 58
  • 102
  • But I can download "100%" C++11 compatible `libc++` and link "100%" C++11 compatible clang against it on my Linux-box, right? – Kolyunya Mar 06 '14 at 20:24
  • @Kolyunya you can build from sources or you can also use the official apt repository http://llvm.org/apt/ – user2485710 Mar 06 '14 at 20:25
  • Do you want to build clang against libc++ or use clang to build C++ apps against libc++? Both can be done. – BenPope Mar 07 '14 at 06:27