02:39
weilewei has joined #ste||ar
02:47
K-ballo has quit [Quit: K-ballo]
03:27
hkaiser has quit [Quit: bye]
03:34
weilewei has quit [Remote host closed the connection]
05:54
shahrzad has quit [Quit: Leaving]
06:31
bita has quit [Read error: Connection reset by peer]
11:52
parsa has joined #ste||ar
11:56
beauty2 has joined #ste||ar
11:57
beauty1 has quit [Ping timeout: 272 seconds]
12:21
K-ballo has joined #ste||ar
12:36
<
gonidelis[m] >
what's a `local_raw_iterator` ?
12:49
hkaiser has joined #ste||ar
13:49
<
gonidelis[m] >
hkaiser: although I made the changes we were talking about I get this
13:50
<
hkaiser >
gonidelis[m]: looks better now ;-)
13:51
<
hkaiser >
I woul dhave to see the full thing (your changes) to suggest anything
13:51
<
gonidelis[m] >
it seems there is a mismatch between `in_in_out_result<local_iterator....>` and `in_in_out_result<traits1::local_raw_iterator...>`
13:51
<
gonidelis[m] >
hkaiser: sure it look better
13:51
<
hkaiser >
yah, try to find out what those typedef resolve to
13:54
<
K-ballo >
have you fixed the conversion bug I flagged yesterday?
13:54
<
gonidelis[m] >
I don't think there is anything wrong here
13:55
<
gonidelis[m] >
K-ballo: sec
13:56
<
gonidelis[m] >
K-ballo: oh no. sorry. I was cought up in this iterator conversion thing
13:56
<
gonidelis[m] >
but, what did you mean `conversion operators` ?
13:57
<
K-ballo >
the iterator conversion should be fine I reckon
13:57
<
K-ballo >
the algorithm result types have broken conversion operators
13:57
<
K-ballo >
the in_in_out_result in your error, for example
13:58
<
gonidelis[m] >
What is a conversion operator?
13:59
<
hkaiser >
gonidelis[m]: the specializations you linked look ok, afaics
13:59
<
gonidelis[m] >
hkaiser: thanks
14:00
<
gonidelis[m] >
K-ballo: ok so you are talking about this line
14:00
<
gonidelis[m] >
and #L126
14:01
<
K-ballo >
yes, as well as all the others in that file
14:02
<
gonidelis[m] >
yeah I am already cross checking along with the spec
14:02
<
gonidelis[m] >
I promise I can't spot any difference
14:02
<
K-ballo >
> 12:56:42 PM - K-ballo: from const& to non-const&, that's your bug
14:04
<
hkaiser >
K-ballo: hmm, I don't see the problem
14:04
<
gonidelis[m] >
where do you see `non-const&`?
14:04
<
gonidelis[m] >
K-ballo:
14:04
<
K-ballo >
std::is_convertible<I1 const&, II1&>::value
14:04
<
K-ballo >
vs requires convertible_to<const I1&, II1>
14:04
<
gonidelis[m] >
oh shit
14:05
<
K-ballo >
all the const& ones have it
14:05
<
gonidelis[m] >
we should fix in `in_out_rslt` too then
14:05
<
hkaiser >
excellent catch!
14:05
<
gonidelis[m] >
and `in_in`
14:05
<
gonidelis[m] >
hkaiser: he is a maniac
14:06
<
hkaiser >
that error is my fault - interesting it didn't show up before
14:06
<
hkaiser >
gonidelis[m]: could you please create a separate PR fixing this?
14:07
<
gonidelis[m] >
ok could `local_raw_iterator` have to do anything with this `const&` `non const&` issue?
14:07
<
gonidelis[m] >
hkaiser: ahh yeah
14:07
<
gonidelis[m] >
it should be pushed before the `transform` PR right?
14:07
<
hkaiser >
yes, please
14:07
<
gonidelis[m] >
K-ballo: thanks a lot
14:07
<
K-ballo >
could it? the error telling you about in_in_out_results not being convertible?
14:08
<
hkaiser >
K-ballo: I think that's the problem
14:08
<
K-ballo >
a conversion from T const& to non-const U& is highly unlikely to ever succeed
14:08
<
K-ballo >
it would take something like reference wrapper
14:24
<
gonidelis[m] >
K-ballo: ok I am trying to figure out the machinery behind this spec implementation
14:26
<
gonidelis[m] >
first of all what's the diff between the `const&` operator and the `&&` operator?
14:26
<
gonidelis[m] >
the one is const ref and the other is an rvalue ref I know
14:27
<
gonidelis[m] >
but what do they indicate in this context? K-ballo
14:29
<
K-ballo >
you mean the member function "qualifiers" (not really)?
14:30
<
gonidelis[m] >
yeas
14:30
<
gonidelis[m] >
yes ^^
14:30
<
K-ballo >
roughly speaking one applies to lvalues and the other to lvalues
14:30
<
gonidelis[m] >
what?
14:30
<
K-ballo >
one applies to lvalues and the other one to rvalues
14:30
<
gonidelis[m] >
why gr?
14:30
<
K-ballo >
because I said lvalues twice the first time
14:31
<
gonidelis[m] >
lol ok
14:31
<
gonidelis[m] >
great
14:31
<
gonidelis[m] >
thanks
14:31
<
gonidelis[m] >
and in the lvalue case
14:31
<
K-ballo >
incidentaly, it's slightly suspicious that a result object is an lvalue
14:31
<
gonidelis[m] >
hmm yeah that's true
14:31
<
gonidelis[m] >
is there any "but" here?
14:31
<
hkaiser >
K-ballo: you could store it locally before using it
14:32
<
K-ballo >
yeah, but why would you do it? that's what's suspicious
14:32
<
hkaiser >
auto r = transform(...);
14:32
<
K-ballo >
that's suspicious, why not return transform(...) ?
14:32
<
hkaiser >
and then use r.out in the next algorithm
14:33
<
K-ballo >
sure, but then you wouldn't be hitting the lvalue conversion operator
14:33
<
K-ballo >
gonidelis[m]: can you track down the line that's triggering the lvalue conversion/
14:34
<
gonidelis[m] >
K-ballo: yeah sure
14:34
<
hkaiser >
true - fair point
14:37
<
gonidelis[m] >
1. why wouldn't you hit the lvalue conversion in that case?
14:37
<
gonidelis[m] >
2. why is it that in the lvalue qualifier case, we need `is_convertible<const I1&, II1>`?
14:38
<
K-ballo >
there are no conversions at all
14:39
<
gonidelis[m] >
`next_algo(r.out)`
14:40
<
gonidelis[m] >
oh yeah. `r.out` is lvalue from the beginning
14:40
<
gonidelis[m] >
(??)
14:40
<
K-ballo >
I don't know what's on your mind, maybe add more detail
14:40
<
K-ballo >
a conversion requires a destination with a different type than the source
14:41
<
K-ballo >
there are no conversions in `auto r = ...;`, auto deduces the destination type to that of the source
14:41
<
K-ballo >
and there are no conversions in `r.out`, there's not even a destination type
14:42
<
gonidelis[m] >
ok what's a case where ` constexpr operator in_in_result<II1, II2>() && ` is used?
14:42
<
K-ballo >
when the result object is an rvalue
14:43
<
K-ballo >
in_in_result<I1, I2> fun();
14:43
<
K-ballo >
in_in_result<II1, II2> x = fun() // fun() yields an rvalue in_in_result<I1, I2>
14:44
<
K-ballo >
auto lvalue = fun(); // put it in an lvalue
14:44
<
K-ballo >
in_in_result<II1, II2> x = lvalue;
14:45
<
gonidelis[m] >
isn't `auto lvalue = fun();` an r to and lvalue conversion?
14:45
<
gonidelis[m] >
since `fun()` is rvalue
14:45
<
gonidelis[m] >
and `lvalue`, well, it's lvalue
14:46
<
K-ballo >
what's an r to...?
14:47
<
K-ballo >
auto lvalue = fun(); is initialization
14:47
<
gonidelis[m] >
an r to an l ^^
14:47
<
K-ballo >
what is an "r to an l"? that's not a thing
14:48
<
gonidelis[m] >
K-ballo: so you can't find a case where an rvalue need to be converted to lvalue with these result types?
14:48
<
gonidelis[m] >
rvalue to an lvalue^^^
14:48
<
K-ballo >
rvalue to lvalue conversion is not a thing
14:48
<
K-ballo >
lvalue to rvalue conversion is a thing, maybe you are confusing the two?
14:49
<
K-ballo >
lvalue to rvalue conversion is basically when you have an object but you need a value
14:50
<
gonidelis[m] >
> 14:31 <K-ballo> incidentaly, it's slightly suspicious that a result object is an lvalue
14:50
<
gonidelis[m] >
ok that's why I was confused
14:50
<
K-ballo >
if we want to discuss that, I'm going to have to start again and use more precise terminology
14:51
<
K-ballo >
"a result object is an lvalue" basically means it's put in a variable, given a name
14:51
<
K-ballo >
so you are getting this result object, putting it in a variable, and then returning the variable for some reason
14:52
<
gonidelis[m] >
oh okk i get that
14:52
<
gonidelis[m] >
so in the `constexpr operator in_in_result<II1, II2>() const &` case
14:52
<
gonidelis[m] >
you are asking, "why would one return an lvalue" ?
14:53
<
K-ballo >
yeah, why would one store a result object instead of simply returning it
14:53
<
gonidelis[m] >
hmmmm
14:53
<
gonidelis[m] >
ok great
14:53
<
K-ballo >
the code triggering the conversion has to look like this:
14:53
<
K-ballo >
auto result = transform(...);
14:53
<
K-ballo >
return result;
14:53
<
K-ballo >
// do something here
14:53
<
K-ballo >
which is not a very nice pattern
14:53
<
gonidelis[m] >
why?
14:54
<
K-ballo >
because it's not the same as returning the result directly then doing something
14:54
<
gonidelis[m] >
in `// do sth here` you are not doing anything with `result`?
14:54
<
K-ballo >
even if you are
14:54
<
K-ballo >
once you locate the line that's triggering it we may discuss the specific case
14:55
<
K-ballo >
I only said "slightly suspicious", it may be ok
14:56
<
K-ballo >
actually that scenario would also trigger the rvalue conversion due to implicit move, so it has to be weirder than that
14:57
<
gonidelis[m] >
I get what you describe
14:57
<
gonidelis[m] >
I just don't get why it's weird
14:57
<
K-ballo >
it would have to be something more like return storage.result;
14:57
<
gonidelis[m] >
let me look for the line anyways
14:58
<
K-ballo >
result objects would normally be returned, not copied around
15:05
<
gonidelis[m] >
K-ballo: should the compiler denote the line?
15:06
<
K-ballo >
if it's still failing to compile, probably, but you would likely be getting a lot of extra information too
15:06
<
gonidelis[m] >
I haven't fix anything yet
15:06
<
gonidelis[m] >
I am trying to find the line
15:06
<
gonidelis[m] >
in order to learn
15:06
<
gonidelis[m] >
from our discussion
15:07
<
K-ballo >
if you add a static_assert to the lvalue conversion operator you should get a more precise stack dumped than when things sfinae out
15:08
<
gonidelis[m] >
could that be the cse?
15:08
<
gonidelis[m] >
case *
15:08
<
K-ballo >
it could be
15:09
<
gonidelis[m] >
I just provided a `dispatch` version in this branch that works with `in_in_out_result`
15:09
<
K-ballo >
what happens if it were auto out = ...;
15:09
<
K-ballo >
wait no, that shouldn't be it
15:09
<
K-ballo >
dispatch should return an rvalue, does it not?
15:11
<
gonidelis[m] >
is that an rvalue or an lvalue?
15:11
<
K-ballo >
it would be wrong for it to be any kind of reference
15:12
<
gonidelis[m] >
how would it be if it was return an rvalue
15:12
<
K-ballo >
it should be returning a non-reference type
15:12
<
K-ballo >
if it returned an && it would still be an rvalue, but still be wrong
15:13
<
K-ballo >
but even if it did, it wouldn't be triggering the lvalue conversion
15:14
<
gonidelis[m] >
oh ok
15:14
<
K-ballo >
put a dependent static_assert inside the lvalue conversion, see what the error trace tells you
15:15
<
K-ballo >
static_assert(sizeof(II1) == 0);
15:16
<
gonidelis[m] >
where?
15:16
<
gonidelis[m] >
on the `in_out_result` impl?
15:16
<
gonidelis[m] >
`in_in_out_result` *
15:17
<
K-ballo >
inside the lvalue conversion operator
15:17
<
gonidelis[m] >
what about that?
15:17
<
gonidelis[m] >
could that be
15:20
<
K-ballo >
shouldn't be, `util::in_out_result<SegIter, OutIter>{olast, odest}` is a prvalue
15:20
<
K-ballo >
so is the return from the lambda, `util::in_out_result<SegIter, OutIter>`
15:21
<
gonidelis[m] >
I 've never understood what's a `prvalue` in my life
15:24
<
K-ballo >
X is a prvalue, X& is an lvalue, X&& is an xvalue
15:24
<
K-ballo >
an rvalue is a prvalue or an xvalue
15:24
<
K-ballo >
5 is a prvalue, X{} is a prvalue
15:25
<
K-ballo >
since I'm not being precise with terminology anyways, I'll just say prvalue is a value with no name
15:26
<
gonidelis[m] >
that's better ;p
15:26
<
gonidelis[m] >
what about the `static_assert(sizeof(II1) == 0);` case
15:26
<
gonidelis[m] >
should I put it inside the body of the conversion?
15:26
<
K-ballo >
inside the lvalue conversion operator
15:27
<
gonidelis[m] >
like that `std::is_convertible<I1 const&, static_assert(sizeof(II1) == 0);>` ?
15:35
<
K-ballo >
no, that's not a place you can put a static assert (it's a declaration)
15:35
<
K-ballo >
you need to put it in the body of the conversion operator
16:41
hkaiser has quit [Quit: bye]
16:57
<
gonidelis[m] >
K-ballo: what did we expect from the static assert?
17:02
<
K-ballo >
a trace for the stack that leads to its instantiation
17:07
<
gonidelis[m] >
K-ballo: do you understand sth new from here
17:07
<
gonidelis[m] >
from this*
17:10
<
K-ballo >
gonidelis[m]: what's the source corresponding to this trace?
17:12
<
gonidelis[m] >
i knew that from the beginning ;p
17:12
<
gonidelis[m] >
it was the first error in the stack
17:12
<
gonidelis[m] >
why is ti the problem though?
17:12
<
gonidelis[m] >
from the aspect of the wrong conversion?
17:12
<
K-ballo >
I was wondering why it was taking you so long to locate the source of the call
17:13
<
gonidelis[m] >
I thought i needed to find sth more sophisticated
17:13
<
gonidelis[m] >
(I wasn't working the past 1 hour though)
17:13
<
gonidelis[m] >
anyways, why is that the problem?
17:14
<
K-ballo >
I'd imagine the `R` given to algorithm_result_helper<R> is not what the algorithm actually returns.. but that doesn't cover the lvalue aspect
17:14
<
K-ballo >
waaaaait, that's a warning
17:15
<
K-ballo >
is sizeof(II1) == 0???
17:15
<
K-ballo >
it is still all sfinae in the trace
17:15
<
gonidelis[m] >
<K-ballo "is sizeof(II1) == 0???"> I have no idea
17:16
<
K-ballo >
in standard c++ that is always false, but gnu has extensions
17:16
<
K-ballo >
can't imagine how those extensions would apply here though
17:16
<
K-ballo >
fix the warning (as per the fix-it), see if you can then get an actual errro
17:17
<
gonidelis[m] >
I just put a message there
17:17
<
gonidelis[m] >
right?
17:19
<
K-ballo >
the fix it says to add `, ""`
17:20
<
gonidelis[m] >
btw does master still not compile with gcc?
17:20
<
gonidelis[m] >
K-ballo: why?
17:21
<
K-ballo >
because if that's intended then the conversion shouldn't be kicking in
17:21
<
gonidelis[m] >
that what intended?
17:21
<
K-ballo >
that function there to be called
17:21
<
K-ballo >
you appear to be expecting raw iterators to transform to plain iterators, but appear to be calling it with plain iterators
17:22
<
gonidelis[m] >
what's the difference between a raw and a plain iter?
17:22
<
K-ballo >
the conversion should be happening in its return ...; statement
17:23
<
gonidelis[m] >
hmmm i just copied the `in_out_result` impl there
17:24
<
K-ballo >
if the `in_out_result` one works then it must be being called with raw iterators as intended
17:52
<
gonidelis[m] >
I don't know what's a raw iter ;p
17:52
<
gonidelis[m] >
I am asking since yesterday qr
17:52
<
gonidelis[m] >
;p *
17:54
<
gonidelis[m] >
K-ballo: how is this conversion called `std::is_convertible<I const&, I2>::value` ?
20:20
hkaiser has joined #ste||ar
20:36
gonidelis[m] has quit [Ping timeout: 240 seconds]
20:36
henrietaMag has quit [K-Lined]
20:36
mkeyn[m] has quit [Ping timeout: 246 seconds]
20:36
gnikunj[m] has quit [Ping timeout: 246 seconds]
20:37
ms[m] has quit [Ping timeout: 240 seconds]
20:37
rori has quit [Ping timeout: 260 seconds]
20:37
heller1 has quit [Ping timeout: 244 seconds]
20:37
tiagofg[m] has quit [Ping timeout: 268 seconds]
20:37
k-ballo[m] has quit [Ping timeout: 246 seconds]
20:38
klaus[m] has quit [Ping timeout: 260 seconds]
20:38
parsa[m] has quit [Ping timeout: 264 seconds]
21:00
gonidelis[m] has joined #ste||ar
21:00
gnikunj[m] has joined #ste||ar
21:01
mkeyn[m] has joined #ste||ar
21:01
k-ballo[m] has joined #ste||ar
21:06
parsa[m] has joined #ste||ar
21:07
rori has joined #ste||ar
21:09
tiagofg[m] has joined #ste||ar
21:11
klaus[m] has joined #ste||ar
21:14
heller1 has joined #ste||ar
21:14
ms[m] has joined #ste||ar
23:37
hkaiser has quit [Quit: bye]