« first day (452 days earlier)      last day (4482 days later) » 

10:00 PM
@Xaade Can you write recursive lambdas?
 
Erm.. Nobody can, yet?
I know only how to fake that (using local functors)
 
@kbok No?
 
@DeadMG Are you suggesting using a VLA ?
 
@kbok Also statically sized; I think @kbok is after the const vector with mutable elements.
 
@kbok No? Allocate it off the heap.
 
10:02 PM
You could always make it a foo* const and allocate it with new. Yes, it's low-level and a little dirty. But I think it conveys the semantics you're looking for.
 
const unique_ptr<int[]> x = new int[get_some_number()];
 
@Maxpm Yes
 
@DeadMG Mmmm. On second and third though that looks like a very solid approach (I hope the library writers get delete[] right)
 
@DeadMG Well it looks like it's what I'm actually looking for. Thanks
 
well, it's a Standard specialization
 
10:05 PM
@DeadMG § 20.7.1.1.3 default_delete<T[]>
 
Wow. A robber was armed with a needle allegedly infected with HIV.
 
1 Effects: calls delete[] on ptr.
2 Remarks: If T is an incomplete type, the program is ill-formed.
 
That's scarier than a gun.
 
The only drawback is that it requires replacing all instances of x[n] by (*x)[n]
 
@kbok If you can guarantee the lifetime (which you can) you could alias it: T[] &x = *p_x
 
10:07 PM
@kbok No it doesn't, unique_ptr<T[]> defines operator[]
 
@DeadMG Ok.
 
@CatPlusPlus Now the subject demands us to inquire as to the statistics: what are the odds, what is the projected test result and what would be the error margin with that (6 points)
 
About 5% chance of passing, depending on the professor's mood.
 
10:23 PM
Ah. I missed the non-pling reply. So, now we are required to predict the professor's mood :)
 
Outlook not so good.
 
Xeo
10:46 PM
Hm, I'm wondering if the rvalue overloads of operator<< and operator>> aren't kinda dangerous
std::ostream& os = (std::ostringstream() << my_type); would leave a dangling reference.
 
Huh.
Hey, what's it called when you use a lot of really small functions, again?
Split a program up into the smallest possible fundamental parts.
It is refactoring, but I don't think that's the term I'm thinking of.
 
@Maxpm functional decomposition? Just, 'factoring'?
 
@Maxpm dissembling?
 
I don't think so. It was like a programming methodology, like test-driven development.
 
@Maxpm re-factoring is the process of identifying sections of code that are repeated and pulling them out into there own function to reduce duplicated code
 
11:01 PM
Yeah, but, like, obsessive refactoring.
"Taking it too far" refactoring, some would argue.
 
@Maxpm sounds like an anti-pattern to me
 
I think I read a paper or blog post about it, once. It described it as refactoring as much as you possibly can.
 
@Maxpm well, re-factoring makes sense, especially when you have blocks of code that are exact copies. It become's more debatable the more variables the similar code involve
I guess if you took it to the extreme, you would have functions that sole purpose is to work out what other function need to be called. Sort of wrapping up switch statements and the likes. Which admittedly, if you have a particularly complex section of code working out how to handle some input, it might make sense to have it in it's own function
 
11:16 PM
Where's Mr @LucDanton -- here's some template perversity he might enjoy.
Originally I wanted to make a static analogue of std::transform that would take two type ranges <Args..., Brgs...> and match them pairwise to produce something new.
Turns out you can take two type ranges and put them into a binary template, static_convert<Args, Brgs>....
Ouch, just had another C# property post downvoted ... it seems like some people don't like the idea that C++ isn't like C# :-)
 
@KerrekSB type ranges ---> template argument packs?
 
@sehe Yes. But two of them
So like a binary transform
 
@KerrekSB Ah I think I see: you mean you can use to variadic lists and unpack them both at the same time... That is funky. But I'm afraid you'd end up with the Cartesian product of those. Have you checked?
I wouldn't be surprised that if sizeof...(Args) == sizeof...(Brgs) == 4, the number of calls to static_transform<T, T> will end up being 16?
 
@sehe Pretty sure it works: Both packs are expanded in step
@sehe If that were the case, the code wouldn't work when invoking a function with 4 arguments
(but it does)
 
How come... And how did you demonstrate it for yourself? Is there something copy/pastable or IdeOne perhaps?
 
11:26 PM
Proof by lack of compiler error
Sure, hang on
 
Hmmm. I'm still surprised. It is just not how I expected things to work. Lemme read your code again to look for the subtletly inside all those (...)...
 
Sorry for Foo, on my machine I have an elaborate test class with overloaded output operator and all of whose constructors and destructors and assigners print a message.
 
I see. There is only one unpacking request.
And the surprise (to me) is just, that it unpacks _all_ contained variadic arg packs
 
That is blooddy sweet. Let's invite @Xeo for the party
 
11:30 PM
@sehe I thought @Xeo has passed out drunk...
Ah, the static-cast-decay -- that was actually purely out of necessity. I wasn't showing off or anything.
I think it didn't compile without
I'm sure @LucDanton would have abstracted the problem first into an arbitrary-dimensioned self-expanding forwarding combinator of sorts...
Oh, a booboo: The final marshal_and_apply function doesn't determine the return value of Function; it just says void.
 
I wrote a personal statement on my Careers entry
you guys want to review it?
 
@DeadMG Can we up/downvote it?
 
Does it read "I'm a Genius™, and you should consider hiring me as your boss"?
 
"Your boss should consider hiring me as his boss."
 
Xeo
11:36 PM
@KerrekSB Huh?
@DeadMG Does it read "I don't give flying fucks."?
 
no
 
@DeadMG It's very confident.
@DeadMG Check this out:
1259060849127769986518547617451504596713662501322665556307038841145745783066431918114419793039152672193879211888294545729367642623205933642076996372978837560588823462129439911885770229083144106491004734317556187198096981340169830750820714110140410126354109351190833666420168967084693213699632027595615534072
 
what's that and why do I care?
 
Play along, be nice.
 
the decrypt button, it does nothing
 
11:40 PM
Where is it, again?
 
It's too early for that, we're still handshaking. You're Bob
 
right
95433527802691220039293505604215309582443168421426366218089750742994648062416070729964465705858948459849975092458262040745617417593870748807900536689731011157645184775335783374406870512981650855717666652429203027931340863308323043941045580932233427248888381567652114615387826001533532376340885505438960250342
 
Make it with the four spaces so it's all on one line.
Otherwise I think the chat thing introduces some weird characters that break the number.
Does your shared secret start with 368?
 
no
 
11:43 PM
It's at the very bottom, and a long number
 
it says "0"
 
@KerrekSB I like the improved UI. It's still the SecretSexChange though.
 
@KerrekSB Oh hello there :)
 
@MooingDuck Yes, the UI was much improved thanks to... uuh, who was it, Pubby?
@DeadMG Did you paste, press "random" and "done"?
 
yes
 
11:44 PM
@Kerrek the page title and the big header text, they match not.
 
@LucDanton Hi - check out the static_transform :-)
 
try this
62274737506615090314664009402522228022114326570075762311287697272012354554635078975814790421881765897960511588720453354040284014477014896357345059658169996292783783017741804472368716281901260905702913464136350838074381059834987740230280316477185841558479519570272185039975491781267463921170330593054281133895
 
SS starts with 886?
 
yes
 
@KerrekSB I agree with both your solutions that partial specialization is the way to go here.
 
11:46 PM
OK cool. Message:
2998970958404267882509281290764461645795220055533222985133159648950604549987769017726979430039426660831158512483754928127133080467175993131796749726013199572590828032008095834697654124319233814776080388256591932656012177137763981574530955796
 
$LU}„ù?
 
Inspecting the function parameters would me too much of a hassle.
 
@DeadMG Hm, indeed
Wait
There's a length limit I exceeded! Then my Clever Padding Scheme breaks
 
damn those CPSs
 
Continuation Passing Style?
 
11:50 PM
Oh, the form field is just limited in its pastability. Interface failure
 
@KerrekSB what are these seemingly random strings of numbers?
 
@TonyTheLion Sex changing pheromones.
 
Curses! Who put maxlength in there???
(I did.)
 
Should asserts go in class constructors, as well as in the methods that require them?
 
11:51 PM
@Maxpm asserts should go wherever they hold.
 
@DeadMG Can you fix the website on the fly, like with Opera? If not, then please take note of the shared secret and I'll upload a fix
 
no
 
Crap crap crap
One moment
 
@Maxpm assertshould go where you require some post or pre conditions to be checked or something to be asserted
 
On Chrome, "Inspect Element" and manually edit the attribute.
 
11:52 PM
kept the shared secret
 
@RMartinhoFernandes Yes, or Chrome
 
@TonyTheLion Well, yeah. But should I allow people to construct classes with arguments that I know won't work later on?
 
no
fail as soon as possible
 
Mmh.
 
OK, it's up!
 
11:54 PM
Fail hard, fail fast.
 
Oh, you can't actually paste the SS on this page. You can though on the old version.
 
Okay. So I assert in the constructor. Do I also assert in the method, then?
 
@Maxpm why? you've already verified that it passed
 
I know it's checked in the constructor, so I'd be repeating myself. But there are certain semantics that it carries.
 
2920939846201397386646895415146659560752729386826381593333676579319936318278317973688394326839349367365381409068388843121861633886747866634677024472902210588275468166630923647491178156883936007935331206377258308137228705154233775693319129636
 
11:56 PM
@Maxpm asserting invariants doesn't hurt.
Plus, asserts serve as compiler-powered documentation.
 
2844859804464229426569727587529904915560512266158903768352605997637622790343782793464687371955117790386768574622196758748378470173344935811107283276207239368980024085058395597169191326857205670856014348213256507869226010282737023103308625944
 
ok, I got part of that
but it seems to have stopped on ", and "
 
Hehehe, the CPS!
 
You see, I always check with "decrypt", but the field is so short that I didn't see the missing end
 
11:58 PM
@KerrekSB I vaguely recall someone complaining about the fields being too small before. :P
 
270489335285695435982180091910314825072689161540934738816289795403743802267320612797249415738835412670407256450399846835832473307537677961085501951864734837872357623468928737214252816175852068357969330571850133276137453212242377573253139490
@RMartinhoFernandes Quiet. Nobody never complained about nothing.
 
At least make them text areas, so I can resize at will.
 
3259440390220922454404362068866295616157471347599246303419124292618869799047861348782353499676627418175756377897980062220541658003167675792919521491247301386603199163229400508604427613944820535842589113105410285696906603615696683982877640232
@RMartinhoFernandes I don't know how.
I'm not one of those web gurus...
 
2843435379923468658241495278661143043287682696066460656463887248856655322654989330387433974594294892707698025083483340503374135780919931928635375375179182784116541759161272730942076079244060932310183874006081191674712972275225651984693409610
 

« first day (452 days earlier)      last day (4482 days later) »