Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Optional.h
Go to the documentation of this file.
1#pragma once
2#include <optional>
3#include <stdexcept>
4
5namespace EngineCore {
6 template<typename T>
7 T UnpackOptional(std::optional<T> var) {
8 if (var.has_value()) {
9 return *var;
10 }
11 else {
12 throw std::runtime_error("Failed to unpack optional value");
13 }
14 }
15}
Log category system implementation.
T UnpackOptional(std::optional< T > var)
Definition Optional.h:7