Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you have "const const" after the function name?

I am investigating a block of code (that I did not write) that looks like:

customType foo::bar(void) const const {
    // baz
}

As far as I understand, the const const should really just be const. I can't find any reference to a valid usage of const that has two const keywords after the function name declaration.

Am I missing some valid, esoteric use of const here? This seems invalid to me.

like image 580
BurgeoningApe Avatar asked Sep 16 '25 23:09

BurgeoningApe


1 Answers

It's just a typo. There are no use cases that I know of for double const, so the usage of it twice is likely a programming error.

like image 121
Mippy Avatar answered Sep 19 '25 16:09

Mippy