Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: Static_assert in 2017 C++ Date: Sun, 01 Sep 2019 20:48:28 -0700 Organization: None to speak of Lines: 32 Message-ID: References: <31f1dc85-3b69-4787-8fa8-e4ee5836c609@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="65345b20804e72873e72ff0fa6347185"; logging-data="17084"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SYFqR29ZRABw4QLewqM7X" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:9jn5JWtvjEInskWRnLPEtQpsCqQ= sha1:EIYJ8pB4ZIFPHRoF4oJiB9G0PIo= Xref: csiph.com comp.lang.c++:68091 woodbrian77@gmail.com writes: > I have this line > static_assert(::std::numeric_limits::is_iec559,"Only IEEE754 supported"); > > in my library: https://github.com/Ebenezer-group/onwards > > . I wrote that line when I was using 2011 C++ and the comment > was required. Now I require 2017 C++ and am trying to decide between: > > a. remove the comment > b. reduce the comment to just "IEEE754", or > c. leave it as it is. The issue is that in C++11 and earlier, static_assert requires a second argument (which is *not* a "comment"), and in C++17 and later it does not. Given what you have, I can't think of any good reason not to leave it as it is. If you do drop the message argument, your code will no longer compile with a pre-2017 C++. implementation (unless it supports a single-argument static_assert as an extension). If it won't anyway for other reasons, that probably doesn't matter. What advantage do you see from removing or changing the message argument? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */