3

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.

void.pointer
  • 24,859
  • 31
  • 132
  • 243

4 Answers4

5

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.

huseyin tugrul buyukisik
  • 11,469
  • 4
  • 45
  • 97
4

Personally I would have used the term: storage-class-specifier:

7.1.1 Storage class specifiers [dcl.stc]

storage-class-specifier:
             register
             static
             thread_local
             extern
             mutable

But in normal conversations the term "Modifier" is acceptable.

Martin York
  • 257,169
  • 86
  • 333
  • 562
0

static is a modifier that does have an effect on the code. Therefore it is appropriate to communicate it.

The two uses of static I know are for static methods and to make data file local.

Thomas Eding
  • 35,312
  • 13
  • 75
  • 106
0

Yes, it is a modifier - althought it might have slightly different meaning when applied to variables, functions, methods etc. Read here for further information.