In jdk8
源码的allocation.hpp
gibt es
#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
};
Ich verstehe die grammatikalischen Regeln nicht in ##
在 define
.
#define
是定义变量,2个##是连接运算符,可以查看##
是连接运算符,参见 https://stackoverflow.com/que...