문제

  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
도움이 되었습니까?

해결책

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.

다른 팁

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++.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top