2016-06-20から1日間の記事一覧
Explicit operator boolを用いた値の比較において、operator==を用いたif文は、オーバーロードなどを定義しない限り、コンパイルが通らない。 class A{ bool data; public: A(bool arg):data(arg){} explicit operator bool()const noexcept{return data;} }…
Explicit operator boolを用いた値の比較において、operator==を用いたif文は、オーバーロードなどを定義しない限り、コンパイルが通らない。 class A{ bool data; public: A(bool arg):data(arg){} explicit operator bool()const noexcept{return data;} }…