DexterHaxxor
DexterHaxxor

Reputation: 1005

Is C++17 based on C17?

I have noticed that many of the features new in C++17 were from C17. Is there any relation between the two standards? Are there any practical differences between the C functions and their C++ equivalents?

Upvotes: 1

Views: 1058

Answers (3)

user351971
user351971

Reputation: 1

definitely not C and C++ are different language, they have totally different involving tree. by the way as long as I know it is c11

Upvotes: 0

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385144

Is C++17 based on C17?

No.

The normative reference for C++ as of the current working draft is C11.

If it is C11 now, then it was at latest C11 for C++17. 😃

Here's a related proposal (though I'm not sure that it was exactly this proposal that was adopted).


I have noticed that many of the features new in C++17 were from C17.

I haven't. I haven't compared the two. If similar features were added to both, that's likely a co-incidence. However, since C17 was really just a "bug fix" update to C11, it seems unlikely.

Is there any relation between the two standards?

Not really, no. The two working groups will talk to each other, of course, but the two languages are independent.

Are there any practical differences between the C functions and their C++ equivalents?

Without specific examples I couldn't say, but again you should consider these to be separate and independent things.

C++ is only "based on" C in terms of the library and language features that it "inherits". However, note that this is not a wholesale import of C11 into C++17; that's not how it works.


By the way, although the term "C17" is an accepted (and widespread) name for it, and although its __STDC_VERSION__ macro is 201710L, it's really "C18" (and technically ISO/IEC 9899:2018).

(c.f. C++98's __cplusplus is 199711L; that's just how the timings work out sometimes, when publication stretches just slightly into a subsequent year after things like that have been agreed and frozen.)

Upvotes: 9

Dan M.
Dan M.

Reputation: 4052

As of C++17, C++ standard refers to C11 (this proposal was adopted to ve the part of C++17 in 2016), not C17. But I wouldn't call it "based on".

Also, C++ and C standards are worked on by different working groups that don't really intersect, so the is no direct relation between them (although there is some effort to keep C and C++ features synchronized when it's easy to do so/makes sense).

Upvotes: 5

Related Questions