« first day (788 days earlier)      last day (4160 days later) » 

3:02 PM
@Zoidberg'-- "Constructors are evil" and such? :)
 
user142019
Please somebody come to Rotterdam and throw a grenade at me.
 
user142019
Teacher says that every class has a constructor. He is wrong. Abstract classes have no constructors.
 
Hmm, an operator in an anonymous namespace in the global namespace is not found.
Damn you ADL.
 
Can ADL prevent it to be found?
 
@Zoidberg'-- No, that's wrong. Abstract classes can have constructors like every other class.
 
3:05 PM
@Zoidberg'-- You are wrong. Abstract classes do have constructors. How else could the subclass constructor construct the super object?
 
you simply can't instantiate them directly.
 
user142019
Oh lol wait you’re right.
 
We can still throw that grenade at you if you want.
Constructors do not create objects in Java, they merely initialize them.
 
Just like in C++.
Objects in C++ are created out of their own volition.
 
3:07 PM
@R.MartinhoFernandes Wait, only 13 months till the next C++ standard? :)
 
@FredOverflow 13-24.
 
@FredOverflow Or 24.
 
@R.MartinhoFernandes No, pretty sure a C++ object does not exist yet when the constructor starts...
 
user142019
class foo {
public:
    foo() = delete;
    foo(foo const&) = delete;
    foo(foo&&) = delete;
};
 
user142019
I haz no ctor harhar.
 
3:08 PM
But you cannot have an abstract base class with zero constructors, that would be pretty pointless.
 
user142019
std::numeric_limits?
 
user142019
Or however it’s called.
 
How is that an abstract base class? Are you supposed to inherit from it?
 
user142019
Or is it constructible?
 
struct shorter { shorter(shorter&&) = delete; };
 
user142019
3:09 PM
@FredOverflow oh base class. :P
 
@R.MartinhoFernandes Does that prevent the default constructor?
 
user142019
Today is not my day.
 
@Zoidberg'-- No!
 
Also, std::numeric_limits is a trait, right?
 
right
 
user142019
3:09 PM
I will not claim anything about C++ and Java anymore today.
 
@FredOverflow Declaring any constructor prevents it.
 
You can still claim they suck.
 
user142019
But Java sucks more!
 
They suck life energy.
 
@R.MartinhoFernandes Great. Now just replace shorter with S and we're there ;)
 
3:10 PM
lol
 
@FredOverflow No, that would be the shortest. :P
 
Damn :)
 
@R.MartinhoFernandes Nah, there's some unneeded whitespace in there
 
user142019
@FredOverflow Make struct into class and it’s even shorter.
 
#define s
 
3:11 PM
I guess we should rethink our "Modern C++ should not contain any deletes"... :)
 
@thecoshman Sorry, hat a Skype meeting with the boss … back now
 
@KonradRudolph Picture of the hat or didn't happen.
 
@StackedCrooked "S is the 19th letter of the basic latin alphabet."
 
Very good.
 
user142019
The designers of Greenfoot were really brain dead when they thought it would be a good idea to make World an abstract class.
 
3:13 PM
Greenfoot? Isn't that for kids?
 
Greenfoot? Isn't that a legendary creature that some people claim to have seen?
 
user142019
@FredOverflow I think so. They use that piece of Scheiße to teach us Java.
 
You poor soul :(
 
user142019
GRENADE
 
user142019
School y u no C++ and OpenGL.
 
user142019
3:15 PM
C++ is much easier than Java.
 
I don't think C++ is a good choice for introducing kids to programming.
@Zoidberg'-- I strongly disagree :)
 
Busted! http://math.stackexchange.com/questions/256816/if-n-the-order-of-a-group-and-gcdk-n-1-then-there-exists-an-element-in?__=650705013#comment562583_256816
 
@FredOverflow It's the best.
 
user142019
@FredOverflow Java has stupid unnecessary restrictions. And enums can be null and wat.
 
user142019
static Bag newBag(BagType type) {
    switch (type) {
        case SANDBAG: return new Sandbag();
        case GRAVEL_BAG: return new GravelBag();
        case CEMENT_BAG: return new CementBag();
    }

    /* Java, being a terrible language, enforces us to write a
     * return statement, even when that return statement will
     * never EVER be reached since all possible cases in the
     * switch return. */
    assert false;
    return null;
}
 
3:18 PM
@DeadMG Will you stop being yourself for once and act rationally? Would you honestly consider teaching C++ as a first language teenagers?
 
Shut up, Java enums are actually the single nice feature in the language.
 
@FredOverflow Yes.
 
Please do it once and then tell me how it went.
 
user142019
I want UB on no return in non-void functions, not a compile-time error.
 
You want UB? lol
 
3:19 PM
You're crazy.
 
The sane solution is final switches, like in D or Scala.
 
And silly.
 
UB is like an adventure!
 
user142019
At most a compile-time warning. But geez not a fucking error.
 
@Zoidberg'-- How is what you get different from UB?
 
3:19 PM
hehe
 
user142019
An error while I handled all enum values in a switch, and all of the cases return.
 
He means that UB can manifest in a compile-time error. So if you want UB, you should be fine with compile-time errors.
 
user142019
That’s idiotic.
 
lol, I only now looked at the actual code.
 
hi :)
 
3:21 PM
hi
 
user142019
ohai
 
user142019
How do you pronounce gnzlbg?
 
OMG someone that greeted us with "hi" instead of "here's my homework".
What have we come to.
 
"hi. Here's my homework"
 
very fast and without breathing :P
 
3:22 PM
@jalf You will go to hell for that.
 
user142019
@R.MartinhoFernandes Don’t worry. Everything will be normal again in 2013. :^)
 
Boost.tokenizer is neat.
 
The description says that not annoying homework is not banned tho :P
 
Don't worry, we get annoyed easily.
 
Then I'll wait and see it happen :P
 
3:23 PM
@gnzlbg bring it on
BTW, I just built the project I will be working on (for the 1st time). hell yeah.
 
I've already posted my question, if someone finds it interesting they will answer :P
 
You cannot be real.
 
Damnit, I found two errors in Josuttis' book and wanted to email him, but they were already in the confirmed errata :(
 
Newcomer Y U NO DEMAND INSTANT HELP
 
@R.MartinhoFernandes He is, but not in the direct form. :) (btw, your post would score nicely on 4chan : 6666998)
 
3:27 PM
@FredOverflow have you watched the iterators must die talk? I think the talk starts with an example from josuttis book, quiet funny :P
 
How do you sort a list?
Oh, member function.
 
with your::sort, that wrapps std::sort and list.sort :P
 
@gnzlbg ew.
 
Oh, so boost::zip_iterator is always a lousy input iterator?
Gosh.
 
@gnzlbg I have watched it a long time ago.
@R.MartinhoFernandes Do you mean an std::list?
 
3:30 PM
me too, but i remember that part :P the rest is kind of fuzzy
 
I always try to make my iterator wrappers be as powerful as possible.
 
@FredOverflow I just found the slideshow i believe is from it. Quite funny. "Snout to Tail Length"
"Scruptious Template Lore"
 
@KonradRudolph I was failing at de/referencing :P
 
boost::zip_iterator solves some problems
 
@FredOverflow Why would I take pictures of my boss?
 
3:31 PM
@gnzlbg But it should be transparent in terms of operations provided.
 
When I saw first saw the slides from "Iterators must go" I thought the atmosphere must be been very cool in that room.
 
If I zip three bidirectional iterators I want a bidirectional zip iterator.
I don't want to downgrade to use a wrapper.
 
@R.MartinhoFernandes Only input iterators can return rvalues.
 
@DeadMG That's the standard ones.
 
well if you zip two random_access iterators, you don't get a random_access iterator if that is what you mean
 
3:32 PM
@KonradRudolph read what you said :P and doff you hat :P
 
Boost uses different concepts.
 
how could you?
 
Nov 25 at 16:35, by FredOverflow
> How many Haskell users does it take to change a light bulb? Two, one to change it and one to write a monad tutorial.
still laughing at that one :)
 
It's been over two weeks, man. You should consult a doctor.
 
damn, left my hat at home :p
 
3:34 PM
How can you sleep like this?
 
user142019
Man. How many times it happens to me I have a bug in my C code and it allocates an infinite amount of memory, making my computer slow as fuck due to swap.
 
@Sta
@StackedCrooked the videos are up somewhere
 
@KonradRudolph :O
 
user142019
Isn’t there some tool that allows me to limited the amount of memory a process may allocate?
 
@Zoidberg'-- sandbox
 
3:35 PM
@gnzlbg It's pretty simple actually. Gimme a few minutes.
 
@gnzlbg Yes, I saw the video. Apparently the atmosphere was rather constructive. Everyone was cooperating when he asked them to think of range algorithms. It's good when people are open minded :)
 
@StackedCrooked In that case, we should probably prevent @DeadMG from going to the next C++ standards meeting ;)
 
@FredOverflow I think this would be good for @DeadMG.
 
@FredOverflow How would you achieve that?
 
3:38 PM
I don't know, convert you to Scala? ;)
 
Kill him.
 
user142019
Stupid pointer arithmetic.
 
user142019
Oh, I did -= in the wrong place. FUCK POINTERS.
 
So when we can expect standard library API based on ranges? C++17?
 
@Zoidberg'-- What's stupid about it?
 
user142019
3:41 PM
It’s annoying and difficult. It’s easy to get off-by-one errors. :P
 
Then don't do it.
 
@gnzlbg You can simply delegate all operations to the underlying iterators. op[] returns tie(a[n]...), op++ does ++ on all iterators, op-- same idea, etc. Only op- looks weird because you can have zip(a, b) and zip(a+1, b+2). But it makes sense because these two are not in the same range (one is not reachable from the other), so op- is not required to work.
 
hi, here's my homewoerk
 
@Zoidberg'-- which is why you really shouldn't do it :P
 
@Cheersandhth.-Alf You misspelled "homework" xD
 
user142019
3:42 PM
But in C you cannot really not do it. xD
 
Why are you using C?
 
user142019
clanggggggggggg <3
 
user142019
@FredOverflow I’m working with a C library and doing it in C++ would be exception-unsafe unless I wrap everything in classes or use scope guards, and I’m far too lazy to do that. :P
 
user142019
But it works now and that’s great.
 
3:43 PM
Oh noes, scope guards.
Please don't use scope guards for resources.
The examples Andrei gives at the end of his talk are terrible.
Like, the worst imaginable.
 
user142019
I had memmove(client_data->data, client_data->data + i, client_data->size -= i); instead of memmove(client_data->data, client_data->data + i, client_data->size); client_data->size -= i;
 
@R.MartinhoFernandes What's so terribru about them?
 
@FredOverflow Because they are examples of actual resources.
Seriously, a malloc/free pair?
 
@FredOverflow They are the worst!
 
@R.MartinhoFernandes Oh, you mean instead of just using RAII types?
 
user142019
3:45 PM
 
user142019
Worst.
 
@FredOverflow Yes.
 
ohhh salami
 
@Zoidberg'-- why is that the worst sausage?
 
user142019
@Cheersandhth.-Alf “worst” is Dutch for sausage.
 
3:47 PM
he he
 
When calling a function in C++, should you be aware of all exceptions that could possibly be thrown from within that function?
 
oh well, nothing better to do than postponing some procrastination, again
 
user142019
> cannot initialize a variable of type 'char *' with an rvalue of type 'void *'
 
user142019
I get that error in C. Wat.
 
use C++ so you can avoid using void*?
 
user142019
3:50 PM
Dear SublimeClang, I use .h for C, not for C++.
 
@StackedCrooked there's a throw() specifier. Technically, it's empty, you shouldn't expect any
 
@BartekBanachewicz No.
 
probably the C source code is being compiled as C++
 
That's expect nothing.
 
It's the other way around.
 
3:50 PM
methinks
 
user142019
WHY AM I EVEN IMPLEMENTING THIS FUNCTION IN A HEADER FILE
 
user142019
Today is the worst day of my life.
 
@R.MartinhoFernandes Sorry
@Zoidberg'-- template?
 
Anyway, throw() is deprecated.
noexcept is what the cool kids use.
 
user142019
@BartekBanachewicz not in C, and it’s not inline either.
 
3:52 PM
Okeay. So if there's no noexcept, expect shitstorm.
@Zoidberg'-- C sucks.
 
user142019
I know right.
 
Somebody wrote a function that throws an exception when given invalid input. A user of that function was angry because he didn't know that the function could throw and it caused his app to misbehave. Who is in the wrong here?
 
user142019
Depends on what kind of input.
 
@StackedCrooked Documentation author.
Neither behavior (noexcept / throw) is wrong or bad.
 
user142019
For example, if you accept an enum and switch it, use assert in default case, not exception.
 
3:53 PM
It's the problem with miscommunication
 
user142019
But if you write sqrt and somebody gives -1, throw an exception.
 
@Zoidberg'-- sqrt(-1) is i.
 
sqrt should accept unsigned
 
user142019
@StackedCrooked uhm floating points?
 
@StackedCrooked unsigned float?
 
3:54 PM
@StackedCrooked That question is unanswerable in general :)
 
user142019
std::sqrt(-1.0) throws std::domain_error, IIRC.
 
@Zoidberg'-- No, it returns NaN.
 
user142019
std::sqrt’s domain is real numbers. It cannot return i.
 
user142019
@FredOverflow oh. Then what function throws std::domain_error?
 
@StackedCrooked So that sqrt(-1) is 65536?
 
3:55 PM
@Zoidberg'-- stoi and friends.
 
user142019
Ah okay.
 
@FredOverflow what kind of evil is that....
 
@FredOverflow It's so fugly. Why it's even in the standard?
 
Ask the authors.
 
3:58 PM
Duh. I'm going to wait for C++17. And give my input to it, hopefully, before it comes out
 
user142019
Crap. I have a race condition in my code.
 
@R.MartinhoFernandes I mean, it should not accept signed.
 
@Zoidberg'-- How dou you know?
 
user142019
If the client closes the connection while the request is still being handled, I’m screwed.
 
@Stacke i remember something on the lines of: everyone know what c hello world does but a room full of c++ experts can't figure out what exactly does the hello world example from josuttis does :D
 
3:59 PM
@StackedCrooked You mean sqrt(int) = delete;?
 
user142019
@FredOverflow I can see it by looking at my code. :P
 
@R.MartinhoFernandes Wouldn't that be slightly less than 65536? ;)
 
That makes sqrt(1) not compile.
 
You can delete non-member functions? :)
 
@FredOverflow I am rounding.
 
user142019
3:59 PM
Oh no wait, I don’t need the client while handling the request. I don’t need to write any data back to the client.
 

« first day (788 days earlier)      last day (4160 days later) »