r/cpp • • Dec 13 '19

The situation of std::embed...

https://thephd.github.io/full-circle-embed
238 Upvotes

160 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Dec 15 '19

RFCs are not a spec such as C++'s, nor look nor read like one.

Exactly, so what are they for?

They do get merged into a single, consistent code base. Which is, in fact, what matters in the end and way more precise than any spec can be (at least a spec written in legalese like C++'s rather than math-formal).

So how do I know if a behaviour is intended or it is a bug? Why do we document systems at all by this reasoning? How can you be sure the behaviour is actually consistent?

The same for C++: I don't care what the spec says if nobody implements it or if one of my compilers disagree (or is buggy, or the spec is not precise, or...). And that has happened many times in the past. So many that I cannot even count anymore.

If they claim to support the standard but disagree, this is a compiler bug that should and usually will be fixed. I don't understand this kind of defeatist attitude: this is like saying that some compilers are behaving differently, so let's all use a single compiler.

If you are judging whether your program is correct by checking it against the C++ spec, then I have very bad news for you (and your users)... :)

What is the news? Certain assumptions about the behaviour of my program depend on the guarantees provided by the execution environment, so I open up the specification and check if that's the case. If it's not the case for some compilers, I open a bug and it gets fixed.