Fix compilation and some warnings

This commit is contained in:
Jérôme Leclercq
2017-10-02 16:18:15 +02:00
parent 40a678889d
commit 99d21b8722
7 changed files with 32 additions and 11 deletions

View File

@@ -2,7 +2,10 @@
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/SparsePtr.hpp>
#include <cassert>
#include <iterator>
#include <limits>
#include <Nazara/Core/Debug.hpp>
namespace Nz
@@ -48,6 +51,22 @@ namespace Nz
Reset(ptr, stride);
}
/*!
* \brief Constructs a SparsePtr object with a pointer and a step
*
* \param ptr Pointer to data
* \param stride Step between two elements
*
* \remark This constructor only exists because std::size_t is a frequent type for constructing this object, but stride may not be higher than int max
*/
template<typename T>
SparsePtr<T>::SparsePtr(VoidPtr ptr, std::size_t stride)
{
assert(stride <= std::numeric_limits<int>::max());
Reset(ptr, static_cast<int>(stride));
}
/*!
* \brief Constructs a SparsePtr object from another type of SparsePtr
*