Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

emu_window: Mark Scoped constructor and Acquire() as nodiscard

Lioncashf44ad07f2f0a
diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h
index 13aa149346..3e87802430 100644
--- a/src/core/frontend/emu_window.h
+++ b/src/core/frontend/emu_window.h
@@ -39,7 +39,7 @@ public:
class Scoped {
public:
- explicit Scoped(GraphicsContext& context_) : context(context_) {
+ [[nodiscard]] explicit Scoped(GraphicsContext& context_) : context(context_) {
context.MakeCurrent();
}
~Scoped() {
@@ -52,7 +52,7 @@ public:
/// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value
/// ends
- Scoped Acquire() {
+ [[nodiscard]] Scoped Acquire() {
return Scoped{*this};
}
};