C++17 fold expression syntax?

独自空忆成欢 提交于 2019-11-30 19:47:44

You almost got it! Fold expressions have to be surrounded by parentheses:

template <typename V, typename... Vs>
std::enable_if_t<(std::is_floating_point_v<V> && ... &&
                 std::is_floating_point_v<Vs>)>
foo_compact(const V& v, const Vs&...)
{
}

Notice the parentheses after < and before the last >.

Fold expression requires parenthesis, so:

(std::is_floating_point_v<V> && ... && std::is_floating_point_v<Vs>)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!