Core/Algorithm: Add SafeCast

This commit is contained in:
Jérôme Leclercq
2021-10-26 20:23:31 +02:00
parent 73838f5f08
commit 66bbf63e87
6 changed files with 114 additions and 30 deletions

View File

@@ -3,12 +3,14 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/RenderElement.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
inline RenderElement::RenderElement(BasicRenderElement elementType) :
RenderElement(static_cast<UInt8>(elementType))
RenderElement(SafeCast<UInt8>(elementType))
{
}
@@ -22,3 +24,5 @@ namespace Nz
return m_elementType;
}
}
#include <Nazara/Core/DebugOff.hpp>