Comments (10)
修正
from cpp-book.
上記ソース欄の下のソース欄で、
int x{} ; // int型の変数xの宣言と定義と初期化子 int y({}) ; // int型の変数yの宣言と定義と初期化子
int y({}); がエラーになる成るのですが、なぜでしょうか?(Wandbox:clang)
from cpp-book.
このソース欄の S({ 1, 2, 3 }) ; はエラーにならない。
コンストラクター呼び出しの実引数
【19048行】
#include struct S { S( std::initializer_list ) { } } ; int main() { S s1( { 1, 2, 3 } ) ; S s2{ 1, 2, 3 } ; S({ 1, 2, 3 }) ; // 関数形式のキャスト ←正常 S{ 1, 2, 3 } ; // 関数形式のキャスト }
from cpp-book.
int m2[3]( { 1, 2, 3 } ) ; エラーに成る。
非staticデータメンバーの初期化子
【19072行】
struct S { int m1[3] = { 1, 2, 3 } ; int m2[3]( { 1, 2, 3 } ) ; ←エラーに成る int m3[3]{ 1, 2, 3 } ; } ;
from cpp-book.
S() : data( { 1, 2, 3 } ) { } エラーに成る
メンバー初期化子
【19087行】
struct S { int data[3] ; // 以下二行は同じ意味 S() : data{ 1, 2, 3 } { } S() : data( { 1, 2, 3 } ) { } ←エラーに成る } ;
from cpp-book.
残りを見逃していたのでreopen。
明日に確認します。
別の問題は、できれば異なるissueを作ってください。
単に位置が近いからといって同じissueのコメント欄に複数書かれると、見落とします。
from cpp-book.
すでにcloseしたissueのコメントであらたな問題を書かれても、見落とします。
他にも、closeしたあとにコメントで問題を報告していて、未だに何の反応もない場合、見落としている可能性があります。
遠慮せずに、一つの問題ごとに新しいissueを作ってください。
from cpp-book.
また、問題がcloseされても正しく修正されていない場合は、新たにissueを追加するか、reopenしてください(そのレポジトリ以外のユーザーがreopenできたかな?)
from cpp-book.
了解しました。
from cpp-book.
あー、このへんは当時のドラフトと文面が変わったのかな。
from cpp-book.
Related Issues (20)
- 誤植の報告2 HOT 6
- cpp-bookについての要望 HOT 7
- 誤植の報告(8.5.3) HOT 2
- static が不要か HOT 1
- 変数名の重複: m2 と m3
- const 変数を初期化する。 = 0; HOT 1
- 誤植の報告
- 誤変換2ヶ所
- virtual指定子について HOT 1
- エラーにならない ? HOT 3
- { } の記入漏れ4ヶ所 HOT 2
- 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.