Question

  1. Must a conforming C++ Standard Library Implementation be implemented in C++?
  2. If not, is it allowed to do magic things that are not doable in pure C++ & Standard Library & some implementation defined behaviour?

  • I am aware that there are parallel implementations that rely on extensions (in pre C++11 at least), but are they really conforming?
  • I couldn't find any requirement in the standard, but maybe my standard-fu is weak today
Was it helpful?

Solution

No.

Actually, it is even prescribed by the Standard that #include <map> (for example) could simply import a pre-stored AST and not refer to a file, at all.

OTHER TIPS

There is no requirement at all how the standard C++ library (or the standard C library for that matter) is implemented. All the library needs to achieve is to implement the documented and specified interface. How this is done is entirely up to the implementation. Part of standard libraries are often implemented by the compiler in some magic way and in C++2011 there are several interfaces which actually cannot be implemented using standard C++2011 language facilities! Primarily this is true for some of the traits in <type_traits> but there are other things.

Just for the reference: how C++ is implemented and what it actually really means to conform to the standard is held extremely vague. The relevant clause is 1.4 [intro.compliance]. It merely speaks about diagnostics being issued and what a program has to do, constraint to resource limitations, however.

Not at all, only the interface needs to be C++.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top