From 7a5eda59146306dedaf3e6f07f97a8c6898543dd Mon Sep 17 00:00:00 2001 From: Frederic L Date: Tue, 30 Oct 2018 05:03:25 +0100 Subject: global: Use std::optional instead of boost::optional (#1578) * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build --- src/core/hle/service/nvflinger/buffer_queue.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service/nvflinger/buffer_queue.cpp') diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp index fd98d541d..630ebbfc7 100644 --- a/src/core/hle/service/nvflinger/buffer_queue.cpp +++ b/src/core/hle/service/nvflinger/buffer_queue.cpp @@ -31,7 +31,7 @@ void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer) buffer_wait_event->Signal(); } -boost::optional BufferQueue::DequeueBuffer(u32 width, u32 height) { +std::optional BufferQueue::DequeueBuffer(u32 width, u32 height) { auto itr = std::find_if(queue.begin(), queue.end(), [&](const Buffer& buffer) { // Only consider free buffers. Buffers become free once again after they've been Acquired // and Released by the compositor, see the NVFlinger::Compose method. @@ -44,7 +44,7 @@ boost::optional BufferQueue::DequeueBuffer(u32 width, u32 height) { }); if (itr == queue.end()) { - return boost::none; + return {}; } itr->status = Buffer::Status::Dequeued; @@ -70,12 +70,12 @@ void BufferQueue::QueueBuffer(u32 slot, BufferTransformFlags transform, itr->crop_rect = crop_rect; } -boost::optional BufferQueue::AcquireBuffer() { +std::optional> BufferQueue::AcquireBuffer() { auto itr = std::find_if(queue.begin(), queue.end(), [](const Buffer& buffer) { return buffer.status == Buffer::Status::Queued; }); if (itr == queue.end()) - return boost::none; + return {}; itr->status = Buffer::Status::Acquired; return *itr; } -- cgit v1.2.3