Browse Source

Wait, why the heck do I not use the NoCreate tag from Corrade?

It's been there since 2018. WTF.
pull/481/head
Vladimír Vondruš 6 years ago
parent
commit
4efcc78222
  1. 15
      src/Magnum/Tags.h

15
src/Magnum/Tags.h

@ -51,13 +51,7 @@ Used to distinguish construction without creating the underlying OpenGL /
Vulkan / ... object. Vulkan / ... object.
@see @ref NoCreate @see @ref NoCreate
*/ */
/* Explicit constructor to avoid ambiguous calls when using {} */ typedef Corrade::Containers::NoCreateT NoCreateT;
struct NoCreateT {
#ifndef DOXYGEN_GENERATING_OUTPUT
struct Init{};
constexpr explicit NoCreateT(Init) {}
#endif
};
/** /**
@brief No initialization tag @brief No initialization tag
@ -66,7 +60,6 @@ struct NoCreateT {
Use for construction with no initialization at all. Use for construction with no initialization at all.
*/ */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
/* Explicit constructor to avoid ambiguous calls when using {} */
constexpr NoInitT NoInit{}; constexpr NoInitT NoInit{};
#else #else
using Corrade::Containers::NoInit; using Corrade::Containers::NoInit;
@ -81,7 +74,11 @@ object. Note that calling anything on objects created this way is not defined
delayed object creation with safety checks (however with some extra memory delayed object creation with safety checks (however with some extra memory
overhead), wrap the objects in an @ref Corrade::Containers::Optional. overhead), wrap the objects in an @ref Corrade::Containers::Optional.
*/ */
constexpr NoCreateT NoCreate{NoCreateT::Init{}}; #ifdef DOXYGEN_GENERATING_OUTPUT
constexpr NoCreateT NoCreate{};
#else
using Corrade::Containers::NoCreate;
#endif
} }

Loading…
Cancel
Save