Date: Thu, 29 Jun 2023 22:23:47 +0100
On Thu, Jun 29, 2023 at 8:41 PM Andrew Tomazos <andrewtomazos_at_[hidden]> wrote:
>
> What's an example of a realistic bug that [[nodiscard_scope]] would catch but [[nodiscard]] wouldn't?
synchronized_value<MyClass> g_obj;
void Func(void)
{
auto &myref = *g_obj.synchronize(); // This mistake would be
caught by [[nodiscard_scope]]
myref.SomeMethod();
}
>
> What's an example of a realistic bug that [[nodiscard_scope]] would catch but [[nodiscard]] wouldn't?
synchronized_value<MyClass> g_obj;
void Func(void)
{
auto &myref = *g_obj.synchronize(); // This mistake would be
caught by [[nodiscard_scope]]
myref.SomeMethod();
}
Received on 2023-06-29 21:24:00