Time |
Nick |
Message |
00:05 |
|
Eragon joined #minetest-dev |
03:09 |
|
Noisytoot joined #minetest-dev |
03:17 |
|
Noisytoot joined #minetest-dev |
03:40 |
|
Noisytoot joined #minetest-dev |
05:00 |
|
MTDiscord joined #minetest-dev |
12:16 |
|
hwpplayer1 joined #minetest-dev |
14:08 |
|
hwpplayer1 joined #minetest-dev |
16:06 |
MTDiscord |
<luatic> what should our code style guidelines say about generic parameters which we expect to always be trivially copyable |
16:06 |
MTDiscord |
<luatic> should we use const refs or not? |
16:07 |
MTDiscord |
<luatic> i'm leaning towards not because it's more readable, e.g. static CMatrix4<T> scale(T x, T y, T z) |
16:14 |
MTDiscord |
<herowl> Tbh I don't think const ref makes much sense for int |
16:15 |
MTDiscord |
<herowl> Because passing a ref is not more performant than passing a pointer, which in turn is essentially an integer. |
16:16 |
MTDiscord |
<herowl> Same goes for floats |
16:17 |
MTDiscord |
<herowl> So, if it makes code less readable and is not an optimization (in fact, it's likely to be optimized out by the compiler), I'd leave it out. |
16:19 |
MTDiscord |
<luatic> it doesn't make sense for types that are less than a pointer and i expect it to leave it out. |
16:20 |
MTDiscord |
<luatic> what makes the style question less obvious for generics is that i technically don't know what T will be in the future. but i expect it to always be trivially and efficiently copyable. hence why i'm going with T. |
16:25 |
MTDiscord |
<josiah_wi> Yeah that makes sense. Universal references are for a different problem, right? |
16:27 |
MTDiscord |
<luatic> universal references make sense if, in theory, you expect something heavier in the future. say maybe bignums. but i don't think that's realistic. |
16:33 |
sfan5 |
const T& is the safe option when doing templates |
18:12 |
|
Warr1024 joined #minetest-dev |
18:22 |
|
swift110-mobile joined #minetest-dev |
18:22 |
|
luk3yx joined #minetest-dev |
18:22 |
|
Evergreen joined #minetest-dev |
20:20 |
|
hwpplayer1 joined #minetest-dev |
23:05 |
|
Warr1024 joined #minetest-dev |
23:33 |
|
panwolfram joined #minetest-dev |