--- Log opened Wed May 08 00:00:06 2019 | ||
-!- lambday [a7dcee98@gateway/web/freenode/ip.167.220.238.152] has quit [Ping timeout: 256 seconds] | 00:15 | |
-!- essam [c5351068@gateway/web/freenode/ip.197.53.16.104] has quit [Quit: Page closed] | 02:54 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun | 07:34 | |
-!- durovo [~durovo@8e.68.2ea9.ip4.static.sl-reverse.com] has quit [Remote host closed the connection] | 07:56 | |
-!- durovo [~durovo@8e.68.2ea9.ip4.static.sl-reverse.com] has joined #shogun | 07:57 | |
-!- durovo [~durovo@8e.68.2ea9.ip4.static.sl-reverse.com] has quit [Remote host closed the connection] | 08:07 | |
-!- durovo [~durovo@8e.68.2ea9.ip4.static.sl-reverse.com] has joined #shogun | 08:07 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection] | 08:25 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun | 08:27 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection] | 08:36 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun | 08:44 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Ping timeout: 248 seconds] | 08:48 | |
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has joined #shogun | 09:09 | |
-!- wiking [~wiking@2001:67c:10ec:5784:8000::3ff] has joined #shogun | 09:15 | |
-!- arishuynhvan [67fcc830@gateway/web/freenode/ip.103.252.200.48] has joined #shogun | 10:00 | |
-!- lambday [a7dcee98@gateway/web/freenode/ip.167.220.238.152] has joined #shogun | 10:01 | |
-!- mode/#shogun [+o lambday] by ChanServ | 10:01 | |
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has quit [Ping timeout: 256 seconds] | 10:05 | |
-!- gf712 [9052084a@gateway/web/freenode/ip.144.82.8.74] has joined #shogun | 10:14 | |
gf712 | wiking: weren't you look for a type trait the other day that does this https://en.cppreference.com/w/cpp/types/remove_cvref ? | 10:22 |
---|---|---|
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has joined #shogun | 10:27 | |
-!- arishuynhvan [67fcc830@gateway/web/freenode/ip.103.252.200.48] has quit [Ping timeout: 256 seconds] | 10:31 | |
gf712 | wiking: ping | 13:11 |
-!- HeikoS [~heiko@73.red-83-46-178.dynamicip.rima-tde.net] has joined #shogun | 14:07 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 14:07 | |
-!- aris_ [67fcc830@gateway/web/freenode/ip.103.252.200.48] has joined #shogun | 14:28 | |
-!- aris_ [67fcc830@gateway/web/freenode/ip.103.252.200.48] has quit [Ping timeout: 256 seconds] | 14:40 | |
geektoni | ping HeikoS | 14:48 |
@HeikoS | geektoni: pong | 14:48 |
geektoni | HeikoS: hi, just wanted to talk a bit about a couple of things | 14:50 |
geektoni | HeikoS: first one is this https://github.com/shogun-toolbox/shogun/pull/4618/files/1e0deeb8b7b749187781458d95fbfd18ccdc3c69#diff-1c4dac8c0dc45d3a55ac37450f8c7b99R44 | 14:50 |
geektoni | get_option works perfectly fine with strings parameters, however renaming it to something like get_string/get_option_string is not nice right? | 14:51 |
@HeikoS | no | 14:53 |
@HeikoS | get_string needs to be added | 14:53 |
@HeikoS | geektoni: get_option does more than just returning a string | 14:55 |
@HeikoS | it checks whether the parameter has options | 14:55 |
geektoni | Heikos: yes yes, get_option is more "advanced" | 14:55 |
-!- wiking [~wiking@2001:67c:10ec:5784:8000::3ff] has quit [Remote host closed the connection] | 14:56 | |
@HeikoS | geektoni: so to answer your question in the PR: yes, makes sense to add a new method in the swig interface | 14:57 |
@HeikoS | and this is translated to get<string> in c++ | 14:57 |
geektoni | okay, so, first of all, it is not possible to declare %template twice (with a different name) for the same specialization | 14:58 |
geektoni | I wonder if it exists a way in swig to like add a "duplicate" method with a different name | 14:58 |
@HeikoS | gf712: ^ any thoughts on this? | 14:59 |
@HeikoS | geektoni: good question! | 14:59 |
@HeikoS | I think yes | 14:59 |
@HeikoS | monkeypatching | 14:59 |
@HeikoS | gf712 did this for some swig stuff | 15:00 |
@HeikoS | for the .get method | 15:00 |
geektoni | but | 15:00 |
geektoni | in the end | 15:00 |
geektoni | get_string == get_option | 15:00 |
geektoni | since they should both translate to get<std::string> | 15:01 |
@HeikoS | yes | 15:02 |
@HeikoS | so can just add | 15:02 |
@HeikoS | def get_string(bla): | 15:02 |
@HeikoS | return get_option(bla) | 15:02 |
geektoni | I see I see | 15:03 |
geektoni | and what about the other languages? | 15:03 |
@HeikoS | but I am sure if you google swig duplicate template | 15:03 |
@HeikoS | the SWIG api should have a clear distinction between get_option and get_string | 15:03 |
@HeikoS | c++ is just get<string> | 15:03 |
geektoni | sure sure | 15:04 |
geektoni | okay, I'll see what I can do | 15:04 |
geektoni | HeikoS: second question, https://github.com/shogun-toolbox/shogun/pull/4626#discussion_r281011880 | 15:05 |
gf712 | geektoni: what happens if you use rename instead of template in swig? | 15:06 |
gf712 | i.e. %template(get_string) CSGObject::get<std::string, void>; | 15:06 |
@HeikoS | good idea! :) | 15:06 |
gf712 | I doublt it would work though | 15:06 |
geektoni | gf712: mmh not sure | 15:07 |
gf712 | because then it will get confused as to which one to use | 15:07 |
@HeikoS | geektoni: re second question, I think since the std:: structures on primitives are fine due to the copy ctor this is ok | 15:07 |
@HeikoS | but if we observe sgobjects, there will be problems or? | 15:07 |
@HeikoS | geektoni gf712 another option might be to define a get<string, void, void> (3xvoid) in the swig c++ code | 15:08 |
@HeikoS | and then use that for the template | 15:08 |
geektoni | the problems will be caused by the copy ctor of those sgobjects | 15:08 |
@HeikoS | that should work actually | 15:08 |
gf712 | yea, I think that is the only way to use it | 15:08 |
gf712 | but it starts being a bit confusing :D | 15:08 |
geektoni | e.g. SGVector copy ctor copies only the pointer to the data and not the data itself | 15:08 |
@HeikoS | geektoni: sure, this is why clone needs to be called | 15:08 |
@HeikoS | like in any | 15:08 |
@HeikoS | it first checks | 15:08 |
@HeikoS | ->clone | 15:09 |
@HeikoS | .clone | 15:09 |
@HeikoS | then copy ctor | 15:09 |
@HeikoS | and then = | 15:09 |
@HeikoS | makes a lot of sense | 15:09 |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun | 15:10 | |
geektoni | HeikoS: mmh maybe I'm missing something, could you point me to the line where that behaviour is implemented in any.h? | 15:11 |
@HeikoS | geektoni: e.g. line 291 | 15:12 |
@HeikoS | template <class T> | 15:12 |
@HeikoS | inline auto clone_impl(maybe_most_important, T* value) | 15:12 |
@HeikoS | -> decltype(static_cast<void*>(value->clone())) | 15:12 |
@HeikoS | { | 15:12 |
@HeikoS | if (!value) | 15:12 |
@HeikoS | return nullptr; | 15:12 |
@HeikoS | return static_cast<void*>(value->clone()); | 15:12 |
@HeikoS | } | 15:12 |
@HeikoS | and then above is the cascade | 15:13 |
@HeikoS | template <class T> | 15:13 |
@HeikoS | inline auto clone_impl(more_important, const T& value) | 15:13 |
@HeikoS | -> decltype(value.clone()) | 15:13 |
@HeikoS | { | 15:13 |
@HeikoS | return value.clone(); | 15:13 |
@HeikoS | } | 15:13 |
@HeikoS | and then next is | 15:13 |
@HeikoS | template <class T, std::enable_if_t<std::is_copy_constructible<T>::value>* = nullptr> | 15:13 |
@HeikoS | inline T clone_impl(general, T& value) | 15:13 |
@HeikoS | { | 15:13 |
@HeikoS | return T(value); | 15:13 |
@HeikoS | 15:13 | |
geektoni | HeikoS: cool cool | 15:13 |
geektoni | thanks :) | 15:13 |
@HeikoS | nw | 15:13 |
@HeikoS | let me know how that goe | 15:14 |
@HeikoS | s | 15:14 |
@HeikoS | Ill check back in after lunch | 15:14 |
@HeikoS | gf712: also see the mmd issue | 15:14 |
@HeikoS | https://github.com/shogun-toolbox/shogun/issues/4595 | 15:14 |
-!- HeikoS [~heiko@73.red-83-46-178.dynamicip.rima-tde.net] has quit [Ping timeout: 250 seconds] | 15:19 | |
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has quit [Ping timeout: 256 seconds] | 15:29 | |
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has joined #shogun | 15:39 | |
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has quit [Quit: Page closed] | 17:00 | |
-!- gf712 [9052084a@gateway/web/freenode/ip.144.82.8.74] has quit [Quit: Page closed] | 18:17 | |
-!- essam [c5351260@gateway/web/freenode/ip.197.53.18.96] has joined #shogun | 18:22 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection] | 18:36 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun | 18:44 | |
-!- shogun-toolbox [~shogun@7nn.de] has quit [Ping timeout: 250 seconds] | 22:14 | |
--- Log closed Wed May 08 22:14:43 2019 | ||
--- Log opened Wed May 08 22:21:56 2019 | ||
-!- shogun-toolbox [~shogun@7nn.de] has joined #shogun | 22:21 | |
-!- Irssi: #shogun: Total of 14 nicks [3 ops, 0 halfops, 0 voices, 11 normal] | 22:21 | |
-!- Irssi: Join to #shogun was synced in 6 secs | 22:21 | |
--- Log closed Thu May 09 00:00:07 2019 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!