« first day (930 days earlier)      last day (4019 days later) » 

11:00 AM
@R.MartinhoFernandes More importantly, can be used to "improve" shitty generics.
 
@rightfold That shows nothing.
Just s/dynamic/object/ and nothing changes.
 
user142019
@R.MartinhoFernandes I was answering ThePhD's question.
 
user142019
Complain with him, not me.
 
soooo... swizzling
 
@BartekBanachewicz Is so useful! <3
 
11:01 AM
@ThePhD no the one you think about, yours is useless
 
=[
 
I need to swizzle in order to not repeat the code 6 times
but I think I'll swizzle functions.
can I swap two lambdas?
 
swizzle: Any of various tall mixed drinks usually made with rum.
that's something for @thecoshman
 
@BartekBanachewicz You can use dynamic in C# for arbitrary swizzling!
v.xxxxxzzzzzzyyyyyyyyyy
 
@jalf damn.
it's getting more complicated again.
maybe someone wants to take a bite at the puzzle I have?
 
11:04 AM
ah I see what swizzle is
 
hmm
 
I want to jump into a lake.
 
me too
lets go together
 
Nekkid? <3
 
11:05 AM
@TonyTheLion What are you going to do together in the lake?
 
Woo~
 
Xeo
Why did jalf delete his "no"?
 
@FredOverflow Find some mermaids!
 
@FredOverflow erm... leaving that up to your imagination :P
@Xeo because, fuck everybody
 
@Xeo he was right, huh?
 
11:06 AM
@ThePhD What if there is only one, are you gonna share it?
std::shared_ptr<Mermaid>
 
of cours
 
Xeo
@BartekBanachewicz Well, every lambda expression has its own type.
 
@FredOverflow lol
 
@Xeo exactly.
 
Xeo
But if two lambdas are made from the same expression, they have the same type
 
11:06 AM
I'll show ya.
 
@Xeo Like in lambda factories.
 
auto sampler_first_axis = [](unsigned n) {
    unsigned offset_first_axis[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
    return offset_first_axis[n];
};
auto sampler_second_axis = [](unsigned n) {
    unsigned offset_second_axis[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
    return offset_second_axis[n];
};
 
?
 
now for 6 walls I need all possible permutations of these
 
std::next_permutation ?
 
11:08 AM
hmmm
yeah, that might work @Tony!
 
I would need a vector of three std::functions
 
Xeo
next_permutation assumes a sorted order.
 
Pwn'd.
 
11:09 AM
SHIIIT
 
Xeo
Or, rather, needs one
 
Erroors
 
@ThePhD lol newb. I can custom functor.
 
@BartekBanachewicz y u no static const noob
 
@DeadMG oh yeah static const whatever.
 
11:09 AM
C++ outsmarted me again :(
 
Xeo
haha
 
so, if I could create 3 custom functors, I would be able to use next_permutation
 
Xeo
I wonder why you need that lambda at all
 
I am not sure if it's worth it.
@Xeo because third axis is a constant value.
 
Xeo
... so?
 
11:10 AM
do you mean I should just make 3 arrays?
 
lol, the daily wtf's entry for today is broken
 
can I sort unsigned[]?
 
Xeo
Oh, you mean, just for that particular example the third axis is fixed?
@BartekBanachewicz sure
 
@DeadMG that's the WTF part
 
11:12 AM
I just a Popular Question badge for this: stackoverflow.com/questions/1618125/neural-networks
 
Xeo
@Morwenn Lambdas~
 
Buuuuuuuuuiiiiiiiiilllllllllllllllld succeeeeded biitches
But it's not telling me the time it took to compile.
 
@Xeo Look at the date.
 
Xeo
@Morwenn Oh.. :D
 
93
lol
 
11:14 AM
@TonyTheLion How dare you ask a question deemed to be not constructive.
 
@StackedCrooked IKNOWRITE
 
blue cube is the one we are processing
 
:44
 
for each face, I have to check values of these 8 corresponding cubes
 
Xeo
11:15 AM
Wait, what exactly are you doing?
 
The 7 looks out of place.
 
then, for each corner, 3 cubes take part in its shding
 
@ThePhD :42
 
@Xeo "ambient occlusion" for minicraft
 
Xeo
mhm
 
11:15 AM
Ooh, haha
 
huh, odd
 
I still am using va_args here
 
you suck
 
I don't suppose anyone here knows a lot about low-level keyboard input, scancodes and virtual keycodes and such?
 
Oh, C++11, you can't come fast enough...
 
11:16 AM
@Xeo so the point of swizzling is to write the code for a wall once then repeat 6 times
 
@jalf Use VK codes and avoid teh low-level keyboard nonsense UNLESS
 
Xeo
@jalf Maybe? What's the question?
 
You're doing raw input or want to scan the keyboard outside of the OS's posted events.
 
Xeo
@ThePhD ... your name is ThePhD?
 
0
Q: returning a lambda without std::function

FredOverflowConsider the following function which is returning a lambda: std::function<int()> make_counter() { int i = 0; return [=]() mutable { return i++; }; } Is it possible to return the actual lambda type, without wrapping it into a std::function?

 
11:17 AM
Just idle curiosity really, but I'm wondering if there's anything universal about the virtual key mapping Microsoft uses (msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx)
 
@jalf hm, maybe
 
I'd expect a lot of overlap with other OS'es, but also that some keys used different values. But it seems surprisingly consistent
 
@jalf that might be derived from something older than windows, regarding old keyboards
multimedia keys are particularly interesting, I guess, but they could be also standarized elsewhere
 
@BartekBanachewicz yeah, quite likely
 
I feel like a noob
 
11:19 AM
@TonyTheLion y, u nub?
 
I have blatantly no idea what I'm doing
 
you should find out. :)
 
@jalf because I'm looking for something and I have no idea what
 
So what are you doing? :D
 
the only coworker that can help me is on the phone and has been for like 2hrs now
 
11:20 AM
sounds awesome
I assume you've tried just plain text searches for likely comments or names?
 
@jalf finding a bug that is not easy to find, because you can't simply debug this thing
 
AWW DAMNIT
Xeo already answered
 
Ah, we've got a few components like that. :)
 
@FredOverflow Yes.
 
@jalf huh?
 
11:21 AM
=[ y u so fast Xeo
 
insert heaps of logging?
@TonyTheLion oh, I thought you were looking for something in the code, rather than tracing down a bug
 
@jalf there is logging, but its incomprehensible
 
Xeo
@LucDanton Hmm... good point.
 
because I don't know how to interpret the damn log file
 
Xeo
@LucDanton Want to post that as an answer or can I include it in mine?
 
11:23 AM
@TonyTheLion insert comprehensible logging?
 
Not a usual option, because I tend to need a function template.
@Xeo Go for it.
 
I have terrible taste
 
printf, if nothing else. Or open a separate file and write to that
 
Xeo
Heh, Robot added -std=c++1y to ThePhP's answer
 
also discuss with your coworkers how to make the code more debuggable (perhaps by making it possible to run in the debugger, or maybe just by sanitizing logging)
 
11:24 AM
@jalf heh
 
@Xeo oh, I kinda stuck it in mine. I'll remove it. D:
 
@jalf the problem is the sheer quantity of data the code goes through, which makes it hard to find the bits you're looking for
we're talking gigabytes of data
lots of it passes through the same code paths
 
Goddanit.
 
over and over
 
I'm so slow. =[
 
11:26 AM
I'm slower
mwuahahahah
 
Xeo
lol
 
@LucDanton You would have received tons of rep. What is wrong with you? ;-)
 
@TonyTheLion all the more reason to consider how it can be made debuggable. :)
 
@FredOverflow Considering he's at 16K, he's pretty much set.
 
Your team must spend heaps of time debugging
 
11:27 AM
@FredOverflow I don't find the question very compelling.
 
27:57
 
(Pretty much the case for all yes/no questions I think.)
 
@jalf Yea when a bug hits, its painful
 
That's not even funny.
 
Xeo
@ThePhD Considering I'm at 56k, I'm pretty much setter.
:P
 
11:28 AM
@Xeo One name:
 
@R.MartinhoFernandes Damn you for ruining my meme
 
Andy Prowl~
 
Xeo
I wonder how much longer he can keep up the repwhoring.
 
So far at 2 minutes, still compiling.
 
@TonyTheLion are ya'll using gcc/mingw or what?
 
11:30 AM
No
VC
 
and your having a nightmare debugging?
 
What else?
 
@johnathon I've said before why, scroll up
@FredOverflow lolwat
 
Like anybody needs more than 16K rep!
 
11:33 AM
Says you who has 60k something rep?
 
@FredOverflow that pose..
 
convergence on data flow paths is always a bitch, no matter the data source, imagine trying to do a flat straight read on a hierarchical database that was created in the 1960's and used FORTRAN... just so you can convert it to a more modern format. We do that. And. it's a bitch.
 
@TonyTheLion Hey, at least I didn't answer my own question this time :)
 
kek
so you're not at the level of @LightnessRacesinOrbit
yet
 
@TonyTheLion A few more ragequits, and I should be there :)
 
11:35 AM
@FredOverflow ahahah
 
@StackedCrooked The photographer must have believed that geeks could be sexy.
 
36:40
 
Xeo
@FredO: The const on make_counter breakes the lambda...
 
user1357851
@FredOverflow sexiness :p
 
36:40 - 27:57
 
11:36 AM
@FredOverflow I guess his bank account made him sexy for some women.
 
@Xeo What do you mean? Works perfectly well here.
 
= ~9 minutes
My engine takes 9 minutes to compile
I shaved off some 4 minutes or something or whatever the fuck
I'm SO GOOD AT THIS
 
Xeo
@FredOverflow Oh wait, make_counter itself is fine, yeah
That lambda expression is not valid C++11, either. The return type deduction would not work if the body contains more than just the return expression; (§5.1.2,4) — Arne Mertz 1 min ago
That is not fine, however :P
 
user1357851
sexy because he was laying in such a compromising position
 
user1357851
11:37 AM
like a subdued cat
 
@FredOverflow I crafted my thing perfectly.
 
@Xeo What does "breakes" mean, anyway? A combinations of brakes and breaks? So it's slow and wrong? :)
 
Xeo
@FredOverflow :)
 
@Telkitty I'll be your subdued cat~
I'M SO FUCKING TIRED YEEEEEAH BUT MY COMPILE TIMES ARE DOWN GUYS
 
user1357851
<3
 
11:38 AM
We should go out drinking or something
 
Your change has hurt me. I need to find closure.
 
4 whole goddamn minutes
On an old machine
I feel like a goddamn champion
 
user1357851
although you will following around with all my neighbours too if they give you belly rubs :'(
 
Xeo
@LucDanton [&LucDanton]{ ... }
 
@Telkitty I will bite all hands but yours.
 
11:40 AM
@ArneMertz What return type deduction? make_counter is not a function. — FredOverflow 13 secs ago
 
Xeo
So?
 
user1357851
lol, that's my beloved kitty :p
 
Xeo
A lambda only deduces the return type (in C++11), when you have return expr; as the only statement.
 
Modulo some irrelevant details.
 
Xeo
ya
static_assert etc
 
11:41 AM
@Xeo How retarded is that? So g++ 4.6.3 is wrong to accept the code?
 
Xeo
lol
 
@R.MartinhoFernandes You're a jerkface. D:
 
Where were you in 2011? :p
 
What did I do?
 
Xeo
@FredOverflow GCC extension~
 
11:42 AM
@Xeo therefore Luc did the function parameter trick: auto make_counter = [](int i = 0) { return [i]() mutable { return i++; }; };
 
Xeo
Since it's part of the next standard.
 
@R.MartinhoFernandes I saawww your edddiiiit.
 
Xeo
@ArneMertz I know.
 
@ThePhD So what? I fixed your example.
 
@ArneMertz I thought his intention was to make the function more customizable (start at a different value if needed). Seemed overly general for me.
 
11:43 AM
@FredOverflow You can ask me in chat!
 
@R.MartinhoFernandes =[
 
Xeo
@LucDanton It's easier to assume intentions.
 
@LucDanton When I see default parameters, I assume. I don't ask questions.
 
Xeo
Takes less effort and time. :)
 
@FredOverflow I was writing about the same lines as Xeo did, but then came across the "only return expression" problem.
 
11:44 AM
@FredOverflow Can you imagine if I had answered your question myself? You'd have edited it too? No thanks!
 
@FredOverflow I've never ragequit in my life..
oh, SO proper
well, yeah there was that one time
 
@LucDanton Now I feel bad :( Will you accept my (hypothetical) apology?
 
yes, one time
 
"that one time"
one, for all values of hundreds
 
11:45 AM
@ArneMertz welcome to the Lounge
 
@FredOverflow Not anymore. C++14 revises the rules to make them much more generous, if I recall.
 
@LightnessRacesinOrbit <3
 
@FredOverflow lol
 
11:46 AM
@FredOverflow ty
 
@LightnessRacesinOrbit you made up with each other again? aww
 
awwww
 
Xeo
Oh hey, @Arne is also German
 
const auto make_counter = [](int i = 0) { return [i]() mutable { return i++; }; };
^ for future reference
 
Xeo
Anyways, why the const?
 
11:48 AM
was is mutable lamda again?
 
I don't want make_counter to become another function :)
 
Good luck with it.
 
Xeo
@StackedCrooked Can change by-value captures.
@FredOverflow lol, try it
 
@Xeo Oh, you mean there is nothing else of compatible type?
 
Xeo
Only a copy / move of said lambda.
Also, lambda::operator=(lambda const&) = delete; per standard
 
11:49 AM
Mmh, are you relearning this stuff? I thought you played with C++11 before.
@Xeo Unspecified.
 
@LucDanton I have been dabbling with too many other languages recently.
 
I'''mmmmmmmmmmmmmmmmmmm
I feel drunk
But I haven't drank anything
 
Xeo
> The closure type associated with a lambda-expression has a deleted (8.4.3) default constructor and a deleted copy assignment operator.
 
Go to bed
 
@ThePhD It's probably the lambdas.
 
Xeo
11:50 AM
@LucDanton ^
 
@ThePhD maybe you should?
 
Damn, it's the result of std::bind that's unspecified. And now I'm wondering about that inconsistency.
 
@Xeo What about move assignment?
 
Xeo
Lambda's type is pretty well specified.
@FredOverflow No words about that
 
Alright
 
Xeo
11:51 AM
But I believe if copy-assign is deleted, move-assign isn't generated
 
I'm gonna
get rid of this last va_args stuff
 
Xeo
Something like that
 
Take a shower
 
@Xeo makes sense
 
and then pass the fuck out
GAME PLANnnNN, GO
 
11:51 AM
Don't forget drinking first.
 
Quick Question guys. Can someone tell me if there is a way to manually add fonts to TfontDialog. This is a Borland component that is not properly pulling fonts on Win 7 machines.
 
Xeo
Random question of the day! Random answer: no.
 
@FredOverflow []() { return []() { return RUM; } } <33
 
You'll find more Borland users on stackoverflow.com/questions/ask
 
@themaniac27 ask your mom
 
11:53 AM
@DeadMG When will I be able to use C++14 in Visual Studio? 2017?
 
@themaniac27 Delphi questions not really welcome here - I'm the only one who knows much Delphi, and I would not answer in chat, (even if I had one).
 
@FredOverflow 2021~
 
@FredOverflow That's C++11.
 
11:53 AM
TfontDialog for christ's sake
 
I heard Delphi has an Oracle that makes you high or something.
 
@StackedCrooked It's actually TFontDialog.
 
@FredOverflow Actually, I recently found an example in my own code where Visual Studio goes further than C++11 requires in return type deduction.
also, a reliable source told to me that the CTP was nearly done cooking
 
@FredOverflow maybe never ;)
 
11:56 AM
dat meme
 
Xeo
ahahaha
 
my screen
is full of image macros
 
Xeo
@TonyTheLion And a Haskell logo
 
MemeKitty
 
Too much image; too little content.
 
11:58 AM
haha
 
Cheers puppy - you may have saved my eyesight.
 
and robot, I am surprised at you; you keep hating on other people posting massive images with small captions
 
@TonyTheLion I bet it's with nasty white rum though
 
@Xeo yes, why? who else?
 
11:58 AM
@DeadMG Hey, I noticed that and made it smaller!
 
@FredOverflow you troll :P
 
¬_¬ stop all the memes
2
 
Sure.
 
@thecoshman That's a good one :)
 
Cya later all.
 
11:59 AM
@FredOverflow change it to a link
 
Sunglasses work OK.
 
Xeo
@ArneMertz FredO, Martinho, I, sbi, bamboon, Johannes, and prob more that I forgot
 
@R.MartinhoFernandes TBQFH, I wouldn't have acted against one or even two, but the sum total was just way too much.
 
@Xeo Robot isn't German, he only lives there
 
@Xeo The robot isn't German, you numpty.
 
11:59 AM
@FredOverflow you're welcome
 
Xeo
He'll soon be assimilated.
 
even I know this
 
Xeo
It's just a matter of time.
 
@Luc what's your policy for adding the result_of namespace protocol for some function? Any and all things? As-needed? Something else?
 

« first day (930 days earlier)      last day (4019 days later) »