ousnius / nifly

C++ NIF library for the Gamebryo/NetImmerse File Format
GNU General Public License v3.0
52 stars 23 forks source link

Implemented *,*=,/,/= for Vector3-size_t #25

Closed sts1skj closed 2 years ago

sts1skj commented 2 years ago

Maybe these functions should be templated on the second, numeric variable.

ousnius commented 2 years ago

Templating would make sense so that any numeric type could be used, but it can also cause uncertain behavior when a type is used that results in weird arithmetic or casts when used in the templated function.

So, for now, I prefer not having the operators templated.

ousnius commented 2 years ago

@sts1skj This breaks x86 builds of nifly/Outfit Studio because the same operators are already defined for uint32_t. We need to remove the uint32_t operators or alternatively change the size_t operators into uint64_t ones.

sts1skj commented 2 years ago

Either of those options sounds good to me. I would pick changing size_t to uint64_t, if that works on x86.

ousnius commented 2 years ago

https://github.com/ousnius/nifly/commit/331c36072433cd43151bf6c8ca54799897d29e95