From 578e3635dcb62b0cf6a33e880f3612e679f70c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 12 Jun 2015 21:20:14 +0200 Subject: [PATCH] Platform: add constructor for *Application::Arguments structs. Apparently calling std::optional::emplace() doesn't work on a struct that doesn't have any constructor. --- src/Magnum/Platform/AbstractXApplication.h | 3 +++ src/Magnum/Platform/GlutApplication.h | 3 +++ src/Magnum/Platform/Sdl2Application.h | 3 +++ src/Magnum/Platform/WindowlessCglApplication.h | 3 +++ src/Magnum/Platform/WindowlessGlxApplication.h | 3 +++ src/Magnum/Platform/WindowlessWglApplication.h | 3 +++ 6 files changed, 18 insertions(+) diff --git a/src/Magnum/Platform/AbstractXApplication.h b/src/Magnum/Platform/AbstractXApplication.h index 1ee09f439..e327d85b5 100644 --- a/src/Magnum/Platform/AbstractXApplication.h +++ b/src/Magnum/Platform/AbstractXApplication.h @@ -62,6 +62,9 @@ class AbstractXApplication { public: /** @brief Application arguments */ struct Arguments { + /** @brief Constructor */ + /*implicit*/ constexpr Arguments(int& argc, char** argv) noexcept: argc{argc}, argv{argv} {} + int& argc; /**< @brief Argument count */ char** argv; /**< @brief Argument values */ }; diff --git a/src/Magnum/Platform/GlutApplication.h b/src/Magnum/Platform/GlutApplication.h index b1cc66e95..36f813e22 100644 --- a/src/Magnum/Platform/GlutApplication.h +++ b/src/Magnum/Platform/GlutApplication.h @@ -97,6 +97,9 @@ class GlutApplication { public: /** @brief Application arguments */ struct Arguments { + /** @brief Constructor */ + /*implicit*/ constexpr Arguments(int& argc, char** argv) noexcept: argc{argc}, argv{argv} {} + int& argc; /**< @brief Argument count */ char** argv; /**< @brief Argument values */ }; diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index ba19e9f3b..b2118135c 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -178,6 +178,9 @@ class Sdl2Application { public: /** @brief Application arguments */ struct Arguments { + /** @brief Constructor */ + /*implicit*/ constexpr Arguments(int& argc, char** argv) noexcept: argc{argc}, argv{argv} {} + int& argc; /**< @brief Argument count */ char** argv; /**< @brief Argument values */ }; diff --git a/src/Magnum/Platform/WindowlessCglApplication.h b/src/Magnum/Platform/WindowlessCglApplication.h index b994297b8..be937fe92 100644 --- a/src/Magnum/Platform/WindowlessCglApplication.h +++ b/src/Magnum/Platform/WindowlessCglApplication.h @@ -96,6 +96,9 @@ class WindowlessCglApplication { public: /** @brief Application arguments */ struct Arguments { + /** @brief Constructor */ + /*implicit*/ constexpr Arguments(int& argc, char** argv) noexcept: argc{argc}, argv{argv} {} + int& argc; /**< @brief Argument count */ char** argv; /**< @brief Argument values */ }; diff --git a/src/Magnum/Platform/WindowlessGlxApplication.h b/src/Magnum/Platform/WindowlessGlxApplication.h index 753c5ab5f..671ab474d 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.h +++ b/src/Magnum/Platform/WindowlessGlxApplication.h @@ -101,6 +101,9 @@ class WindowlessGlxApplication { public: /** @brief Application arguments */ struct Arguments { + /** @brief Constructor */ + /*implicit*/ constexpr Arguments(int& argc, char** argv) noexcept: argc{argc}, argv{argv} {} + int& argc; /**< @brief Argument count */ char** argv; /**< @brief Argument values */ }; diff --git a/src/Magnum/Platform/WindowlessWglApplication.h b/src/Magnum/Platform/WindowlessWglApplication.h index c846927d4..d7d0f8704 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.h +++ b/src/Magnum/Platform/WindowlessWglApplication.h @@ -95,6 +95,9 @@ class WindowlessWglApplication { public: /** @brief Application arguments */ struct Arguments { + /** @brief Constructor */ + /*implicit*/ constexpr Arguments(int& argc, char** argv, HWND window) noexcept: argc{argc}, argv{argv}, window{window} {} + int& argc; /**< @brief Argument count */ char** argv; /**< @brief Argument values */ #ifndef DOXYGEN_GENERATING_OUTPUT