Skip to content

Commit

Permalink
- fixed compilation with MSVC 14.28.29333 from VS2019 16.8.0
Browse files Browse the repository at this point in the history
include\algorithm(7419,17): error C3892: '_First': you cannot assign to a variable that is const (compiling source file src\rendering\hwrenderer\scene\hw_drawlist.cpp)
  • Loading branch information
alexey-lysiuk committed Nov 12, 2020
1 parent 6e3a4c5 commit 013078a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/common/utility/tarray.h
Expand Up @@ -98,8 +98,7 @@ template<typename T> class TIterator : public std::iterator<std::random_access_i
T& operator[](difference_type i) { return m_ptr[i]; }
const T& operator[](difference_type i) const { return m_ptr[i]; }

T &operator*() { return *m_ptr; }
const T &operator*() const { return *m_ptr; }
T &operator*() const { return *m_ptr; }
T* operator->() { return m_ptr; }

protected:
Expand Down

4 comments on commit 013078a

@drfrag666
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That error message is useless, what's the problem in hw_drawlist.cpp then?

@coelckers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no problem in hw_drawlist.cpp. The error was caused by operator*() having incorrect const declarations which the sort function could not use.

@drfrag666
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, i meant i wanted to know if the legacy branches were affected.

@coelckers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they use the same tarray.h, yes. That bug is relatively old.

Please sign in to comment.