Correct safe function

This commit is contained in:
Pcornat 2025-05-30 23:02:10 +02:00
parent aea1ee6822
commit 32b6c523c3
Signed by: Pcornat
GPG key ID: E0326CC678A00BDD
2 changed files with 3 additions and 12 deletions

View file

@ -12,18 +12,9 @@ namespace data {
}
namespace gui {
using modulesType = std::unordered_map<std::string, data::BasicData *>;
class Window;
[[nodiscard]] static std::optional<Window> create_window(
const GLFWerrorfun errorCallback,
GLFWframebuffersizefun framebufferCallback,
const bool debugOpengl,
GLFWwindow *shared,
std::initializer_list<modulesType::value_type> initializer) noexcept;
class Window final {
public:
using modulesType = std::unordered_map<std::string, data::BasicData *>;
using windowPtr = GLFWwindow *;
private:
@ -60,7 +51,7 @@ namespace gui {
Window(Window &&window) noexcept = default;
[[nodiscard]] friend std::optional<Window> create_window(
[[nodiscard]] static std::optional<Window> create_window(
const GLFWerrorfun errorCallback,
GLFWframebuffersizefun framebufferCallback,
const bool debugOpengl,

View file

@ -111,7 +111,7 @@ namespace gui {
glfwMakeContextCurrent(wwindow.get());
}
std::optional<Window> create_window(
std::optional<Window> Window::create_window(
const GLFWerrorfun errorCallback,
const GLFWframebuffersizefun framebufferCallback,
const bool debugOpengl,