IRC logs of Freenode #BZFlag for Monday, 2019-12-30

BZNotifybzflag: macsforme commented on pull request #238 "SDL2: Only create the window once" by blast007 (https://git.io/JeAvu): On macOS, these work:...04:43
Flashthe question was asked, and deserves broader explanation. Isn't construction by initialization faster by construction by assignment05:41
FlashFoo foo(bar); vs Foo foo = bar;05:42
Flashhistorically, the second case (assignment) actually default constructed 'foo' then did assignment of 'bar' to 'foo'05:42
Flashhowever, in modern C++, we have move semantics, which makes the difference negligible in most cases05:43
FlashWhat are move semantics, you may ask? It's when the right hand side of the assignment is basically swapped with the left hand side, consuming it.05:44
FlashAll the standard types (strings, vectors, maps, etc.) have move constructors so that the cost of the "copy" is swapping a few pointers05:45
FlashObviously, for more detail, google "c++ move semantics" and you will almost certainly find a good explanation with examples.05:46
Flashwhat it means in practical terms is that we can confidently write code like "auto foo = bar"; (yes, I replaced the explicit type with 'auto'; a 2-for-1 example) instead of diligently constructing by initialization05:48
macsformeFlash: initializing a variable to a value has no additional cost over leaving it uninitialized?06:58
macsformeobviously it's not an optimization issue in this case (for a function called rarely), just trying to understand why you consider uninitialized variables "complex," if the needed values cannot be directly assigned during initialization07:12
Flashcyclomatic complexity considers many factors, including the state of named variables07:15
macsformeespecially since I could see myself writing something similar07:15
Flashif a variable is uninitialized, then you have to determine at every case whether it has a value before being used07:16
Flashin this particular case, it's trivial, but as a best practice, variables should be declared at first use, and given initial values07:16
DTRemenakuniform initialization is the best initialization.  Spell it Foo foo{ bar }.07:23
macsformejust not when using auto :-)07:24
Flashhttps://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/07:25
DTRemenakworks with auto too, but I like having the type stated explicitly exactly once.  makes intentions clear.07:25
Flashand DTRemenak ... brace initialization doesn't work (necessarily) if Foo has constructors that take arguments07:26
DTRemenaksingle-argument constructors should generally be explicit07:26
Flashagreed07:26
DTRemenakambiguity between list initializers and multi-argument constructors is rare, but that is a case where you might want to use a different style of initialization07:27
BZNotifybzflag: atupone synchronized pull request #237 "subs gluProject with glm::project" (https://git.io/JeN0g)08:59
BZNotifymaster @ bzflag: atupone pushed 1 commit (https://git.io/JeAkU):09:04
BZNotifymaster @ bzflag: atupone d1aace: subs gluProject with glm::project (https://git.io/JeAkT)09:04
BZNotifybzflag: atupone commented on pull request #237 "subs gluProject with glm::project" (https://git.io/JeAkq): Merged09:04
BZNotifybzflag: atupone closed pull request #237 09:04
BZNotifybzflag: atupone commented on pull request #236 "C++14" by jwmelto (https://git.io/JeAGg): As for the new commit about gluProject moved to glm:project, I hope...16:00
*** sam <sam!foobar@poulet.zoy.org> has quit IRC (Ping timeout: 250 seconds)19:07
*** sam <sam!foobar@poulet.zoy.org> has joined #bzflag19:13
*** sam is now known as Guest1000919:14
*** Guest10009 <Guest10009!foobar@poulet.zoy.org> has quit IRC (Ping timeout: 258 seconds)19:20
*** sam_ <sam_!foobar@poulet.zoy.org> has joined #bzflag19:20
allejois master failing for anyone else? this is the error I'm getting, MeshTransform.cxx:389:7: error: no match for ‘operator=’ (operand types are ‘glm::vec3 {aka glm::tvec3<float, (glm::precision)0u>}’ and ‘glm::tmat4x4<float, (glm::precision)0u>::col_type {aka glm::tvec4<float, (glm::precision)0u>}’)23:00
blast007allejo: I'll try here.23:02
spldarttrying linux now23:24
spldartmake flollowed through. trying play now23:25
spldart./ plays fine too.23:27
blast007allejo: it worked here.  What version of glm do you have?23:35
blast007("here" being Debian Buster, with glm 0.9.9.3)23:35
spldartcrap.. I dunno how to tell what  pull ytou have from git. It's either commit 64920cc822952a28779557371e5e78fffd24c4e023:35
spldartor e928ab7695bdc1258be48f48b1243bb15662b05e But check ok23:35
allejolibglm-dev 0.9.7.2-123:36
allejo`git show HEAD`23:36
spldartLook at all that code!23:38
*** Guest66163 is now known as Foo_man_choo23:40
spldartHoly crap! gitk is awesome!!23:48
spldartCan't figure out how to check... 0.9.9.6 :/23:55
blast007are you using the glm from Debian?23:58
blast007if so: apt show libglm-dev23:58
allejoi'm on ubuntu 16.0423:59
blast00716.04 has glm 0.9.7.223:59

Generated by irclog2html.py 2.17.3.dev0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!