#A 2D vector in my lib :P - Just the header file

1 messages · Page 1 of 1 (latest)

glossy chasm
#

why do you need that many overloads

#

since you define your vector as a pair of floats, just the float overloads are enough imo

#

that, and also appropriate Vector2D ones

shrewd oyster
#

Yeah there are way too many overloads

#

float gets automatically promoted to double for one

#

Though I can see doing something different for integer multiplication and division at least

rose ibex
#

I just wanted to be sure 'cause sometimes it would just not work without a overload :P.

glossy chasm
#

Oh ok

vestal jolt
#

And std::is_arithmetic_t from the STL

#

And then, if you want to specialise, you can just use template specialisations instead

rose ibex
#

I've done that with a template and it sure worked well! And now there's some more stuff that I need to look out for but.. for now.. Thanks y'all for helping me with this.. if you want to see the source-files and some propably semi-good implementation I'll make sure to post it on github.

#

whoever would need the link i would dm or if that isn't aginst server rules I'll leave the link here

#

And for those people who don't trust some random links on discord I'll include some screen-shots.

rose ibex
vestal jolt
#

Cppreference also includes code examples

vestal jolt
rose ibex
#

One problem now.. The GitHub repo does not want to show up in the browser or my account even tho I've made it public.. I'll try doing something to make it work

rose ibex
#

I've fixed it now

#

Yeah.. on this repo is more stuff than just the Vector2 but I didn't want to split it into multiple files.