久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

范圍解析運(yùn)算符被使用兩次

Scope resolution operator being used twice(范圍解析運(yùn)算符被使用兩次)
本文介紹了范圍解析運(yùn)算符被使用兩次的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

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.

我假設(shè)第二個(gè)和第三個(gè)承諾"指的是類名和構(gòu)造函數(shù),但我無(wú)法弄清楚第一個(gè)的含義.我確信它不是指命名空間,因?yàn)樵撁Q不同.我已經(jīng)看到在示例中兩次使用了范圍解析運(yùn)算符,但那些是指嵌套的命名空間.

I assume that the second and the third "Commitment" refer to the class name and constructor, but I can't figure out the meaning of the first. I am sure that it does not refer to the namespace because that name is different. I have seen the scope resolution operator being used twice in examples, but those refer to nested namespaces.

推薦答案

在 C++ 中,類具有將其名稱注入其作用域的功能 ([class]/2):

In C++ classes have the feature of having their name injected into their scope ([class]/2):

class-name 也插入到類本身的作用域中;這被稱為 injected-class-name.出于訪問(wèn)目的檢查,injected-class-name 被視為公共會(huì)員名.

The class-name is also inserted into the scope of the class itself; this is known as the injected-class-name. For purposes of access checking, the injected-class-name is treated as if it were a public member name.

您展示的代碼片段使用了它.在某些上下文中,Commitment::Commitment 命名類本身,而在其他上下文中命名為 c'tor.只有最后一個(gè) Commitment(,您打開(kāi)括號(hào)的地方,才開(kāi)始 c'tor 定義.

And the code snippet you showed makes use of it. In certain contexts Commitment::Commitment names the class itself, and in others names the c'tor. Only the last Commitment(, where you open the parentheses, begins the c'tor definition.

它看起來(lái)可能更糟:

struct foo {
    foo();
};

foo::foo::foo::foo() = default;

您可以看到有效的 C++ Live.

Which you can see is valid C++ Live.

這篇關(guān)于范圍解析運(yùn)算符被使用兩次的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Assertion failed (size.widthgt;0 amp;amp; size.heightgt;0)(斷言失敗(size.width0 amp;amp; size.height0))
Rotate an image in C++ without using OpenCV functions(在 C++ 中旋轉(zhuǎn)圖像而不使用 OpenCV 函數(shù))
OpenCV: process every frame(OpenCV:處理每一幀)
Why can#39;t I open avi video in openCV?(為什么我不能在 openCV 中打開(kāi) avi 視頻?)
OpenCV unable to set up SVM Parameters(OpenCV 無(wú)法設(shè)置 SVM 參數(shù))
Convert a single color with cvtColor(使用 cvtColor 轉(zhuǎn)換單一顏色)
主站蜘蛛池模板: 激情视频小说 | 久久手机视频 | 一本色道久久综合亚洲精品小说 | 久久伊人av| 深夜福利av| 免费黄色一级片 | 国产高清成人 | 亚洲性天堂 | 成人深夜福利 | 成人一级片 | 麻豆成人免费视频 | 激情五月婷婷综合 | 日韩精品一级 | 亚洲第一网站 | 中文字幕在线视频播放 | 成人高清视频在线观看 | 九九精品在线观看 | 亚洲精品成人 | 夜夜嗨av一区二区三区 | 久久精品2| 极品在线视频 | 在线观看亚洲精品 | 午夜av在线播放 | 欧美在线观看视频 | 18在线观看免费入口 | 精品国产一二三 | 亚洲天堂网站 | 黄色一级视频网站 | 国产精品成人一区二区网站软件 | 黄色a网站 | 伊人9999| 一区二区三区四区视频 | www超碰| 96在线视频 | av黄色在线 | 亚洲国产日本 | 欧美一级片免费 | 欲色av| 91女人18毛片水多国产 | 婷婷在线播放 | 久久久综合 |