【发布时间】:2020-06-16 15:30:03
【问题描述】:
使用here解释的模式如下:
auto action =
std::unique_ptr< posix_spawn_file_actions_t, decltype(&posix_spawn_file_actions_destroy) >
{ new posix_spawn_file_actions_t(), posix_spawn_file_actions_destroy };
在 gcc 中触发 [-Wignored-attributes] v10.1.0 -std=c++20:
warning: ignoring attributes on template argument ‘int (*)(posix_spawn_file_actions_t*) noexcept’
| std::unique_ptr<posix_spawn_file_actions_t, decltype(&posix_spawn_file_actions_destroy)>
| ^
这是为什么呢?应该忽略还是有办法调整代码?
【问题讨论】:
标签: c++ posix unique-ptr gcc-warning