瀏覽代碼

Fix Vector ConstIterator constructor.

The  constructor was expecting a mutable pointer, while the passed pointer was immutable ( returns a const pointer), so the compilation was failing when iterating a constant .
AndreaCatania 4 年之前
父節點
當前提交
de0991d801
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/templates/vector.h

+ 1 - 1
core/templates/vector.h

@@ -229,7 +229,7 @@ public:
 		_FORCE_INLINE_ bool operator==(const ConstIterator &b) const { return elem_ptr == b.elem_ptr; }
 		_FORCE_INLINE_ bool operator!=(const ConstIterator &b) const { return elem_ptr != b.elem_ptr; }
 
-		ConstIterator(T *p_ptr) { elem_ptr = p_ptr; }
+		ConstIterator(const T *p_ptr) { elem_ptr = p_ptr; }
 		ConstIterator() {}
 		ConstIterator(const ConstIterator &p_it) { elem_ptr = p_it.elem_ptr; }