Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is static a modifier in C++?

I've always thought of 'modifiers' in C++ as adjectives for a type (non-technical, easy to remember definition for myself). Strictly for the purposes of communication, would it be appropriate to refer to 'static' as a modifier?

EDIT: Just to be clear, I do understand what static is and does, I just want to know technically how to communicate what type of symbol/keyword/etc it is in a discussion. The standard doesn't seem to pin an exact tag on it, although I only searched through it briefly.

like image 408
void.pointer Avatar asked Mar 07 '26 21:03

void.pointer


1 Answers

There are modifiers , type qualifiers and storage classes :

Storage Classes:

  • auto
  • register
  • static <---------you are here!(if you ask my opinion, it is between qualifier and storage)
  • extern
  • mutable
  • Thread-local<-----(i learned this just now :D Thx Loki Astari)

Type qualifiers:

  • const
  • volatile
  • restrict
  • __align <------- Not sure(it says IBM)

Modifier Types:

  • Signed
  • Unsigned
  • Long
  • Short
  • Class access: public
  • Class access: private
  • Class access: protected

Also 'mutator functions' are intercepted as modifiers but i dont know if it is legal.

Good day.

like image 193
huseyin tugrul buyukisik Avatar answered Mar 10 '26 13:03

huseyin tugrul buyukisik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!