« first day (2018 days earlier)      last day (2932 days later) » 

9:00 AM
um hey
what
 
thank you
 
can’t paste code... — Dylan Wang 2 mins ago
wat
 
thought I was missing something there
 
@sehe Only copy
 
9:02 AM
It's a rare disability in programmer populations
 
cut it out
 
^ Has anyone seen this?
is it worth watching
 
Dunno.
I didn't get very far in that video.
 
@sehe vim is great
I just learned a few shortcuts I didn't previously know and omg the producktivity gainz
 
user1804599
> Teach Yourself Programming in Ten Years
 
user1804599
9:05 AM
I like this.
 
@AndyProwl He talks a lot about certain concepts that don't really seem very relevant for my work.
 
once I taught sehe how to be a vip
 
@DmitriBudnikov not even sure whether serious
@Zoidberg I especially like the ambiguity ("Not now! I'm partying. Maybe in ten years [from now]")
 
@sehe that'd be a first
 
@BartekBanachewicz The fruit of your labor: github.com/VermillionAzure/asdf
 
9:10 AM
@VermillionAzure ugh
you know man, there's this one secret programming gem
most of the people don't possess the knowledge to use it
it gives you superpowers
and it's called...
 
botany
 
ACTUALLY FUCKING STRUCTURING YOUR CODE INTO ANY PRIMITIVE WHATSOEVER
like, a function.
 
@BartekBanachewicz Oh yes this is just the ugly version so I can write something
 
@VermillionAzure slaps him
 
Because I haven't actually written hobby C++ for months
 
9:12 AM
there's no justification for shitty code
 
shitty code > no code as a hobby
can't call it a hobby if I never do it
 
sometimes I think the world would be better off
I mean why do you write ugly code in the first place
it's much easier to write good code
 
@BartekBanachewicz remember bartek you're talking to cinch here
5
you underestimate my idiocy
 
Ven
mmh, I'm getting an ambiguous cast with static_cast<Foo>(class). The class has an operator Foo, but the error message states that it's ambiguous between Foo and Class2 (which has a template<class T> copy ctor...)
 
@VermillionAzure I would presume you'd learn how to use functions at this point
 
9:14 AM
@Ven where does Class2 come from?
 
Splendid. Now people have reason to think #Erdogan might be a megalomaniac dictator. #jesuisstreisand Many would never have known ¯\_(ツ)_/¯
 
@Ven Did you make things explicit?
 
Always hot on the tails of the news
 
Ven
@VermillionAzure not allowed to :/
 
@Ven Remember that types will automatically be converted to the valid type for calls, right?
 
Ven
9:15 AM
@AndyProwl same file as Foo. wait, I'll try to coliru it
 
1 message moved to bin
 
Ven
@VermillionAzure I'm asking for a static_cast<Foo> here, seems pretty explicit to me
 
@Ven No, but the call itself with alias it anyways
The process should go: cast => implicit cast required for call => call or something similar
 
@Ven Good idea. (I actually meant how is Class2 entering the game in the above cast)
 
@AndyProwl zing
 
9:17 AM
@AndyProwl lol
@LucDanton oh my god
 
@DmitriBudnikov you can gqip etc.
 
> C language : what is wrong in my code? Please help me!.
It's C.
@LucDanton stop throwing knowledge at me!
 
Actually I think the term "lambda object" is underrated
 
@Ven gcc.godbolt.org/…*f%3B+%7D%0A%0Aint+main()+%7B%0A%09int+i%3B++%0A++++std:‌​:cin+%3E%3E+i%3B%0A++%0A++%09std::cout+%3C%3C+double_float(i)%3B%0A%7D')),filterA‌​sm:(binary:!t,colouriseAsm:!t,commentOnly:!t,directives:!t,intel:!t,labels:!t),ve‌​rsion:3
 
@DmitriBudnikov I feel like I have to since you called vim commands 'shortcuts'. (Shortcuts to what?)
 
9:20 AM
cvtsi2ss        xmm0, eax
call    double_float(float)
 
Ven
@VermillionAzure stop doing drugs
 
> It was a difficult business decision that came with careful analysis and thought. However, these types of decisions are never easy. We overcommitted with our free storage limits and we want to focus on delivering high-value productivity and collaboration experiences that benefit the majority of our users
lol fuckers
difficult decision my ass
 
@Ven You see, the cast is implicit before the function all even for this basic example
 
@LucDanton shortcuts to making you react
did it work
 
Note how the function needs to cast from int to float before it calls. The cast is implicit.
 
9:20 AM
@VermillionAzure God what are you talking about.
 
nice try but it didn’t work
 
Ven
SSCCE of my problem /cc @AndyProwl
 
btw I’m not chipping in for a new cinch alert they just keep fizzling and burning out
somehow
 
"Someone mentioned casts! Engage!" spews forth stock random example of implicit casts "See, that's how it works"
 
@Ven you'd want the non-template to be picked?
 
Ven
9:22 AM
@R.MartinhoFernandes I'd love to make all our constructors explicits, but I'm not allowed to.
 
I mean the conversion op
 
@LucDanton oh wow I just noticed
Cinch is the Lounge equivalent of background radiation, I guess.
 
@Ven Make the operator explicit but you can't because you're not using C++11?
 
Ven
@VermillionAzure "NOT ALLOWED TO"
@AndyProwl yeah. coliru.stacked-crooked.com/a/2195de94d342145f – it's just a member. I don't understand why it tries to convert, when there's one that isn't templated
 
yeah that surprises me a bit too
 
9:23 AM
@Ven Constructing a Tree with a Rep argument vs. converting Rep to JSON is where it becomes ambiguous. No way to distinguish without explicitness.
 
@Ven the two candidates are the conversion op and a non-template constructor
 
@LucDanton I thought it was Trump and Clinton?
 
Ven
But one is a perfect match: const JSON &, one requires a templated implicit conversion.
 
@Ven No, it's not.
 
Ven
@DmitriBudnikov tg ptn
 
9:24 AM
Both are perfect matches.
 
@Ven dj t t clm t nst t tls pls d vylls
 
Ven
@DmitriBudnikov tu es parti loin
 
JSON(Rep const&) would do too, I guess.
 
Ven
@R.MartinhoFernandes can you clarify?
@R.MartinhoFernandes yeah, but that's "backwards". I don't want to specify those on JSON
 
user1804599
@sehe xD
 
9:26 AM
@Ven Why do you have the operator there anyways?
Wasn't having implicit cast operators bad style or something like that?...
 
idgi, why the copy ctor?
isn't the conversion op enough
 
Ven
@VermillionAzure I'm just gonna ignore you now
@AndyProwl the copy ctor is because you might want to copy JSONs. Unrelated to Req and all. (they're not even in the same git repo)
 
@Ven No I mean, why are we talking about the copy ctor...
why is it invoked
 
@Ven I don’t have a solution or any advice (save for the generic 'don’t use conversion ops they make everthing worse')
 
Ven
@LucDanton "NOT ALLOWED" cmon
@AndyProwl I asked for a copy
 
9:28 AM
you're screwed hth
 
@Ven but where
 
Ven
if I static_cast<const JSON &>, it's not gonna copy :)
 
Xeo
@AndyProwl static_cast to value type
 
@Ven you’re not allowed not to have a conversion op?
 
9:29 AM
that’s programmer cruelty
 
@Xeo uh? really? why is that trying to make a copy
@Ven doesn't load, dunno why :(
 
Ven
@AndyProwl refresh
 
yeah got it
 
Ven
@AndyProwl I asked for T, not a const T &, so it has to copy
 
but I still don't understand why casting to a value type is making a copy
 
Xeo
9:30 AM
Also, the conversion operator copies
 
why? can't it just construct a temporary?
@Xeo seems to me it default-constructs
 
Ven
@AndyProwl look at my last coliru
 
@Ven ok, that one, yes
but the original default-constructs
so I don't understand why is the copy-constructor involved
 
@Ven why’d you 'cmon' me anyway, you didn’t mention anything like that beforehand
 
Xeo
@Ven What would Andrei say? "CALL HEADHUNTER"
 
9:31 AM
rude
@Xeo lol
 
@AndyProwl The copy constructor should take values as well, right?
 
wot
are you cinching at me
 
The type is const Type& which accepts both lvalue and rvalue types, usually.
Or... am I wrong?...
Because if you try to do f(1) on f(int&) that won't work but add the const and it does
 
@Ven yeah but that’s about explicit
 
Ven
9:34 AM
@LucDanton well, it has to be 'implicit"
 
right
 
you know now that I think about it
 
isgdi
 
Xeo
My condolences.
 
I think that inclusion of range-for in C++11 was a mistake
 
9:35 AM
and my advice on that (which we do know is not applicable) is to still not use conversion ops
 
Ven
@Xeo :[
 
nothing to do with explicit
 
Ven
@LucDanton I can give you my tutor's number, fwiw :P
@BartekBanachewicz why?
 
@LucDanton +1
 
copy constructor is not invoked if I remove the constructor taking Tree, so why does it make things ambiguous in its presence?
 
9:36 AM
@Ven because it introduced another language construct, where a range-based std::transform would completely suffice.
it was unnecessary.
 
Ven
@BartekBanachewicz you don't realize how few C++ developers are allowed to use lambdas
 
wait what
and they're allowed to use range-for?
 
Ven
@AndyProwl please keep me posted if you find an explanation. Or if @R.MartinhoFernandes ever comes back :P
@BartekBanachewicz yeah
 
@Ven what
 
@Ven Just ask Luc to spoonfeed you he loves doing that
 
9:37 AM
@AndyProwl I got it
 
Ven
@AndyProwl i'll trust you on that one
 
@Ven and what does actually disallow lambdas? I mean on what basis?
inb4 GSG
 
Because Tree has a templated constructor, it will accept any lvalue and rvalue as its constructor parameter
 
Ven
@BartekBanachewicz ugly, generates classes, "too complex"
The guido van rossum of C++ :P
 
@Ven lol who said that
 
9:38 AM
And since JSON takes Tree as a constructor it will complete the ambiguity
 
Ven
@VermillionAzure o rly
 
"generates classes" lol
how fucking dumb do you need to be to think that
 
if you remove Tree the error goes away
 
I remember being disallowed to use lambdas in Obj-C at a previous job
 
Ven
@VermillionAzure sigh
 
9:38 AM
we're talking deeply-religious-level-of-dumb here
 
iPhone app, 1 developer, 3000 LoC codebase
 
Ven
go away. shoo
 
because you can't call it anything other than "faith" that lambdas generate "bloat" or whatever
 
@Ven I'd ask on SO
it's an interesting question
probably involves OR wankery
 
Ven
9:40 AM
@AndyProwl my question virginity :[
 
@BartekBanachewicz FWIW you're not the only one here who thinks that way
 
@Ven lol, time to make the big step
 
Do I need to draw it out...
 
Ven
@AndyProwl why is this not ambiguous?
 
Mar 29 '15 at 20:56, by Puppy
range-based for is the Committee observing that iterators are shit and then fixing it in one tiny corner case by implementing a special language feature.
@milleniumbug yeah, he's spot on here.
 
9:42 AM
@Ven I wouldn't expect that to be ambiguous
no conversions required
 
> 10k rep
> first question
> gets closed as unclear
 
@AndyProwl more obvious without the syntax: without the ambiguity, static_cast<JSON>(req) would be the same as JSON { req.operator JSON() }
 
Ven
@slaphappy rude :(
@LucDanton and that's not ambiguous
 
@LucDanton but if that were the case, removing the constructor that takes a Tree would invoke the copy ctor, no?
 
Ven
there's a const JSON & ctor. that's a perfect match
 
9:44 AM
@Ven I once posted a question on SU about env variables explicitely stating "NOT A DUPE OF THIS OTHER QUESTION BECAUSE READ BELOW"
closed as dupe of this other question
 
@Ven what are you trying to say? that the snippet which the compiler says is ambiguous is unambiguous?
 
IOW I'd expect that to be equivalent to just req.operator JSON(), not to JSON { req.operator JSON() }
 
Ven
@LucDanton to me, yes
@AndyProwl that too..
 
okay then
 
@LucDanton like, why there's no copy ctor invoked here? Elision?
 
9:46 AM
@AndyProwl I can see that, but it doesn’t work that way. off the top of my head it’s not possible to call a conversion op without side-effects other than, well, writing the name
@AndyProwl of course
 
ah
how's that flag for not eliding stuff
 
@Ven implicit cast to Tree will fit into JSON(const Tree&)
 
-fineverremember
 
@AndyProwl lookie
 
@LucDanton yeah
TIL
 
9:48 AM
luc bashing everyone with knowledge
 
and -fno-elide-constructors
 
Assume you have a sort of REST like service. The client is not able to hold any state on its part but it works sequentially on a list of tasks. The client is supposed to fetch the next task on the list, try to complete, and update the server with the information on whether it was able to complete it, it completed part of it, or no progress was made.
 
@Ven I think this explains then
 
How would you model this on the server?
 
it's how the static_cast<value_type> works
 
9:50 AM
@Shoe what
 
Ven
@AndyProwl no
 
@Ven why not?
 
yeah that’s why I changed it to return { 0, 0 };, to avoid a copy
 
Ven
yeah but you can't argue "it works without a copy", because I have a copy
 
where?
 
9:51 AM
I currently have a queue of tasks, a list of completed tasks and the server simply fetches the front of the queue from the list of tasks and assumes that's the current task the client is talking about at every request. Unless the client says that it was not able to complete it or if it says that it was able to complete it, in which case it rotates the task out or goes to the next task.
 
Ven
@AndyProwl I return a member variable
 
It sounds terrible though.
 
@Shoe some kind of logarithm
 
alternatively could have gone for return {};, took the habit from old GCC versions or something
@Ven what matters is operator JSON();, the operator JSON { /* whatever it takes */ } implementation has no bearing on the conversion chains (thank goodness for that)
 
@Ven oh, yeah, right, but what's the problem? it's rejected
 
9:53 AM
@LucDanton i thought it allows for the copy constructor
 
Ven
@AndyProwl I don't understand why it's rejected. I'm just asking for a copy of JSON. There's no implicit conversion to be had there, so it shouldn't be ambiguous
 
@Ven The copy ctor is deleted, why wouldn't it reject it?
 
Ven
because it can chose between const JSON & (perfect match) and const Tree & (requires an implicit conversion), it should pick the first
 
@Ven wrong coliru link maybe?
 
Nevermind solved it
 
9:55 AM
@Ven seems we're talking about different snippets
 
Ven
Sorry, I'm still talking about static_cast vs .operator JSON
 
what I understood is that static_cast<value_type>(expr) is equivalent to value_type{expr.operator JSON()}
 
in the case of an unambiguous path with that conv op
 
Ven
ah, basically, static_cast will be JSON(req), which is either JSON js(req.operator JSON()); or JSON js(Tree(req)).
 
yes
that's how I understand it atm
 
Ven
9:58 AM
okay, that makes sense.
 
@Ven C++ is… really weird so take note that type(expr) is a C-style cast which means the same as (type)expr which… means the same as static_cast<type>(expr) in our situation
hence my use of the braces
 
Does @prostate ping rightfold
 
Ven
@LucDanton I know it is
 
static_cast<JSON>(req) is JSON(req) and 1 + 1 is 2 :)
 
@DmitriBudnikov so you are pro state? pcha, lefty
 
Ven
9:59 AM
@LucDanton so what I said is right?
 

« first day (2018 days earlier)      last day (2932 days later) »