Fix undefined behavior sanitizer casting error

This commit is contained in:
SOUHARDYA TOLA 2025-11-18 14:07:23 +00:00
parent e7205b985d
commit 2096d66b3d
1 changed files with 4 additions and 4 deletions

View File

@ -290,7 +290,7 @@ public:
template <typename T> template <typename T>
I_Filtered_iterator (T* p) : I_Filtered_iterator (T* p) :
nt (pointer(p)), nt (reinterpret_cast<pointer>(p)),
iend (nt) iend (nt)
{} {}
@ -314,7 +314,7 @@ public:
template <typename P> template <typename P>
I_Filtered_iterator& operator= (const P* p) I_Filtered_iterator& operator= (const P* p)
{ {
nt = pointer(p); nt = reinterpret_cast<pointer>(p);
iend =nt; iend =nt;
return *this; return *this;
} }
@ -455,7 +455,7 @@ public:
template <typename T> template <typename T>
I_Filtered_const_iterator (T* p) : I_Filtered_const_iterator (T* p) :
nt (pointer(p)), nt (reinterpret_cast<pointer>(p)),
iend (nt) iend (nt)
{} {}
@ -488,7 +488,7 @@ public:
template <typename P> template <typename P>
I_Filtered_const_iterator& operator= (const P* p) I_Filtered_const_iterator& operator= (const P* p)
{ {
nt = pointer(p); nt = reinterpret_cast<pointer>(p);
iend =nt; iend =nt;
return *this; return *this;
} }