Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
[[nodiscard]]我需要非 C++17 代码库中属性的语义。我想在 C++17 之前有一些依赖于编译器的方法来实现这一点。有人知道这些吗?我对 clang、gcc 和 MSVC 感兴趣。
[[nodiscard]]
__attribute__((warn_unused_result))
_Check_return_
_MSC_VER >= 1700