Fix compilation and some warnings
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user