vendredi 24 janvier 2020

inline specifier in a friend function declaration

I'm having a question about N4842.

For 9.2.7 The inline specifier, there is

"If the inline specifier is used in a friend function declaration, that declaration shall be a definition or the function shall have previously been declared inline."

in fifth paragraph.

But no error has occurred by the following code.

struct X{
     friend inline void f();
};

void f(){} // no error

Why is not there error? Please teach me.

Aucun commentaire:

Enregistrer un commentaire