此问题的代码片段来自 EOS 的 WIKI 文档的 Persistance API 部分。该页面的链接在这里...
https://github.com/EOSIO/eos/wiki/Persistence-API
在下面的代码片段中,看起来类模板(或模板类)被 typedef 为 service_table_type。然后一大堆自定义类型在类模板的尖括号中传递,除了复杂性之外似乎没有什么新东西(如果我理解正确的话)。
using service_table_type = multi_index<service, service_rec,
indexed_by< N(bycustomer), const_mem_fun<service_rec, account_name,
&service_rec::get_customer>>>;
我的问题是关于上面代码片段之后的下面一行代码。这里发生了什么?它看起来像是对函数 service_table() 的调用,该函数返回一个 service_table_type 类型的参数。这个函数是从哪里来的?如果这个函数来自一个库,它如何返回我们任意创建的 service_table_type 类型的值?
service_table_type service_table( current_receiver(), mechanic );
你能为我提供一个精简的通用代码示例吗?
非常感谢你!