Term for end of the function signature

I'm wondering what this thingy that gets attached onto the end of the function signature is called.

1
2
3
4
5
6
struct S {
    void do_thing() const
    {            // ^^^^^ this

    }
}


1
2
3
4
5
6
struct V {
    void do_other_thing() __restrict
    {                 //  ^^^^^^^^^^ or this

    }
};


No other language I know of has this thing.

I'm not asking what it does. I know about const correctness. Just what the h*ck is it called, syntax-wise? A function suffix?
Last edited on
In addition to the CV qualifiers there are specifiers:
https://en.cppreference.com/w/cpp/language/final
1
2
3
override
final
= 0;

and the special members could have:
1
2
= default;
= delete;
There's also ref-qualifiers, optionally an exception specification, and attribute-specifiers.
void f() const volatile & noexcept(noexcept(blah)) [[whatever]]

On rare occasions, the Hyperlinked C++ Grammar comes in handy:
https://www.nongnu.org/hcb/#ref-qualifier
But cppreference also summarizes the grammar, usually with an explanation of the productions involved:
https://en.cppreference.com/w/cpp/language/function

To maybe save you some effort reading, there is no semantic distinction that I know of between "specifier" and "qualifier". Not speaking definitively here, I just tried to find out what the difference was a while ago and couldn't.

FWIW, If you said "function suffix" I would know exactly what you meant.
Last edited on
Interesting, never heard the terms before. Thanks all.
Topic archived. No new replies allowed.