For reference, it's (miss-)called "placement new". Be careful,
though, as people (including the standard) use this expression
with two different meanings: either for any new expression with
this syntax, and the operator new function it calls, or for the
particular instance of this syntax where the argument (here, h)
is a void*, or can be converted into a void*.
Maybe! We do not know what h is, so that is one possibility.
Another one is that the memory is allocated from some special
arena.
Well, we do know what happens at one level. The compiler will
generate code to call "operator new( sizeof( className ), h )",
then call the constructor of className with the arguments arg1
and arg2 on the results. Beyond that:
-- there must be a declaration for the corresponding operator
new function somewhere in scope, either as a member function
of className or one of its bases, or in global scope,
-- if that function is declared with a throw() exception
specifier, the compiler will check for null before calling
the constructor, and
-- if the constructor exits via an exception, and there is a
corresponding placement delete in scope, it will be called
with the return value of the operator new function.
As for the question "is this an accepted syntax?", it's too
vague to answer. It's certainly acceptable to the compiler
(provided the corresponding operator new function has been
declared). For readers? It depends on the context: I would, in
fact, be very surprised not to find something similar in an
implementation of std::vector. In fact, in
std::allocator<>::construct(), in the standard vector, but
probably directly in the vector class in any pre-standard
implementations, which didn't use allocators. It was certainly
present in my pre-standard array classes. (Except that I didn't
bother with the cast to void*. Usually, in such cases, you're
ignoring the return value completely---some people insert a cast
to void (not void*) in such cases, to shut up various lint
tools.)