Giter VIP home page Giter VIP logo

Comments (10)

EzoeRyou avatar EzoeRyou commented on July 17, 2024

修正

from cpp-book.

inouaTI avatar inouaTI commented on July 17, 2024

上記ソース欄の下のソース欄で、

int x{} ; // int型の変数xの宣言と定義と初期化子
int y({}) ; // int型の変数yの宣言と定義と初期化子

int y({}); がエラーになる成るのですが、なぜでしょうか?(Wandbox:clang)

from cpp-book.

inouaTI avatar inouaTI commented on July 17, 2024

このソース欄の 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.

inouaTI avatar inouaTI commented on July 17, 2024
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.

inouaTI avatar inouaTI commented on July 17, 2024
S() : data( { 1, 2, 3 } ) { }    エラーに成る

メンバー初期化子

【19087行】

struct S
{
    int data[3] ;
    // 以下二行は同じ意味
    S() : data{ 1, 2, 3 } { }
    S() : data( { 1, 2, 3 } ) { }             ←エラーに成る
} ;

from cpp-book.

EzoeRyou avatar EzoeRyou commented on July 17, 2024

残りを見逃していたのでreopen。
明日に確認します。
別の問題は、できれば異なるissueを作ってください。
単に位置が近いからといって同じissueのコメント欄に複数書かれると、見落とします。

from cpp-book.

EzoeRyou avatar EzoeRyou commented on July 17, 2024

すでにcloseしたissueのコメントであらたな問題を書かれても、見落とします。
他にも、closeしたあとにコメントで問題を報告していて、未だに何の反応もない場合、見落としている可能性があります。
遠慮せずに、一つの問題ごとに新しいissueを作ってください。

from cpp-book.

EzoeRyou avatar EzoeRyou commented on July 17, 2024

また、問題がcloseされても正しく修正されていない場合は、新たにissueを追加するか、reopenしてください(そのレポジトリ以外のユーザーがreopenできたかな?)

from cpp-book.

inouaTI avatar inouaTI commented on July 17, 2024

了解しました。

from cpp-book.

EzoeRyou avatar EzoeRyou commented on July 17, 2024

あー、このへんは当時のドラフトと文面が変わったのかな。

from cpp-book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.