Re:A nice, little known C feature: Static array indices in p...
by zokier on Monday February 18, 2013 @05:01PM
(#5241027)
I don't think that is more readable. With enable_if the precondition is clearly visible at the function header, while the static_assert is inside the body and thus more easily accidentally ignored.
[ Parent
| on HN ]
Re:A nice, little known C feature: Static array indices in p...
by obiterdictum on Monday February 18, 2013 @05:45PM
(#5241283)
On the other hand, static_assert will have a more helpful compile error for users of the code. They will clearly see assertion condition that failed, rather than missing candidate error due to substitution failure (or worse, a different overload silently considered instead).