« first day (1443 days earlier)      last day (3506 days later) » 

6:00 PM
There!
 
6:11 PM
@Nooble C++ mocks C because it doesn't have class
 
@Borgleader <3 I'm overwhelmed by love
 
@Borgleader True.
 
user1804599
We shouls start overloading operator= to check for equality.
 
user1804599
And operator== for assignment.
 
6:14 PM
Just to confuse everybody?
 
user1804599
To help the noobs!
 
user1804599
Somewhere there is a Hotel Manager explaining the problem of disappearing towels to an engineer using a memory leak analogy. — leebriggs Jun 23 '11 at 6:55
 
user1804599
lol
 
user1804599
@MohammadAliBaydoun I thought it was Ballmer. I am disappoint.
 
user3010322
Can I take a static_cast and, like
 
user3010322
6:22 PM
make it a function pointer?
 
user3010322
int(* int) fun_ptr = static_cast<int>;
 
user3010322
Something like that
 
user1804599
No, you cannot make a static_cast into a function pointer.
 
user3010322
(Ignore the bad syntax)
 
user1804599
6:23 PM
Just ask what you want to ask.
 
what have you been smoking?
 
user1804599
If you don't know what you want to ask, don't ask until you do.
 
user3010322
I just wanted to know if it was possible to let the user control the casting mechanism for this function
 
user1804599
What function? What casting mechanism? What user?
 
user3010322
e.g. by doing a void das_work( ..., Fx casting_func = static_cast<int> );
 
user1804599
6:25 PM
Oh. Use a lambda.
 
user1804599
6:35 PM
struct t { int x; void open_doors() { } }
t bay;
bay.open_doors(); // open the POD bay doors
 
bae.open_doors();
 
Xeo
We've got quantum teleportation, self-driving cars and bendable phones. We're officially in the future now!
 
user1804599
What do you need cars for if you can teleport?
 
user3010322
Oh.
 
user3010322
I didn't realize I could cheat.
 
user3010322
6:46 PM
But I'm not sure if I like this cheat.
 
user3010322
Essentially, I can define as many constructors as I want BUT
 
user1804599
boost::lexical_cast is best cast.
 
user1804599
std::best_cast
 
user3010322
I can keep pod-ness and unionability by just doing my_thingy() = default;
 
user1804599
You don't want unionability.
 
user1804599
6:47 PM
You want boost::variantability.
 
user3010322
So I can have a type with lots of constructors, but also have the ability to define a huge array with a no-op default constructor.
 
user1804599
You can also write good code.
 
user3010322
That too.
 
user3010322
But it means I can make my Vector2/3/4 behave pretty much like aggregate types and PoDs.
 
user3010322
Vector2 v; // garbage
Vector2 v{}; // zero-init
Vector2 v{ 2, 2 }; // constructor call
 
user3010322
6:50 PM
Debating as to whether this is a good idea or not...
 
user1804599
I like Vector 2 v(); // function declaration.
 
user3010322
Still, I feel like my entire class needs a rework.
 
user3010322
I also need a concept for is_range and is_not_range
 
user3010322
So I can have functions that just forward a one-element cycling-range to the range-based function when handed a not-range (e.g., a single T).
 
user3010322
Agh.
 
user3010322
6:56 PM
Goddamn std::enable_if.
 
user1804599
@ThePhD Terrible API.
 
user1804599
Don't do shit like that.
 
user3010322
Why would that be terrible?
 
user1804599
Don't special-case non-ranges.
 
user1804599
Special cases are horrible to deal with in generic code.
 
user3010322
6:58 PM
It's not an exception; it's consistency.
 
user3010322
It means my_func( 1 ) handles the same as my_func( { 1 } ) or my_func( { 1, 2, 3 } )
 
user3010322
E.g.: it's always expanded to be a range.
 
user3010322
That's consistent externally.
 
user1804599
What if I want to pass a range of ranges?
 
user3010322
?
 
user3010322
7:00 PM
my_func( { { 1, 2 }, { 3, 4 } } ) ?
 
user1804599
If my_func(1) is expanded to my_func({1}), then my_func({1}) should be expanded to my_func({{1}}). That would be consistent.
 
user3010322
No, that doesn't make any sense. We work with the element_type of a range: 1 has no element type, so it would just error.
 
user3010322
{1} already works fine. {{1}} also already works fine.
 
user1804599
You just said my_func(1) would be the same as my_func({1}).
 
user1804599
I.e. not an error.
 
user3010322
7:02 PM
Yes, because I'd be adding that consistency-patching with the automatic expansion to the one-element range.
 
user1804599
You mean inconsistency-introducing.
 
user1804599
Expanding only some (look at that word) inputs makes it inconsistent by definition.
 
user3010322
Mm.
 
Man, writing C++ Mozilla code must be painful (developer.mozilla.org/en-US/docs/Using_CXX_in_Mozilla_code)
 
> Use decltype(nullptr) instead of std::nullptr_t.
Are they trying to compete with Google for the Worst C++ Style Guide Award? I mean, Google is still leading in that category, but this looks pretty close.
 
7:15 PM
They're pretty close yes
 
I don't know what I'm supposed to do.
 
user1804599
Cuddle me.
 
@Griwes don't care too much for that one. Only rarely I need std::nullptr_t.
 
@StackedCrooked I quoted that just for its silliness.
std::nullptr_t is literally decltype(nullptr), lol.
 
I have Bourbon on the left, with a terrible grid system. On the right, we have bootstrap with an unnecessary huge footprint + makes for terrible markup, but is functionality full.
And in the middle we have this young small frameworks, often so mediocre they seem to take the worst of both worlds.
@rightfold I'm not sure.
 
user1804599
7:20 PM
Fuck you.
 
I mean it would be awkward.
That's all.
Don't take it hard.
 
So I went to a download repository.
> lzma-4.32.7.tar.lzma (268 KiB)
WELL, THAT'S VERY HELPFUL.
 
what's helpful?
 
user1804599
@Sofffia Why?
 
Because I've never cuddled anything that wasn't a cat.
 
7:22 PM
To get LZMA, I have to use LZMA.
 
user1804599
About time, then.
 
And also because I'm hetero
 
user1804599
And I'm a woman, so that's good!
 
Yeeeeah... about that...
I think we have different meanings for "woman".
 
user1804599
:')
 
7:24 PM
That doesn't change the fact that I love you.
Also, did LRiO stop being an idiot?
Can I unplonk him?
 
user1804599
No idea; I plonked him too.
 
Yeah, he did.
 
user1804599
Oh my god Python 3.5 :drool:
 
user1804599
> iglob() and glob() now support recursive search in subdirectories using the “**” pattern.
 
user1804599
FINALLY
 
7:26 PM
:drool:?
 
user1804599
 
It's not in here, so it doesn't count.
Also inb4 bin
 
user1804599
lol :a2m:
 
^ Akame ga kill :D
 
3
A: Bootsrap 3 and mmenu

zessxThis can be done without mmenu, adding a bit of CSS. I would suggest you to create 2 differents nav : A .navbar.navbar-fixed-top for -sm, -md and -lg devices A .sidebar-offcanvas for -xs devices See this Bootply for a working example, based on Offcanvas template. Commented example : <!-- C...

Hey! Nice Markup
:butt:
 
Xeo
7:35 PM
@StackedCrooked hehehe, Boris
hehehehehehe
 
Xeo
I hope you don't like him :3
 
@StackedCrooked Is the syntax highlighting broken? Neither static_assert nor decltype are highlighted.
 
It's not broken. It's simply outdated.
 
user1804599
The excuse to every bug.
 
7:49 PM
Yep :D
 
@StackedCrooked Is it that hard to simply add some keywords to the list? ;] It's not that many, really
@StackedCrooked Hold on, wasn't Coliru brought into existence after C++11 was published?
 
user1804599
@Loopunroller He didn't implement the syntax highlighting, you fool.
 
@rightfold I'm not a fool :'( I figured that out myself btw.
std::tie(std::ignore) = std::make_tuple(rightfold);
There you go
Now you know how it hurts
 
Xeo
I don't think he cares.
 
user1804599
7:58 PM
I couldn't give less of a shit.
 
Neither do i. I'm just bored.
 
user1804599
 
user1804599
Great song.
 
@Loopunroller TIL about std::ignore.
@rightfold You have my support.
 
Xeo
Damn, I need the next Koe no Katachi chapter. this is killing me.
 
8:08 PM
@Xeo never heard of it. but it seems to have a very high mal rating
 
Xeo
It's great.
 
@StackedCrooked What is a mal rating
 
Rating on myanimelist.net.
 
@StackedCrooked TIL about MIL
 
@Loopunroller you are almost there
 
8:21 PM
@AndyProwl here's an SO guy writing a Pascal compiler using LLVM: github.com/Leporacanthicus/lacsap
 
@TemplateRex Interesting, thanks!
Is it Mats Petersson?
 
@AndyProwl yes, Mats
@AndyProwl btw, I googled him while he was commented on my latest Q, could use your help as well
 
@TemplateRex ok, let me see if I can help
 
2
Q: Can refactoring an overloaded operator into a non-member function break any code?

TemplateRexConsider a legacy class template with overloaded addition operators += and + template<class T> class X { public: X() = default; X(int v): val(v) {} X<T>& operator+=(X<T> const& rhs) { val += rhs.val; return *this; } X<T> operator+ (X<T> const& rhs) const { return X<T>(*th...

 
@TemplateRex short answer: yes, it changes behaviour. any change in behaviour can break code. Easy really
Oh you specifically mean ABI. So, that's not breaking code at all really. It's breaking binaries
 
8:28 PM
@TemplateRex +1ed, but I can't really think of a situation that would be broken by that refactoring. It may have issues with ADL. You might want to ping Johannes for this
From the top of my head, I can't answer it
Well, unless somewhere you explicitly call X<T>::operator +=
that will no longer work if you make it non-member, I guess
on the other hand, calling operator += with member notation is pervert
but you may be doing that in some type trait for determining its type
in short: no idea
 
user1804599
It's C++ so it's already broken.
 
@sehe @sehe updated the Q. For background info: this concerns a rewrite of <bitset> where I am trying to move operator== and a bunch of others out of the class. Anyone including <bitset> should recompile. Can that break anything?
@AndyProwl no explicit operator calls, that code is totally nuts, why overload in the first place :-)
 
@TemplateRex Always. It can even break things if you do recompile. The behaviour changes (unless they were static friends declared inline)
 
@TemplateRex actually, I wrote "you" but it could be "one of your users"
 
@sehe with breakage I mean a + b evaluates to something else because it drags in another operator+ from somewhere
 
8:34 PM
(the specific code that will change is code that invokes the now-non member operator after an implicit conversion of the LHS)
@TemplateRex ^^
 
@sehe yes, that's a good one
 
I think it's the only one. Maybe I'm missing the exceptionally devious ones due to ADL
@TemplateRex So are you interested in this one? I should post it then :)
 
@sehe it's evil code, e.g. anyone using class Y with operator X could break my code
 
that's not really evil though. There's lot of legit uses for this.
 
user1804599
8:37 PM
leJIT
 
user1804599
I want a teddy bear.
 
@sehe ok, so someone has class Y: public X, and wants op+(Y, Y) and mixed versions op+(Y, X) and (X,Y)
still, that should never call my op+(X, X)
 
user1804599
lol
 
user1804599
You did that very quickly.
 
8:40 PM
@rightfold for a sec, i thought it was going to show the puppy
 
user1804599
> YourMomLLVM.gif
 
@rightfold I didn't
 
user1804599
Who did?
 
I did
 
user1804599
 
8:41 PM
I guess the "very quickly" part is the trick
 
user1804599
Why do sports people offer a hand to their opponents? As in helping them stand up when they're sitting.
 
@sehe and yes, I'd appreciate an answer, specifically in when outside code with implicit conversion operators can hijack my own operator+
 
user1804599
Is going from sitting to standing that much work on one's own? :v
 
Sep 7 at 22:44, by sehe
That took some stumbling. But between GIMP, transparancy, unoptimize and me it worked out in the end
@TemplateRex it's not about hijacking. It's just the the non-member version becomes appropriate in more cases. If anything, you'd be doing the hijacking. And in most cases where it matters, I'd really expect ambiguous overloads
 
8:45 PM
 
user1804599
@TemplateRex "ARE YOU HURT?!"
 
not always!
 
user1804599
> bilder.bild.de
 
Xeo
BILD is a (terrible) "news"paper
 
user1804599
afbeeldingen.afbeelding.nl
 
8:46 PM
@rightfold no according to the goalkeeper (Van Breukelen) he said to the player (Mattheus): "ich hoffe das du fucking stirbst"
 
user1804599
Ah, I see. I'd say that too. Fuck football players.
 
Euro 1988, germany-netherlands, 1-2
 
@Xeo Mahouka isn't very exciting anymore. Although I like this girl and the ending song.
 
Xeo
Best episode. Material Burst and Scorched Halloween ♥
 
yeah, that was kinda cool
 
Xeo
8:49 PM
I like having an OP protagonist once in a while.
 
@TemplateRex one should commend his German in the heat of the moment
 
@rightfold the funniest sportmanships story was when Arsenal played some other UK team, and Kanu and Overmars scored a goal after they regained possesion after an injury break. The crowd was outraged and the match replayed.
 
user1804599
@Xeo A faggot protagonist?
 
@sehe it was a heated night indeed
 
@Xeo what, a One Piece protagonist! where?
 
8:50 PM
Koeman wiping his ass with Thon's shirt
 
Xeo
welp, time for sleeps
 
user1804599
Yup, a faggot protagonist.
 
@rightfold lol
 
user1804599
 
8:52 PM
Anyway, time for some Higurashi no naku koro ni.
 
user1804599
lol, fail
 
user1804599
@StackedCrooked Wat een taal. Gekke jappen.
 
user1804599
There's probably some Japanese guy somewhere saying "baka oranda-jin" all day.
 
Xeo
aw fuck. I missed an auction for the first Genki book :< It ended at around 9pm today, and I even set an alarm for it
 
user1804599
8:58 PM
 
user1804599
Most awesome logo ever.
 
Xeo
why is that book series so expensive here, anyways...
 
@TemplateRex oh, ehe. Dunno what I've been seeing differently while writing the answer, but it does turn out that the implicit conversion is not considered when the LHS is not by value (?). For fair comparison, I should of course assume LHS by & or const&. (See my deleted draft answer)
I'm a bit stumped because I didn't anticipate this, and I also think I've seen a different resutl in testing (could be I didn't spot a broken build and just used the output of the last working one). So... maybe this particular scenario is false alarm
@rightfold you kept losing it
 
evening
hows Mr. Polar Bear?
 
I'm alive
 
9:11 PM
me too
 
cool
 
I am also theoretically alive
 
and practically?
 
unknown
 
undefined
 
9:13 PM
he's dead
 
he's in limbo
neither alive, nor dead
 
nah he's not a cat
 
9:19 PM
I hope it has a happy ending.
 
Xeo
Great success... my neighbours above me have their window open and are screwing like rabbits
 
@Xeo At least somebody has sex...
 
@Xeo record them and embarass them to death
That might not work
 
@Xeo OTOH, statistically, it should not last much longer than 15 minutes.
 
oh well. statistics don't mean much for the outliers. If they're at the point they "forget" about windows, they're likely to go on all night
 
9:31 PM
ah crap, I forgot if I took my pills tonight or not.
 
happens to me all the time
actually, let me take the pills
 
9:50 PM
@Puppy we had my grandma-in-law over for the weekend. She has this handy organizer system with individual containers in box. Works like a charm. She's 90
 
Ell
10:06 PM
@xeo knock on their door and tell them you heard something and thought someone was hurt
And then offer your services to help
I landed, I'm alive!
 
@Xeo Yell "FINISH HER" as he's about to come :P
in your best MK voice
 
That'd be "FINISH HIM", no?
 
Ell
Hahah
Depends who you're cheering on :P
Or more likely, it depends on if he's up to the job
Also fuck ryanair
Delays both ways
Delays disembarking
Delays embarking
I guess its probably Stanstead's fault
 
for a minute I thought you said it was the Standard's fault
 
Ell
Haha, it isn't so far reaching
 
10:25 PM
cool
 
hi
 
hey
@Rapptz THANK YOU SOO MUCH
 
hm?
 
@Rapptz Thanks to you, I learned about Project Euler!
 
Oh.
No problem I guess
PE is fun.
First 100 problems are easy though.
 
10:30 PM
I don't think that PE is an especially useful tool
 
Not that easy to me though...
 
@Puppy Is that supposed to be a pun on 'Packet Editor' also being 'PE'?
 
no.
I've never heard of that.
 
I see.
 
the only other expansions of PE with which I am familiar are mostly irrelevant.
and the last one would not make for a funny joke
 
10:32 PM
Well.
Project Euler is a site, not a tool.
 
it's a site that people try to use as a tool to enhance their programming activities, as far as I've observed.
I guess that theoretically you could solve the problems recreationally or something
 
I've solved a good chunk of the problems on paper.
Project Euler has taught me some stuff about programming.
It's just a different domain
 
if you solve them on paper how could you know whether or not they run in reasonable timeframes?
 
Not really a requirement?
I don't get the question.
 
your supposed to be able to do them in under a minute
 
10:34 PM
you could bruteforce every problem on PE.
the whole point is that the resulting program should execute in a reasonable timeframe and the naive approaches never do.
 
Unfortunately
They removed the 1 minute FAQs
 
user3010322
Quuuuuestion.
 
lemme pull them up on archive
 
user3010322
template <typename T, ulword n, typename TArith, typename = typename std::enable_if_t<!std::is_same<unqualified_t<TArith>, RVector<T, n>>::value>>
RVector<T, n> operator * ( TArith&& right, const RVector<T, n>& left ) {
	return left * right;
}
 
user3010322
^ That's the proper way to trigger a std::enable_if on a Universal Ref, right?
 
10:35 PM
still
even if you correctly programmed solutions that execute in the minimal time
 
@Rapptz I'm struggling on completing problem 3 on Project Euler. I
 
it's still just implementing random mathematical algorithms instead of cracking on with more important issues like reliability, maintainability, and scalability
 
Does it matter if it takes more than one minute to solve?

Of course not, but that should provide the impetus to return to the problem and see how you can improve your approach. But remember that once you've solved a particular problem you will be able to access a thread relating to that problem and it is here that you may be able to pick some tips from others that have solved it.
 
I'm a begginning programmer and barely finished Algebra. I read that reading a book on Number theory would be a good idea. What would you recommend so I can solve these problems?
 
beginning
 
10:37 PM
don't waste your time
 
Don't listen to puppy.
 
find some problems that are more useful/difficult to solve
 
cough sha cough
 
@Puppy How well would that go if I'm struggling on problem 3?
Geez
 
@Chantola Doesn't matter, they're totally different problem domains.
 
10:38 PM
@Puppy That's because Project Euler is not 'Software Development'.
 
and hence of highly limited value to anyone who is a beginning programmer or seeking to enhance their programming skills
 
Nor was it ever advertised to be teaching you software development
 
@Puppy I want to understand multiple ways of thinking and creating in C++
I'm going to be working in software development
but before I do, I want to understand how to create functions and working with mathematical problems
 
@R.MartinhoFernandes I ... think ... the joke is to ruin the fun for him, by suggesting him a failure to satisfy her :/
 
yes, but it doesn't really matter that much what you want to create.
 
10:39 PM
I want to think in a different way.
 
You should
 
I want to experience both sides to programming
and I want to create my own mathematical programs.
 
There are only sides?!!!11
 
what do you mean, "both sides"?
 
Mathematical programs, that must mean proofs or derivations
 
10:42 PM
like I mean the side to mathematical functions and the other side to software development
I think that it would be highly beneficial to anyone.
 
that side doesn't really come into it
 
I'm working on Project Euler, and I'm struggling to complete Problem 3. I heard that reading a book on Number theory would be a good idea. Is this good advice, and what else should I do to understand and work with these problems more?
 
Project Euler would help you create algorithms to solve problems and improve your mathematical thinking. There are no cons to it, really.
It doesn't teach you software development things like testing or if it's maintainable because they're 'one-shot programs'.
But that's not a bad thing by itself.
Being a programmer involves having some mathematical induction and knowing how to form your own algorithms for problems that software developers work on.
 
Exactly why I want to do it.
 
> You hate me? Goodness. And you seem quite certain that my use of assert is incorrect. What do you mean, the entire program state is irrevocably suspect?
 
10:48 PM
this was asked 4 days ago and has close to 200k views!
 
well, he's wrong.
although my fury would be better pointed at the LLVM devs.
 
Well. That's so interesting.
 
@Rapptz That doesn't answer my question though.
 
@OMGtechy wait. tom_mai was back? I think I saw him first in ~jan'12 - in a wave of bad C programmers (LearningC comes to mind)
 
I didn't read a question
I was just replying to Puppy's nonsense
 
10:50 PM
Would anyone like to reply to my question...
 
no.
 
Heaps
 
I should really get a macro or a quote or something for that.
maybe a flashing gif.
 
Number Theory won't help you on #3.
Well it would
 
lol..
 
10:51 PM
but reading an entire book is kind of overblown
Just read about prime factorisation on google
 
isn't that NP-Hard?
 
no
there's just an unsolved problem if it could be done in polynomial time
 
@Rapptz I've been staring at the screen for hours, and I understand prime-factorization thoroughly, I just don't get how I can create a program that's not brute-forcing it.
and the brute-forcing works on paper, I just can't develop the correct syntax for it.
 
@Chantola There aren't any programs that don't brute-force it. There are no known polynomial-time algorithms.
 
@Puppy I think the main difference is that you appear to assume that asserts are merely there for checking pre-conditions, so a failure means programmer error in the particular call. I think Eric means asserts are also there to detect UB droppings. E.g. general memory corruption breaking invariants. The invariants need not have much to do with the calling site, just sanity checking.
And yes, I think this makes sense both to trap breaking changes under test and because it will be possible to get very very well hidden UB traps in C++ for at least a decade to come. And this includes your arrogant coder code. If you don't see this, I'm not sure I want to touch your code.
 
10:56 PM
@sehe No, I think it's the other way around. I'm explicitly arguing against using them in any condition that does not directly mean process-breaking damage has already occurred, such as memory corruption. I'm all in favour of asserting on memory corruption.
 
user3010322
This is really annoying.
 
user3010322
Why doesn't std::enable_if proc directly?
 
Yeah the only way to do it is to brute force it.
 
user3010322
The compiler output says my std::enable_if is false, so it shouldn't be considered for overload resolution.
 
Why do you even need enable_if there?
 
10:59 PM
@Puppy Okay. I think it's not worthless to prepare for the inevitable. How are you going to sail a huge ship when you don't care about hull breaches when they happen? Titanic wants you as their captain
 
user3010322
@R.MartinhoFernandes Because the function is taking a universal ref, and I need it to not swallow up everything in existence.
 
@sehe I do care about hull breaches. But if you're writing a library, you have no idea what hull just got breached, by how much, or where, and what the correct response is, so I think it's hard to argue that "Everybody immediately abandon ship" is the correct response.
 
What about don't?
 

« first day (1443 days earlier)      last day (3506 days later) »