【发布时间】:2015-08-10 07:22:00
【问题描述】:
来自my understanding,typedef语法为:
typedef existing_type new_type_name;
但是,在Chrome's v8 namespace 中,有许多 typedef 似乎可以使用其他语法。例如,
typedef void(* FunctionCallback )(const FunctionCallbackInfo< Value > &info)
有两点我不明白:
1- FunctionCallbackInfo
2- 没有空格分隔 existing_type 和 new_type_name
阅读本文的正确方法是什么?
编辑:我在 this tutorial 中获取所有 typedef 信息。
【问题讨论】:
-
顺便说一句,许多人更喜欢别名声明而不是 typedef。对于那些语法更简单,
using new_name = existing_type_id;.