mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-12-15 23:35:38 +00:00
emu_window: Mark Scoped constructor and Acquire() as nodiscard
Ensures that callers make use of the constructor, preventing bugs from silently occurring.
This commit is contained in:
parent
f808258ed9
commit
a93f6e51d3
|
@ -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};
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue