Is there any difference between noexcept and empty throw specifiaction for an lambda expression?

ساخت وبلاگ

Vote count: 1

Given an example:

double values[] {2.5, -3.5, 4.5, -5.5, 6.5, -7.5};
std::vector<double> squares(std::end(values) - std::begin(values));
std::transform(std::begin(values), std::end(values), std::begin(values), std::begin(squares), [](double x1, double x2) throw() { retu x1 * x2; });

1) Is this functional equivalent to:

[](double x1, double x2) noexcept { retu x1 * x2; })

?

2) Is there a convincible reason, why should I mark such expression (or similar basic expresions) with either modifiers or in this case, it is better to leave it and simply don't bother?

asked 3 mins ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 254 تاريخ : چهارشنبه 5 خرداد 1395 ساعت: 17:00