Comments (2)
それは意図的なものです。
定義というのは、実行時のことで、コンパイル時にはとくに関係がありません。
On 11/21/13, inouaTI [email protected] wrote:
{ } の記入漏れ4ヶ所。
12.6.1 明示的な初期化(Explicit initialization)
【24990 行】
struct X { - X( int ) ; + X( int ) { } - X( int, int ) ; + X( int, int ) { } - X( int, int, int ) ; + X( int, int, int ) { } } ; int main() { X x1( 1 ) ; // X::X(int) X x2( 1, 2 ) ; // X::X(int,int) X x3( 1, 2, 3 ) ; // X::X(int,int,int) }詳しくは、初期化子の直接初期化を参照。
また、=(イコール)記号に続いて値を指定することで、初期化することもできる。
struct X { - X( int ) ; + X( int ) { } } ; int main() { X x = 0 ; // X::X(int) }
Reply to this email directly or view it on GitHub:
#152
Ryou Ezoe
Blog: http://cpplover.blogspot.com/
Twitter: https://twitter.com/EzoeRyou
GitHub: https://github.com/EzoeRyou
from cpp-book.
「クラスのオブジェクトの初期化子には括弧に囲まれた式リストを使うことができる。この場合、適切な仮引数リストのコンストラクターによって初期化される。 」
の解説文で、
「この場合、適切な仮引数リストのコンストラクターによって初期化される。 」
という所の解説ですね。
済みませんよく読みませんでした。
from cpp-book.
Related Issues (20)
- 誤植の報告2 HOT 6
- cpp-bookについての要望 HOT 7
- 誤植の報告(8.5.3) HOT 2
- コメント追加 8.5.3 (このissuesは間違っているかもしれない) HOT 10
- static が不要か HOT 1
- 変数名の重複: m2 と m3
- const 変数を初期化する。 = 0; HOT 1
- 誤植の報告
- 誤変換2ヶ所
- virtual指定子について HOT 1
- エラーにならない ? HOT 3
- lvalueとrvalue: 書きかけと思われる箇所
- 実装依存の文字を使った識別子 HOT 4
- 数詞の使い方 HOT 1
- 文末の句点 HOT 1
- コードの例示を示すコロンの有無 HOT 1
- sizeofでの()について HOT 1
- 誤植の報告:
- 関数の宣言方法の記載ミス HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp-book.