在N3421中 - 使运算符函数更大<>,std函数对象的新特化是:
template <> struct plus<void> {
template <class T, class U> auto operator()(T&& t, U&& u) const
-> decltype(std::forward<T>(t) + std::forward<U>(u));
};
Run Code Online (Sandbox Code Playgroud)
代替
template <> struct plus<void> {
template <class T, class U> auto operator()(T&& t, U&& u) const
noexcept(noexcept(decltype(std::forward<T>(t) + std::forward<U>(u))
(std::move(std::forward<T>(t) + std::forward<U>(u)))))
-> decltype(std::forward<T>(t) + std::forward<U>(u));
};
Run Code Online (Sandbox Code Playgroud)
noexcept在这个用例中是否遗漏了问题?编辑:链接到github中的工作草稿行.