You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the following pattern appears regularly (example 22.1.4):
static if (someCondition)
static assert(0, "message");
When the code could be written simply as
static assert(someCondition, "message");
If this is a deliberate style decision, you might consider making a note of it somewhere and informing the reader that static assert takes an expression just like its runtime cousin.
The text was updated successfully, but these errors were encountered:
On Mon, Jan 16, 2012 at 21:34, Justin whear
<reply+i-2860049-e5ff9b107ee42541fc177e81477796b037de6899-> I noticed
that the following pattern appears regularly (example 22.1.4):
static if (someCondition)
static assert(0, "message");
When the code could be written simply as
static assert(someCondition, "message");
If this is a deliberate style decision, you might consider making a note of it somewhere and informing the reader that static assert takes an expression just like its runtime cousin.
You're right. Most of the time, it's inside a bunch of nested static
if's, but not always. In the particular example you cited, it would be
clearer your way. I'll make it an issue, so as not to forget.
I do speak about static assert in §3.3.4 (bottom of p.18), but I will
add your comment.
I noticed that the following pattern appears regularly (example 22.1.4):
When the code could be written simply as
If this is a deliberate style decision, you might consider making a note of it somewhere and informing the reader that static assert takes an expression just like its runtime cousin.
The text was updated successfully, but these errors were encountered: