No.
Well, sort of yes, in the sense that there exist people who consider new
in new int
to be an operator. However, this opinion is (mostly) at odds with the standard.
Firstly, [lex.operators/1]
lists the operators in the language. Don't be fooled into thinking that these are just "preprocessing operators", either; no such distinction exists in the sense of lexical operators. It wouldn't make sense, either, since you cannot (for example) ++
a macro.
new
is, in fact, a keyword (per [lex.key/1]
).
Next, let's look at new-expression itself. This is where things get a little more wooly. There is, for example, the following wording in [expr.new/4]
:
Instead, the explicitly parenthesized version of the new operator can be used to create objects of compound types
I consider this to be an editorial error, since it is at odds with the definitions provided above, and does not occur anywhere else in that section.
Then we come to operator overloading. In its grammatical production for an operator declaration, the terminal listing things (including new
) is named operator ([over.oper.general/1]
). I don't think we need to worry about this. The names of terminals in the grammar have never been intended to introduce definitions of terms. After all, you have and-expression that _doesn't need to be a bitwise AND operation; it can just be an equality-expression:
and-expression:
equality-expression
and-expression &
equality-expression
It's common to define grammars like this, and it certainly doesn't mean that every equality-expression is somehow to be considered an invocation of the bitwise AND operator.
Finally, some have claimed that the following wording (also in the operator overloading section) is proof that new
is somehow now, in isolation, magically an operator:
The operators new[]
, delete[]
, ()
, and []
are formed from more than one token
To them I say, not only is new
not even listed, but this is clearly using the term "operator" in the more broad sense of "things that can be overloaded", even though new
in itself is still not an operator. It's also in a non-normative note, which should tell you all you need to know.
And, as you point out yourself, we already consider operator new
to be something else.
new
is likesizeof
here. And I think the majority of the C++ community thinks ofsizeof
as an operator. The stansard even refers to the "sizeof
operator" when describing its effects.sizeof
, I'd say that would be the operator of an expressionsizeof(<type>)
. And+
is an operator for a unary expression<type> <op> <type>
. That's my takeaway/interpretation at least, feel free to correct me on it.new
is an operator or not, there's a difference between an expression and and an operator. E.g.,new int
is an expression as it evaluates to something. Ifnew
is considered an operator, then only the "new" part ofnew int
is the operator (i.e., it's its own separate thing). Conceptually, an operator is something that acts on something else.