c++ - What are the syntax rules for ## in define?
大家讲道理
大家讲道理 2017-06-05 11:11:07
0
2
800

In allocation.hpp of the jdk8 source code, there is

#define METASPACE_OBJ_TYPE_DECLARE(name) name ## Type,
#define METASPACE_OBJ_TYPE_NAME_CASE(name) case name ## Type: return #name;

  enum Type {
    // Types are MetaspaceObj::ClassType, MetaspaceObj::SymbolType, etc
    METASPACE_OBJ_TYPES_DO(METASPACE_OBJ_TYPE_DECLARE)
    _number_of_types
  };

I don’t understand what grammatical rules ## are in define.

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
某草草

#define is to define variables, the two ## are connection operators, you can view

漂亮男人

## is the concatenation operator, see https://stackoverflow.com/que...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template