IRC logs of #shogun for Friday, 2019-05-31

--- Log opened Fri May 31 00:00:38 2019
-!- wiking [~wiking@huwico/staff/wiking] has quit [Remote host closed the connection]04:44
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun04:50
-!- mode/#shogun [+o wiking] by ChanServ04:50
-!- wiking [~wiking@huwico/staff/wiking] has quit [Ping timeout: 248 seconds]04:55
-!- TheMoatman [~Moatman@pool-108-45-140-154.washdc.fios.verizon.net] has joined #shogun05:14
-!- Moatman [~Moatman@pool-108-45-140-154.washdc.fios.verizon.net] has quit [Read error: Connection reset by peer]05:14
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun05:31
-!- mode/#shogun [+o wiking] by ChanServ05:31
-!- wiking [~wiking@huwico/staff/wiking] has quit [Ping timeout: 258 seconds]05:36
-!- lambday [a7dcee98@gateway/web/freenode/ip.167.220.238.152] has joined #shogun06:01
-!- mode/#shogun [+o lambday] by ChanServ06:01
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun06:34
-!- mode/#shogun [+o wiking] by ChanServ06:34
-!- wiking [~wiking@huwico/staff/wiking] has quit [Remote host closed the connection]07:30
-!- TheMoatman [~Moatman@pool-108-45-140-154.washdc.fios.verizon.net] has quit [Quit: Leaving]08:51
-!- gf712 [9052726e@gateway/web/freenode/ip.144.82.114.110] has joined #shogun09:03
-!- geektoni [973e0080@gateway/web/freenode/ip.151.62.0.128] has joined #shogun09:43
-!- gf712 [9052726e@gateway/web/freenode/ip.144.82.114.110] has quit [Ping timeout: 256 seconds]11:10
-!- geektoni [973e0080@gateway/web/freenode/ip.151.62.0.128] has quit [Ping timeout: 256 seconds]11:13
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has joined #shogun11:44
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has quit [Ping timeout: 256 seconds]13:10
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has joined #shogun13:57
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has quit [Quit: Page closed]14:09
-!- HeikoS [~heiko@103.pool85-48-188.static.orange.es] has joined #shogun15:13
-!- mode/#shogun [+o HeikoS] by ChanServ15:13
-!- gf712 [c13cdcfd@gateway/web/freenode/ip.193.60.220.253] has joined #shogun15:27
gf712HeikoS: ping15:27
@HeikoSgf712: pong15:27
@HeikoShi15:27
@HeikoSI actually have a q for you :)15:27
gf712sure :)15:27
@HeikoSif a function returns std::pair<LabelMap&&, LabelMap&&>15:27
@HeikoSand then inside i construct a LabelMap on stack, populate it and return it using make_pair15:28
@HeikoSand then I call the function elsewhere and assign the result to member variables15:28
@HeikoSwill the LabelMap be copied?15:28
gf712hmm good question, I don't think so15:29
@HeikoSgf712: basically, see https://github.com/shogun-toolbox/shogun/pull/4650/files15:29
gf712but I am not sure what  std::pair<LabelMap&&, LabelMap&&> would be used for?15:29
gf712why an r value ref?15:29
@HeikoSI would like to avoid that the LabelMaps created in create_mapping are copied15:29
@HeikoSbut directly assigned to member15:29
@HeikoShttps://github.com/shogun-toolbox/shogun/pull/4650/files#diff-013a46d146cf036527c80c257a36fe93R10515:29
@HeikoShere15:29
@HeikoSI'd like to directly assign to the member here: https://github.com/shogun-toolbox/shogun/pull/4650/files#diff-013a46d146cf036527c80c257a36fe93R10715:30
@HeikoSmaybe just pass a reference to the maps to the function instead?15:30
gf712right, but you aren't copying the underlying data in pair right?15:30
gf712the pair has the pointer?15:30
gf712which then is copied15:30
gf712you can also do a move15:30
@HeikoSLabelMap is just std::map15:31
gf712but that would be std::pair<>&&15:31
@HeikoSbut I want to create two of them15:31
@HeikoSand all I really want is to avoid them being copied15:31
@HeikoSthe two LabelMap instances that is15:31
gf712you should try it on compiler explorer15:31
gf712I am not sure right now]15:31
gf712HeikoS: https://github.com/mattgodbolt/compiler-explorer15:32
@HeikoSin general, how would I do this for a single return element15:32
@HeikoSlike I have a function that returns std::map somehow15:32
@HeikoSand I want to assign that to a class member15:32
gf712well a single element you would just return T&&15:32
gf712which would invoke move constructor15:33
gf712if there is one15:33
@HeikoSthat's what I thought when I made the return type15:33
@HeikoSstd::pair<T&&, T&&>15:33
@HeikoSoh chaning the return type makes the unit tests crash ...15:37
gf712HeikoS: I just tried it in compiler explorer15:39
gf712std::pair<T&&, T&&>15:39
gf712calls move constructors :)15:39
gf712no copies made!15:39
@HeikoSstack overflow15:40
@HeikoSmaybe I call it wrongly15:40
@HeikoSlet me try again15:40
gf712HeikoS: did you hear back from ati yet btw?15:40
@HeikoSgf712:  no, that's why I came online actually15:41
@HeikoSbut nothing yet15:41
@HeikoSI can ask James15:41
gf712that's annoying!15:41
@HeikoSbut I thought they are probably just delaye15:41
@HeikoSshall I ask?15:41
gf712up to you :)15:41
gf712meant to have my exit interview today15:41
@HeikoSlol15:42
@HeikoSwell15:42
gf712but there's been complications... apparently when you say attend a meeting they expect you to confirm by email...15:42
@HeikoSwith whom would that be?15:42
gf712some hr person15:42
@HeikoSi see15:42
gf712anyway15:42
gf712I just wanted to give the laptop back15:42
gf712going away for the weekend in a few hours so don't have much time15:42
@HeikoShaha15:43
@HeikoSjust keep it I guess15:43
@HeikoS(until this is figured out)15:43
gf712HeikoS: https://pastebin.com/Hx2D1ARE15:43
@HeikoSjust changed it to this15:43
gf712what I tested15:43
@HeikoShttps://github.com/shogun-toolbox/shogun/pull/4650/files#diff-013a46d146cf036527c80c257a36fe93R10815:43
@HeikoSnow it rashes15:43
@HeikoSmaybe I call it wrong?15:43
gf712mhhh im not sure15:44
@HeikoSdoes an asisgnment invoke move ctor? for T&& type?15:44
@HeikoShttps://github.com/shogun-toolbox/shogun/pull/4650/files#diff-013a46d146cf036527c80c257a36fe93R10815:45
@HeikoSthis one ^15:45
gf712the assignment will invoke copy though15:45
gf712the result->m_to_internal = mapping.first;15:45
@HeikoSinternal = LabelMap(mapping.first) ?15:46
gf712HeikoS: so the T&& is not needed15:46
gf712move semantics is used automatically15:46
@HeikoScan you explain?15:46
gf712and to get the value use std::move(mapping.first)15:46
@HeikoSah15:46
gf712not sure how, but just tested on compiler explorer15:47
gf712and the15:47
@HeikoSso just leave the return type as std::pair<T,T>15:47
gf712it works!15:47
gf712yup15:47
@HeikoSand then just do the std::move after the call15:47
@HeikoSok15:47
@HeikoSlemme try15:47
gf712yes15:47
gf712you just can't use pair.first again right? pretty sure the move is destructive15:48
gf712anyway, got to go!15:48
@HeikoSyes15:48
@HeikoSgot that15:48
@HeikoSok15:49
gf712have a nice weekend!15:49
@HeikoShave a nice weekend15:49
@HeikoSand: pleasure working with you the last months! :)15:49
gf712let me know if you find about the ati!15:49
@HeikoSlet's hope it continues15:49
gf712no worries!15:49
gf712me too15:49
gf712looking forward to Berlin :)15:49
@HeikoSme too15:49
@HeikoSsee you there!15:49
-!- gf712 [c13cdcfd@gateway/web/freenode/ip.193.60.220.253] has quit [Quit: Page closed]15:49
-!- HeikoS [~heiko@103.pool85-48-188.static.orange.es] has quit [Ping timeout: 245 seconds]16:14
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has joined #shogun16:45
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has quit [Client Quit]16:45
-!- HeikoS [~heiko@45.pool85-48-188.static.orange.es] has joined #shogun17:02
-!- mode/#shogun [+o HeikoS] by ChanServ17:02
-!- HeikoS [~heiko@45.pool85-48-188.static.orange.es] has quit [Ping timeout: 245 seconds]18:46
--- Log closed Sat Jun 01 00:00:39 2019

Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!