calref / cboe

Classic Blades of Exile
http://spiderwebforums.ipbhost.com/index.php?/forum/12-blades-of-exile/
Other
173 stars 42 forks source link

xq's fix to enum_map.hpp #203

Closed clort81 closed 4 years ago

clort81 commented 4 years ago
diff cboe/src/tools/enum_map.hpp cboe-dark/src/tools/enum_map.hpp
16a17,23
> 
> // clort added by xq 
>     using typename std::array<T, n>::reference;
>     using typename std::array<T, n>::const_reference;
>     using typename std::array<T, n>::size_type;
>     using std::array<T, n>::begin;
> 
25,27c32,40
<   reference at(E pos) {return array::at(static_cast<int>(pos));};
<   const_reference at(E pos) const {return array::operator[](static_cast<int>(pos));};
<   reference operator[](E pos) {return array::operator[](static_cast<int>(pos));};
---
> 
>         // clort added by xq
>   //reference at(E pos) {return array::at(static_cast<int>(pos));};
>   //const_reference at(E pos) const {return array::operator[](static_cast<int>(pos));};
>   //reference operator[](E pos) {return array::operator[](static_cast<int>(pos));};
>         reference at(E pos) {return std::array<T, n>::at(static_cast<int>(pos));};
>         const_reference at(E pos) const {return std::array<T, n>::operator[](static_cast<int>(pos));};
>         reference operator[](E pos) {return std::array<T, n>::operator[](static_cast<int>(pos));};
> 

this fixes building for me on linux. cheers.

CelticMinstrel commented 4 years ago

Just noting: I'd also add using std::array<T, n>::end for symmetry... also, probably add a type alias for std::array<T, n> to simplify all of these.

madwizard commented 4 years ago

Fixes build on Fedora 31.

CelticMinstrel commented 4 years ago

Fixed by e42baa0971f3a231b5eb76c98b556fc4a0635dc2 fa25beae6d66456d7507ffec34252f58a3ad092f fb28a4da2e817c61abcb19c81d28e6b73511a92a