Movatterモバイル変換


[0]ホーム

URL:


This is the mail archive of thelibc-alpha@sourceware.orgmailing list for theglibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav:[Date Prev] [Date Next][Thread Prev] [Thread Next]
Other format:[Raw text]

Re: [PATCH] assert: Support types without operator== (int) [BZ #21972]


* Paul Eggert:> Florian Weimer wrote:>> + ((void) sizeof (static_cast<bool> (expr)), __extension__ ({ \>> Can we instead replace 'sizeof ((expr) == 0)' with 'sizeof !(expr)'?> That works in C, and if it also works in C++ it would avoid the need> for the #ifdef __cplusplus.It does not work in C++ because operator! could have been overloadedor deleted.  It is likely that a future C++ standard will only requirethat the expression can be contextually converted to bool, and this iswhat the static_cast approach relies upon.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav:[Date Prev] [Date Next][Thread Prev] [Thread Next]

[8]ページ先頭

©2009-2026 Movatter.jp