Skip to main content
3 of 4
grammar
Boann
  • 50.3k
  • 16
  • 125
  • 153

Is the old meaning of the inline keyword deprecated in C++?

On the cppreference page for the inline specifier, it says,

The inline specifier, when used in a function's decl-specifier-seq, declares the function to be an inline function.

An inline function has the following properties:
There may be more than one definition of an inline function in the program as long as each definition appears in a different translation unit and all definitions are identical.
...

Then, a bit down, it says,

The original intent of the inline keyword was to serve as an indicator to the optimizer that inline substitution of a function is preferred over function call. ...

Apart from this line, there is no reference to this use of inline. Is the latter meaning of inline still valid in the C++ standards? Or is the latter form deprecated over the former?

If the latter form is still valid, is it worth using it in modern compilers? I have heard that, even though it is the compiler that makes the decision about inlining, using the inline keyword pushes it a bit. Is this true? Should I use the inline keyword in my program for this case?