K-ballo changed the topic of #ste||ar to: STE||AR: Systems Technology, Emergent Parallelism, and Algorithm Research | stellar.cct.lsu.edu | HPX: A cure for performance impaired parallel applications | github.com/STEllAR-GROUP/hpx | Buildbot: http://rostam.cct.lsu.edu/ | Log: http://irclog.cct.lsu.edu/
weilewei has quit [Remote host closed the connection]
hkaiser has joined #ste||ar
K-ballo has quit [Quit: K-ballo]
bita_ has joined #ste||ar
bita__ has quit [Ping timeout: 260 seconds]
gnikunj[m] has quit [Ping timeout: 268 seconds]
klaus[m] has quit [Ping timeout: 268 seconds]
gnikunj[m] has joined #ste||ar
klaus[m] has joined #ste||ar
hkaiser has quit [Quit: bye]
bita_ has quit [Ping timeout: 268 seconds]
akheir has quit [Remote host closed the connection]
K-ballo has joined #ste||ar
hkaiser has joined #ste||ar
weilewei has joined #ste||ar
bita_ has joined #ste||ar
weilewei has quit [Ping timeout: 245 seconds]
weilewei has joined #ste||ar
hkaiser has quit [Read error: Connection reset by peer]
hkaiser has joined #ste||ar
<hkaiser>
ms[m]: yt?
<hkaiser>
ms[m]: would you have the time to look at #5039 at some point, please?
weilewei has quit [Remote host closed the connection]
<hkaiser>
gonidelis[m]: see pm, pls
hkaiser has quit [Quit: bye]
bita_ has quit [Ping timeout: 260 seconds]
<gnikunj[m]>
K-ballo: is there a way to make this code work without doing any casting for `foo`? https://godbolt.org/z/74e8co
<K-ballo>
gnikunj[m]: no, `foo` has no type
<gnikunj[m]>
I see
<K-ballo>
you can wrap the `foo` call in a lambda, that's not a cast
<gnikunj[m]>
yes but I want the API to look clean
<K-ballo>
macros
<gnikunj[m]>
I guess standards was all about removing macros :P
<gnikunj[m]>
*thought
<K-ballo>
no, it isn't
<K-ballo>
are you in control of `foo` too?
<gnikunj[m]>
no, that's the problem. I am not in control of foo.
<gnikunj[m]>
that's a user provided function
<K-ballo>
so what do you have then?
<gnikunj[m]>
and it can have as many overloads
<K-ballo>
are you reimplementing std::invoke ?
<gnikunj[m]>
I want an API that takes in a user method (which can have overloads) and I want to invoke them with user provided arguments
<gnikunj[m]>
yes, you can think of it that way
<K-ballo>
P1770/P1772 tried to give it a synthetic type
<gnikunj[m]>
google search results some gibberish. Could you provide me the link?
<K-ballo>
wg21.link/ + paper number
<gnikunj[m]>
ohh thanks!
<K-ballo>
it's P1170, not P1770
<gnikunj[m]>
I think P1772 is what I'm asking for. Let me give it a quick read
<K-ballo>
IIRC 1772 combines the solutions from P1170 and the problems from std::overload{}
<K-ballo>
the problem with giving it a type is that the type changes depending on context
<K-ballo>
there are more or less candidates depending on where you do the lookup
<K-ballo>
so effectively each time you use a function name as an expression, you'd have to give it a unique type (a lot like lambdas)
<gnikunj[m]>
as long as the API looks clean, I don't have issues changing it
<K-ballo>
so far EWG has been opposing lifting with clean syntax
<gnikunj[m]>
why's that
<gnikunj[m]>
I mean SFINAE is a thing, why not add a compile time check on `foo` and see which one fits in?
<K-ballo>
`foo` has no type
<K-ballo>
you need the expression `foo` to have a type in order to be able to sfinae, compile time check, dispatch, whatever
<K-ballo>
the problem is you can't pass a type-less expression to a function
<gnikunj[m]>
when we have `void foo(int)`, you're saying foo does not have a type?
<gnikunj[m]>
is it like functions don't have a type?
<K-ballo>
`void foo(int)` is a declaration, it obviously have a type
<K-ballo>
the expression `foo` doesn't have a type
<K-ballo>
what's the type of `foo`?
<gnikunj[m]>
but when you're passing foo to another function, why does it work when there are no overloads?
<K-ballo>
if there's a single `foo` then it has a type
<gnikunj[m]>
now that's cheating
<gnikunj[m]>
why does multiple overloads not get to keep a type?
<K-ballo>
kinda, cheating is letting you use the `foo` expression outside of a call with overloads
<K-ballo>
what type would it be?
<gnikunj[m]>
idk, let the compiler come up with separate types for all the overloads
<gnikunj[m]>
make it easier for the users to pass them around as well