« first day (978 days earlier)      last day (3970 days later) » 

12:00 AM
if you try to build the ALL_BUILD thing that CMake comes up with, then you'll build far more than you need
 
@CatPlusPlus I wrote a handle too a while back, that behaves perfectly for value-type based handles (HANDLE, GLid, etc.)
@DeadMG Oh, well then I might be okay. We'll find out.
 
@ThePhD You usually don't need to clone handles.
 
Inb4 C++17 Rule of 7
QUANTUM CONSTRUCTORS
 
Destroy all universes in which the number of objects is not equal to current_object_count + 1
 
12:03 AM
@CatPlusPlus Buuut you do need to move them. :D
 
@ThePhD why would you need to move it? It's a pointer.
 
Move on primitives doesn't clear the source.
 
user image
11
@rightfold, ^ you
 
user142019
Awesome.
 
12:10 AM
Yeah the idea is to make them not-valid.
 
You know what, fuck move constructors
 
user142019
Rainbow Dash: Dutch Edition
 
@Jeffrey lol
 
C++ primitives are useless, more at 11.
 
@CatPlusPlus why?
 
12:11 AM
Because not doing that breaks the invariants.
 
There we go, now I'm just taking a pointer to the buttons to add to the Menu/Bar/Window classes
fuck moving, it's making the code less maintainable
 
More likely your design sucks, but hard to say with no code. :v
 
;c
Yeah, likely my design
 
Moving should be effort-less on levels higher than resource primitives.
Those classes you mentioned are very unlikely to be resource primitives.
 
Night everyone. :)
 
12:23 AM
Menu is pretty much vector<TextButton> and a few other simple members
 
Are you wrapping some existing UI system?
 
No, I'm making one :p
 
So what's the problem?
Just default move ctors.
(And copy ctors and assignment ops.)
 
I'm going to hit myself
Because default move ctors actually is the solution to that problem >.<
Why the fuck was I defining them anyway? D:
 
30 mins ago, by Cat Plus Plus
Follow rule of zero.
 
12:26 AM
Follow? No, I will make it my God
 
@Magtheridon96 wtf we all said that half an hour ago
 
Yes, now we both agree that I'm stupid
 
user142019
Me too.
 
user142019
So more than both.
 
user142019
Like, troth.
 
12:27 AM
Now switch to C#.
:v:
 
a vector<User>
or better yet, a list<User>
 
Don't use std::list.
 
I never use it
 
There's little reason to use it.
 
but I'm saying a list<User> should likely be used to describe the users that think I'm stupid
because it can theoretically hold more Users than a vector since it doesn't depend on contiguous memory
 
user142019
12:29 AM
std::list is slow as a dog. std::vector will run circles around std::list, because std::vector is cache scale.
 
;______; I hate myself ;______;
 
user142019
Don't worry, you're not the only one who hates you.
 
In 64-bit world contiguous memory is not a problem ever.
 
Even with 64-bit integers, Jon Skeet's rep overflows
 
user142019
What is User?
 
12:31 AM
A pile of miserable interactions.
 
user142019
I can't imagine why you would have a type named User in a UI system.
 
I don't
 
user142019
Then you cannot have std::vector<User> since the first parameter to std::vector must be a type. :v
 
I used std::list once because of std::vector iterator invalidations
so - how to deal with it
 
12:33 AM
I'm trying to create an anecdote ;______;
class User is a theoretical class
 
user142019
@milleniumbug Use a decent language instead.
 
user142019
Problem solved!
 
And I'm referring to the fact that I hate myself and I think I'm stupid
 
@rightfold I actually like C++ (maybe stockholm syndrome, whatever)
 
and the people who agree with me on that wouldn't even fit in a vector<User> on a 32-bit machine
 
user142019
12:34 AM
@milleniumbug How long have you been using C++?
 
Not long - four years
 
How many other languages do you know?
 
depending of degree of "knowledge"
used PHP for some time (3 months), python as a nice language, learning D
 
@milleniumbug std::deque may be an option.
 
user142019
 
user142019
12:37 AM
This theme is horrible.
 
Super Gay
 
you're horrible
 
I love it
 
user142019
Also the font rendering hurts my eyes.
 
@LucDanton std::deque is nice - and now that I consider the requirements of the type - it actually could fit
but didn't use it because at first I thought I required stable insert everywhere
 
12:39 AM
Sometimes you can reserve a vector at well known points and avoid invalidations though.
 
std list?
 
@milleniumbug Oh sorry, I may have been misleading. std::deque does invalidate iterators -- it's pointers/references that are 'stable'.
 
oh nvm just read discussion..
 
@LucDanton Oh.
 
welp, looks like another long night
 
12:42 AM
If you need to keep iterators, then you probably should be using a map instead of a sequence.
 
Do you have an std::map?
 
@rightfold theme hotdog...
 
Because I was lost in your code ~~ <3
 
@rightfold Needs more neon green.
 
79
Q: Iterator invalidation rules

Lightness Races in OrbitWhat are the iterator invalidation rules for C++ containers? Preferably in a summary list format. (Note: This is meant to be an entry to Stack Overflow's C++ FAQ. If you want to critique the idea of providing an FAQ in this form, then the posting on meta that started all this would be the plac...

 
12:45 AM
@CatPlusPlus or, a tree-based-sequence-container
 
@CatPlusPlus std::map could actually fit my requirements
once again - came up to the conclusion std::list is useless
 
hmm. if it wasn't for the null case, std::unique_ptr::operator==() could be implemented as {return false;}
2
 
@milleniumbug it has a very limited set of use cases but yeah, pretty much just use vector.
 
Intrusive lists are just better
 
@MooingDuck erm no.
p == p
 
12:50 AM
@R.MartinhoFernandes oh right, takes by reference, so *this==*this....
@R.MartinhoFernandes oh well
 
@MooingDuck eh
@MooingDuck ah
 
> Optimizing compile-time performance by caching metafunctions
sounds like the name of a paper
 
@Rakkun Hey. What's up?
 
user142019
foo
 
user142019
 
12:54 AM
@R.MartinhoFernandes You did it wrong. You should have said "pong" :)
 
@R.MartinhoFernandes NaN semantics for everything!
 
user142019
NaP
 
lol didn't notice Catpp said that
 
user142019
I noticed.
 
arggh i dont understand SFINAE T_T
 
1:04 AM
Oh hey, I earned a badge for getting stars
That makes me feel so much better about my shitty self
 
user142019
@Borgleader template parameter substitution fails so overload is ignored.
 
I know what it means, what I meant is I'm trying to use it and it's not working
and I dont understand why
 
@Magtheridon96: And if you'd written that on one line then you might have got another one
 
    CloseDesktop(OpenDesktop(L"HiddenDesktop1",0, false,AccessRights));
	int err = (int)(GetLastError());
This returns 0 for success, but my desktop doesn't close :( why?
 
@CCInc Nice testcase. Very complete.
 
1:08 AM
I found my IRC quote database from forever ago.
 
@CCInc You forgot to tell us what these functions and variables are and do.
 
Nostalgia.
 
Ah. CloseDesktop and OpenDesktop are part of the WinAPI. "HiddenDesktop1" is the desktop I want to close. err is the error message.
 
there is still nowhere near sufficient information to reliably solve your problem for you
present an actual C++ program
 
@LightnessRacesinOrbit I always make the mistake of dividing my messages into multiple lines ;_;
 
1:10 AM
CloseDesktop closes the handle.
 
Versus the actual desktop?
 
@CCInc Probably not.
 
Ah.
1
Q: How can I delete a Win32 desktop with running programs, and terminate those programs?

user95644I have this code: #define _WIN32_WINNT 0x0500 #include <cstdlib> #include <iostream> #include <windows.h> using namespace std; int main(int argc, char *argv[]) { HDESK hOriginalThread; HDESK hOriginalInput; hOriginalThread = GetThreadDesktop(GetCurrentThreadId()); hOriginalInpu...

 
@Magtheridon96 so
@Magtheridon96 do I
 
user142019
haahha
 
user142019
1:17 AM
old /b/ again.
 
user142019
Metal Gear Solid 4 is awesome.
 
1
A: warning C4018: '>' : signed/unsigned mismatch

Magtheridon96Assuming my_size is defined as an int, you can fix this by changing its definition to unsigned int. A size can't be negative, why make it signed? (std::vector::size and the like return unsigned types for a reason)

Halp me fix my error
<posts full code>
 
0
Q: HTML: Where is the "shared" folder?

xiaodaiI am trying to learn some Javascript so I used the view source function in Chrome to view the HTML source of the page I am looking at. There is some reference to script files such as <script src="shared/jquery.js" type="text/javascript"></script> I wonder where is this "shared" folder that sto...

 
1:32 AM
@LightnessRacesinOrbit Semi-colon fetish
 
1:51 AM
argh
wasting an ridicilous amount of time by trying to acces a &object for an operator overloading
 
@Magtheridon96 @MooingDuck ty for your help earlier :)
 
@Aboutblank <3
 
inline bool operator==(const student& lhs, const student& rhs){
if (((student&)lhs).getMatrikel() == ((student&)rhs).getMatrikel())
return true;
else
return false;
}
I don't understand why people are saying that *pointers are harder to read than &references
 
@JerryCoffin I just got off work so I can discuss this. You got a place and time in mind for tomorrow?
 
@klyonrad Urgh, that code.
So many things wrong with it.
 
user142019
1:59 AM
@klyonrad because you always know that a reference is not null.
 
user142019
Which is a giant hint.
 
user142019
Also don't do C-style casts.
 
user142019
> If you write C-style code, you get C-style bugs.
2
 
@klyonrad I love your if/else statement.
 
I'm not sure if C-style bugs are worse than C++-style bugs.
 
user142019
2:01 AM
I think they're both equally terrible.
 
depends on the bug
 
user142019
Haskell-style bugs are great since they're at compile-time. :3
 
so how should I cast that?
 
user142019
dynamic_cast<student&>(lhs).matrikel == dynamic_cast<student&>(rhs).martikel
 
yes, that is much more readable.
 
2:02 AM
@klyonrad wtf is this
There are so many things wrong here.
 
user142019
Also wtf if (condition) return true; else return false; just do return condition;.
 
I just made it verbose because I was having a hard time
 
user142019
Also, wait wtf.
 
user142019
You are casting const student& lhs to student&.
 
user142019
Don't do that. That's terrible.
 
user142019
2:04 AM
Don't cast away constness.
 
yeah, getting that error ;)
 
Why are you casting constness anyway
 
user142019
Well, make getMartikel() const. :v
 
Seriously.
 
I used the templates from stackoverflow.com/a/4421719/1796645
 
user142019
2:05 AM
Or just make the field public.
 
user142019
class student {
public:
    martikel getMartikel() const { … }
};
 
user142019
By the way, what is a martikel?
 
@rightfold german word for en.wikipedia.org/wiki/Student_number
 
user142019
OIC.
 
user142019
class student {
public:
    martikel martikel;
};
 
user142019
2:07 AM
:v
 
user142019
No getters = epic win!
 
but isn't the point of OOP the encapsulation?
 
@klyonrad Getters and setters aren't good encapsulation
 
user142019
How are getters related to encapsulation?
 
martikel can be encapsulated itself, and why bother repeating
 
user142019
2:09 AM
YAGNI.
 
well, I don't have a setter - so that the attribute can't simply be overwritten
from the outside
 
user142019
C++ needs modules and lenses.
 
Four years ago, I was learning std::vector, and wondered why there is clear() when there is empty()
 
C++ needs tits
 
and then found out they aren't the same
 
user142019
2:12 AM
clear() changes state so it sucks.
 
My line of reasoning was - "hey, the parens indicate action, there is no action. It should be empty"
 
@milleniumbug They.. do different things?
 
@Rapptz Yes?
 
@milleniumbug There is an action.
 
@milleniumbug So.. why were you wondering..?
 
user142019
2:13 AM
@Rapptz He didn't know that because "empty" is also a verb.
 
Oh English.
 
Empty recycle bin?
 
user142019
So if you have a method on an array class called "empty", then it could also empty the array since it's a verb.
 
user142019
The C++ meaning is the adjective, but that may not be obvious.
 
Well, it wasn't for me then
 
2:14 AM
I guess that's legitimate.
 
user142019
A property called is_empty would be ideal, but C++ lacks properties.
 
I wonder
what is the evolutionary function of ballsack hair.
 
user142019
Maybe women like it.
 
user142019
And it keeps your balls warm when it's freezing cold!
 
user142019
Better question: what is the evolutionary function of fucking butt hair?
 
2:17 AM
or armpit hair
 
user142019
or hair.
 
eh
regular hair I can get, because we really do need to insulate our brains
head is the major source of body heat loss, you know
 
wot.
 
plus, it's super-visible so I can see "attract a mate" thing
 
user142019
We need fans and metal heat sinks.
 
2:18 AM
...
 
user142019
@DeadMG ball hair used to be very visible too.
 
user142019
Evolution didn't account for clothes.
 
you sure about that?
it sure did account for cooked food
 
game->getWindow().getWindow()
I should really cut myself
 
We can still eat raw food.
 
2:21 AM
our tongues have a specific adaptation for preferring cooked food
and we think that the earliest systematic cooking was a couple million years ago
 
..No.
 
I'm not too sure exactly how the most primitive clothes were made, but I'm pretty sure it involves the application of fire
 
In order for us to cook food, we need to control fire.
The discovery of controlling fire was about 125,000 years ago -- way shorter than "a couple million"
 
well, since neither of us is actually an archaeologist, the source that I found indicated that they found new evidence in Africa somewhere that it was a couple million.
 
user142019
What is the evolutionary function of disgust for the taste of paracetamol which fucking heals you?
 
2:26 AM
ISTR that paracetamol is toxic and the liver breaks it down, and it's the breakdown products which are beneficial
 
@DeadMG Yeah. They dry animal skin using fire or the heat of the sun.
 
@DeadMG Skinning.
Which we kinda still do today to an extent.
 
@Rapptz I'm pretty sure that most natural skin from a kill would just rot and isn't really useful as clothes unless you treat it
 
user142019
Paracetamol is wonder medicine.
 
@Rapptz "They" not "we"...
 
2:27 AM
and what I'm saying is that I think that the treatment basically requires fire
 
And plant extracts.
 
Nah, pee on it and tread on it for a few hours.
 
@MarkGarcia we => humans
 
Okay...
 
urine contains lots of unpleasant anti-microbial nasty chemicals, doesn't it?
 
2:29 AM
@DeadMG Tanning can involve the sun too :C
 
@DeadMG No
If you're sick, there are microbes in your urine.
 
Urine is usually sterile.
 
@Potatoswatter Aren't there microbes in your urine even if you're not sick?
 
that doesn't really disagree with what I just suggested
 
@Rapptz So is blood.
 
2:30 AM
For a healthy human, it's ~95% water.
 
some microbes can survive virtually any conditions
 
@Mysticial No infection, no microbes.
 
Not all microbes are harmful.
 
you'd think that something like cholera would have found it quite beneficial to survive in urine
 
@Potatoswatter Uh.. no. Not like urine is sterile, it isn't comparable.
 
user142019
2:31 AM
Hahhahaa!
 
@Mysticial The immune system doesn't make that assumption.
 
user142019
I just owned a fucking mosquito!
 
user142019
With a ruler! I rule!
 
did you also own it's sexual partner?
 
@Potatoswatter So what about the microbes that help us break down our stools? Those are beneficial.
 
2:32 AM
@Rapptz Urine is filtered blood. So yes, it is.
 
user142019
Why would I own you?
 
user142019
You're cool.
 
@Potatoswatter There is more to urine that just that, and you should know that.
 
@Mysticial I'm not a doctor, but the immune system is probably not operating at full force inside the intestines.
 
Excluding the usage of pointers, what could I use as a sentinel value for a set of types?
 
user142019
2:33 AM
Are we discussing piss sex? Because shit that seems disgusting.
 
@Magtheridon96 Don't.
@rightfold No.
 
user142019
@Magtheridon96 Use boost::optional.
 
@Rapptz What I know is, I live in a tropical country, and when you get sick you get a urine (and blood) test to see if it's something serious. If you're OK, they point at the lack of microbes.
 
@Potatoswatter The immune system operates mostly on your blood streams.
 
@rightfold oh hey, boost::none could work
 
user142019
2:34 AM
@Magtheridon96 What are you doing exactly?
 
aaargh
I wonder how much weight I'll have to lose before doc recommends me for surgery
 
user142019
If you have a boost::variant, just do boost::optional<boost::variant<whatever...>>.
 
@rightfold I wonder if optional has a specialization for variant.
 
user142019
I don't.
 
@Potatoswatter I see.
 
2:35 AM
@rightfold Upon creating a TextButton, there are a fuckton of things you can do to modify it, be it the color, the outline, the thickness of the outline, the callback, the text, the alignment of the text and a lot of other shit
so my constructor is pretty big :v
 
user142019
So?
 
The most common way that I know of for urine to not be sterilised is if you're taking medicine.
 
@rightfold Why not?
raw optional<variant<T...>> has subpar semantics.
 
and I really don't like spamming .setXXX calls on multiple lines
 
user142019
You're doing it wrong.
 
user142019
2:36 AM
@DeadMG I have more important things to wonder.
 
what's your solution, defining multiple constructors?
because I considered that
 
@Rapptz Medicine which consists of microbes, or medicine which suppresses the immune system?
 
and it seems like it might be fine, but I don't know if it's the best way to do this
 
Typically antibiotics.
 
@rightfold So do I, but forcing it rarely works.
 
user142019
2:37 AM
@Magtheridon96 just the setters.
 
the brain is permanently partly ordered and partly chaotic, and mine definitely trends towards chaotic.
 
@Rapptz That would imply a preexisting bacterial condition.
 
Oh come on :c
 
It's one of the reasons they say not to pee in the water if you're taking medicine.
 
user142019
Your brain is permanently damaged by C++.
 
2:38 AM
The antibiotics aren't adding bacteria to the urine. That's extremely wrong.
 
I doubt that very much
I should add real support for various constant expressions to Wide.
instead of the terrihax I have now
 
@Rapptz Don't go camping if you already have a fucking bacterial infection. You're missing the bigger picture here.
 
I.. have a MSc. in Biomedical Science :|
 
user142019
I have a high school diploma.
 
Incidentally this is the first time I've brought up my degree.
 
2:40 AM
I have nothing
 
@Rapptz And you're telling me that taking antibiotics causes urine to contain bacteria?
 
No.
 
As in, not taking the antibiotics would have caused the bacteria to be absent?
 
Get out the popcorn.
 
user142019
I have a common sense in computer science.
4
 
2:41 AM
@Potatoswatter FWIW some antibiotics do indeed inhibit growth of bacteria.
 
user142019
And an employer screaming for me to come back.
 
@Rapptz If you mean inhibit yes, the whole point is to reduce their numbers.
 
Typo.
@Mysticial ?
 
user142019
I wonder how difficult it is to write an Erlang node in C#.
 
@Rapptz Oh, you two were arguing over urine bacteria and antibiotics.
 
user142019
2:44 AM
It has been done.
 
I know what I know and they know what they know. I don't typically bother after 5 minutes unless I find it interesting.
Unrelated but obesity is going to be possibly considered a disease now.
 
Just don't go camping or swimming if you're sick mmkay… that is the best way to avoid getting contaminated urine into "the water."
 
You definitely missed my point there
I meant in the shower
 
FWIW the toilets have water in them over here.
 
@Rapptz Don't pee in the shower because it's disgusting and smells bad.
 
2:51 AM
@Potatoswatter It saves the planet.
 
@LucDanton Yeah same here but I don't see the relevance.
 
Saying not to pee because pee contains bacteria is like saying not to sneeze in the shower.
 
@Rapptz 'Don't pee in the water' left me nonplussed.
 
@LucDanton LOL I misread that as "hot water in them"
which would be awesome
 
@Potatoswatter Shower broken? No problem, just wash your face in the toilet.
 
2:52 AM
but stinky and steamy, maybe not so awesome
 
@Potatoswatter FWIW peeing in the shower isn't inherently wrong aside from that one point.
 
eh
 
Think of all the monkeys in the rainforest. They need your pee.
 
I hate showering anyway
 
2:54 AM
I remember when I was in school we had an argument about if peeing in the shower is as bad as people make it.
 
@Rapptz what was the consensus?
 
I think I'd be much more interested in what he thinks now
 
It isn't bad as long as you're not taking medication.
I didn't care back then and I still don't now.
If I had to pee well then I peed. :|
Bit troublesome to go to the toilet at that point.
 
@Rapptz Because then the toilet would get wet?
 
No. Because I'm wet and it disrupts the flow of the warm showers I take with the cooler air of the outside.
 
2:59 AM
@Rapptz I agree, in the shower is just fine.. pretty much the same drain..
 

« first day (978 days earlier)      last day (3970 days later) »