Since which version of C++ are default arguments allowed?

I started using C++ in 1991, and default arguments were present then in Borland C++ v3.0 and also in Stanley Lippman's book C++ Primer 2nd ed (also 1991). I imagine that qualifies as 'legal' - or it did at the time!


Per Bjarne's "History of C++" (see page 6), default arguments were added in the very first version of the very first incarnation of C++, C With Classes, whose "spec" (if you can call it that) was published back in 1980.

They remained present through to initial standardisation in 1998, and remain present to this day.

In other words, every version of C++ since the dawn of time has supported default arguments.

In other words: literally forever. :)


This is legal in all standardized versions of C++, starting with C++98.

Tags:

C++

C++11