12 template <
typename Then,
typename Else>
15 return std::forward<Then>(then);
19 template <
typename Then,
typename Else>
20 auto static_if(std::false_type, Then&&, Else&& else_)
22 return std::forward<Else>(else_);
26 template <
bool cond,
typename Then,
typename Else>
30 std::forward<Then>(then),
31 std::forward<Else>(else_));
35 template <
bool cond,
typename Then>
38 return static_if<cond>(std::forward<Then>(then),
39 #
if (defined __clang__ && __clang_major__ == 3 && __clang_minor__ < 6 \
40 || defined __GNUC__ && !defined __clang__ && __GNUC__ < 5)
auto static_if(std::true_type, Then &&then, Else &&)
Execute the then-clause.
std::integral_constant< bool, B > bool_constant