【发布时间】:2017-11-30 13:50:34
【问题描述】:
namespace libzerocoin {
//Commitment class
Commitment::Commitment::Commitment(const IntegerGroupParams* p,
const Bignum& value): params(p), contents(value) {
this->randomness = Bignum::randBignum(params->groupOrder);
this->commitmentValue = (params->g.pow_mod(this->contents, params->modulus).mul_mod(
params->h.pow_mod(this->randomness, params->modulus), params->modulus));
}
我刚刚在GitHub上遇到了这个函数定义。
我假设第二个和第三个“承诺”指的是类名和构造函数,但我无法弄清楚第一个的含义。我确信它没有引用命名空间,因为该名称不同。我已经看到在示例中使用了两次范围解析运算符,但它们指的是嵌套的命名空间。
【问题讨论】:
-
偶类 B { B(); }; B::B::B::B() {} 使用 gcc 和 clang 编译,但 MSVC 存在问题。有趣的。也许注入类型。
标签: c++ class constructor namespaces name-lookup