« first day (640 days earlier)      last day (4294 days later) » 

5:00 PM
@Xeo Well, it works.
 
Xeo
@DomagojPandža 20 :P
 
There is operator+ and such for std::vector? Hmm, that gives me the creeps.
 
Stupid SO logged me out.
Unbelievable.
 
@DomagojPandža 21, not everyone is a grumpy old @sbi ape
 
Xeo
@R.MartinhoFernandes What?
I thought only relational operators were defined
 
5:05 PM
@R.MartinhoFernandes Not according to cppreference
I think valarray has operator+
 
@DomagojPandža cough not everyone puts thier real age on the internet....
 
I want to axe my router into oblivion.
 
@Xeo Saw someone mentioning it on a comment.
 
Xeo
Burn it
 
@CatPlusPlus Claw it to death. :P
 
5:10 PM
To make an axe, you only need two sticks and three iron ingots.
@DomagojPandža 17 :P
 
Is this international "log me out even though I'm here" day? Steam just logged me out while I was using it.
Stupid software.
 
You've clearly been naughty.
Also, the Steam community sucks. They always vote for the deal of the games I already own.
 
> We see you're logging in to Steam from a new browser
It's the Steam browser, you dumb piece of crap.
 
anything good in the steam sales today?
 
5:15 PM
Also, have you heard? Valve already got Linux Steam working.
 
Oh, Duke Nukem Forever flash sale. Wouldn't associate that steaming pile of dung with my account if they payed me, silly valve.
 
lol
@CatPlusPlus Yeah, what about games?
 
In let x = x in ... would you expect x to be initialized with another x from an outer scope, or with itself?
 
I don't care about their stupid crap application.
 
L4D2 will be ported first.
 
5:18 PM
@SamDeHaan There's a all GTAs bundle for €7.50.
 
@FredOverflow I would expect you're crazy to write something like this.
 
I think it's the same x in Haskell, but that only works because it is lazy, right?
What does int i = i; mean in C++? Initialize with itself?
 
So yes, initialize with itself :)
 
Hmm, tempted to get the Arkham City franchise
 
5:21 PM
What does that mean? Are you gonna dress up as Batman?
 
If only.
There was apparently someone that started going around as Batman in a city in northern michigan (look, he even made himself a facebook page: facebook.com/pages/Petoskey-Batman/201489506553005)
 
@SamDeHaan If only I didn't own it already. Stupid community.
 
I only have GOTY Arkham Asylum. Price point is pretty good for AC + DLC + that silly FPS + DLC
Buuut I have already bought a bunch this steam sale.
 
That's a problem?
Oh shit.
 
5:28 PM
@NoobOverflow You're correct on point 1. And point 2 is also a good question. The answer is, for the most part, that the C++ compilation model sucks. — R. Martinho Fernandes 4 mins ago
^ this
 
user784668
Is there a part of C++ that doesn't suck?
 
Templates! No, wait.
TIL: "Templates!" is not the answer to everything.
 
user784668
Error: starbait detected.
 
@Fanael C++ doesn't even get bools right (if you forget to initialize a bool, it can end up being neither true nor false.) I think it's safe to say that everything about C++ sucks.
 
Xeo
@FredOverflow No it doesn't, since using uninitialized variables is UB IIRC
 
user784668
5:32 PM
@FredOverflow It's your fault that you expect undefined behavior to result in either true or false.
 
@Fanael He expects it to not be UB.
It being UB sucks.
Variable not initialized? No compilies.
 
Xeo
All in the name of efficiency!
 
user784668
std::string sucks.
 
The fact that bools can already result in UB is suck in my book.
 
@Xeo What? The only cost of checking that is on the compiler.
 
5:33 PM
@R.MartinhoFernandes I like how Java solves this problem with "definite assignment" requirement.
 
@FredOverflow Yeah. C# too.
 
user784668
std::string ha_ha_bitch_what_now = false;
 
Or how D just always initializes a bool to false, unless you say bool x = void; because you really need the efficiency :)
 
Xeo
@R.MartinhoFernandes I meant the "uninitalized = UB" part
@FredOverflow what.
 
@FredOverflow EWWWWWWW.
 
Xeo
5:34 PM
@R.MartinhoFernandes bool b; fill_mah_bool(&b);
 
bool x;          // means bool x = false;
bool y = void;   // means bool y = uninitialized;
 
Xeo
(yea yea, crap API blabla)
 
@Xeo Meh, just make passing its address down be a definite assignment.
 
If I ever see an API that takes a bool&, I'm gonna DOS the project page.
 
user784668
@Xeo a write-only counterpart to const
 
5:35 PM
Do I really want my friends to see my privates?.... — Neal 2 mins ago
:-P
 
@R.MartinhoFernandes You should design your own language and compete with Wide.
 
@FredOverflow lol, why?
 
@R.MartinhoFernandes Yeah. It's not too big of a problem, buuuuuuut it could become one. Gotta stop it early and stuff
 
@R.MartinhoFernandes Because you seem to have a reasonable grasp on how languages should behave.
 
@SamDeHaan My library has more than doubled since the sale started.
Heck, I think it may have tripled.
 
5:36 PM
Also, you're not a dick, so you'd get my vote.
 
Luckily, I have been saving up exactly for this.
@FredOverflow Oh, thanks.
 
That's good. I wasn't saving up specifically for this, but I was saving up.
 
user784668
@FredOverflow I think I'm gonna call my language Narrow.
 
Xeo
"Wider"
 
user784668
@Xeo Wide++
 
5:38 PM
Hmm. Totall library size = 107. I think it was closer to 80/90 before this sale. So, not near doubled. Better go buy all the indie bundles at once!
 
Harder, Better, Faster, Stronger
 
@Fanael I'm working on a language called "your mother", so someday I can "code in your mother" and put it on my resumee.
 
If I did, I'd call mine Halcyon. No reason. Just because that's the next on my list of "random name for projects I don't want to waste time finding a name for".
 
@R.MartinhoFernandes Is there a Website for that?
 
No, it's a personal list I keep.
 
5:39 PM
I'd probably go with another lethal disease name.
 
Find a cool word => put it on the list.
 
user784668
@FredOverflow Find a site with baby names, it's the same.
 
Ebola?
 
I'd go with Aardvark. Because I haven't had to name any projects, and I like alphabetical ordering.
 
5:40 PM
I'm gonna invent languages called C++14, C++15, C++16, C++17, C++18 and C++19, so the C++ committee has no choice but to finish C++1y by next year :)
 
@FredOverflow Gosh, you're evil.
What possible features of C++1y are so enticing?
 
The only thing I know about C++1y is std::make_unique :)
 
They'd probably just release C++11 with make_unique and constexpr on all the right places.
 
Hah. The most hours i have on steam are on Binding of Isaac. Probably because I used to play all of my MMOs outside of steam to hide my addictions.
 
user784668
@FredOverflow Then they'll finish it in 2026.
 
5:41 PM
@R.MartinhoFernandes std::do_what_i_mean?
 
@Fanael But then it'll no longer be C++1y, and we can point our fingers laughing at them!
 
user784668
@FredOverflow C++1A
 
Yeah, I just looked it up. Smells like a language smell to me — Wug 2 mins ago
"Language Smell" - I like that word phrase.
 
@SamDeHaan I now have enough games that I can keep playing something different for like, probably a whole year. Since there's also the holiday sale, I suspect I'll never manage to play faster than I can buy. Maybe if I go broke.
 
@Fanael That hex joke never gets old, does it?
 
5:44 PM
@R.MartinhoFernandes luckily I work full time (never thought I'd preface that with 'luckily') and have no debt, so I can avoid going broked, for now.
 
user784668
Programming versus playing Skyrim. Hard choice.
 
user784668
Fuck programming. See ya guys.
 
@Fanael /jealous
 
I really need a string_ref or array_ref thingy right now. Is there one in Boost?
 
@Fanael Good luck with your Skyrimjob.
@R.MartinhoFernandes And what would be the difference between a string_ref and a string& or a string*?
 
5:48 PM
@FredOverflow It's not dynamically allocated.
It's just a pair of pointers.
Somewhat like initializer_list, but I can initialize one directly from the pointers.
 
So it just "wraps by reference" an already existing string?
 
Yes, a string, but not necessarily a std::string. In this case, I'd be using static data.
 
@JimNorton Already used for a game engine thingy I made to learn OpenGL.
 
What operations will you be performing on the wrapped string?
 
There's on in LLVM, and I think there's also another one somewhere.
 
5:50 PM
@EtiennedeMartel Oh cool.,, sweet name. :-)
 
My fork on Kyrostat is called "Anthrax".
 
Mine's "plastic bacon".
@FredOverflow I'm returning it. So, whatever fancies the boat of the client. Since this is a building block for more stuffs, I'm the first client, btw. (IOW I don't know yet.)
 
Darn I thought the rep limit was 200/question each day. Is it a specific time frame?
 
UTC day.
Accepts and bounties don't count for the cap.
 
Well, I'm not getting any more on this
 
5:53 PM
You can get from an accept.
 
template<typename T>
class wrapped
{
    T* original;
public:
    wrapped(T* original) : original(original) { }
    T* operator->() const { return original; }
};
@R.MartinhoFernandes There you go :)
 
@FredOverflow Oh, sure, I can write one, but I was wondering if there was one in Boost already. (And I think I didn't make myself clear, since what I want is slightly different).
 
@R.MartinhoFernandes That's the part I hate about it. I'm most active during the first 6 hours after the repcap reset, and least active towards the end of a UTC day. So I have to "predict" whether I'm going to hit the repcap to decide whether I want to answer anything.
 
@Mysticial Hehe, get a decent timezone.
:P
I'm actually (positively) surprised it's not a PST day or something, like on Steam.
 
@R.MartinhoFernandes lol
My worst misprediction was July 11 and yesterday. lol
 
5:59 PM
Rep game is entirely uninteresting.
 
Love that flag...
"URGENT !!!!! NEED ASSISTANCE With designing Multiple ajax calls"
 
@R.MartinhoFernandes std::reference_wrapper?
 
@MooingDuck No.
 
@FredOverflow for a string literal I don't think operator-> would work so good
 
template <typename T>
struct array_ref {
    T* first; T* last;
    T* begin() { return first; }
    T* end() { return last; }
};
// needs more polish
@MooingDuck This.
 
6:04 PM
template<int len>
struct array_ref {
    T (&ref)[len];
    T* begin() { return std::begin(ref); } //return type is probably wrong
    T* end() { return std::begin(ref); }
};
 
@MooingDuck Nope, that only works for static arrays.
Mine works for any one. Or parts of it.
 
Also not copyable.
 
@CatPlusPlus It's copyable.
 
@R.MartinhoFernandes well, yes but you said your data wasn't dynamically allocated, so I thought it was static
 
Only not assignable.
@MooingDuck Yeah, but I actually want a chunk out of one big array :P
 
6:05 PM
@R.MartinhoFernandes oh
@R.MartinhoFernandes trivially fixable
 
Uhm. I avoid reference members anyway.
Also array_slice is a better name.
 
@CatPlusPlus Hmm, yeah. I used what they used in LLVM.
 
or std::pair<T*, T*>
 
No semantics attached.
 
boost has a range class I bet
 
6:07 PM
@MooingDuck Yeah, I think I'll use that.
It's iterator_range.
 
room topic changed to Lounge<C++>: I've ordered a new topic, but the courier is running late. [[exit_below]] [c++] [c++11] [c++-faq]
 
@CatPlusPlus Attach those semantics
 
template <typename T>
using array_slice = boost::iterator_range<T*>;
Much better.
 
6:26 PM
Would you guys say that this (ideone.com/KyyEv) pseudo code corresponds to this (imgur.com/ysL2E) control flow graph?
I'm trying to verify it in some way
 
@ManofOneWay you're missing B6, B7
 
What the hell is that goto there for.
 
@MooingDuck B6 and B7 are implicit gotos
 
@ManofOneWay ideone.com/ula30
@ManofOneWay don't use goto
@ManofOneWay forget goto exists, it's easier than figuring out when it's ok to use.
 
True, it could be that B6 and B7 are actually doing something more than just jumping
I'm not using any gotos in the actual code, it's just to represent a straight jump from a block
 
6:35 PM
Why is myifstream != myifstream.eof() when the EOF bit is set?
while (mystream.good()) works but while (mystream) doesn't
 
@MooingDuck Thanks :)
 
@Drise a stream is never equal to a state
 
@Drise Because !myifstream == mystream.eof().
 
@Drise but maybe you are asking about .bad()?
 
Don't bother with good(), bad(), and ugly(), oops, I mean eof(), just use the conversion to bool.
 
6:37 PM
I'm trying to loop "while the file is valid" -> while (mystream). Am I wrong?
 
@Drise no, (mystream.good()) doesn't work but you think it does, while (mystream) gives the right result.
 
eof() is useful in some very niche cases, but not very rare.
 
@Drise you want to loop "until you can't get more data", which is different. But you want this: while(mystream >> x)
 
@MooingDuck Reading is handled elsewhere.
 
@Drise shouldn't be, but if it has to be, then yes. while(mystream)
 
6:39 PM
cout << inFile.good() << inFile.eof() << endl;
produces 0 1, but while (inFile) doesn't crap out.
 
Because if you tried to read past the end (what eof() means), it's not good.
 
@Drise that doesn't sound right at all
 
@Drise Put the reading on a function that returns a bool or a istream and then loop while(read()).
 
Ugh. This whole reader is a mess.
And sadly, I wrote it. But that was before I started to hang out here.
 
@Drise That sounds like UB or measurement error.
 
6:44 PM
It's somewhat psuedocode
 
oh Java how I hate thee. When reading from my calendar object, the "day of year", "year", "hour", "minute", "day of month", "day of week" are all correct. But "month" keeps giving me a random month.
 
@MooingDuck What date API are you using?
Date? Calendar?
 
@R.MartinhoFernandes Calendar. And I don't know where it gets set, I'm just reading it.
 
Use JodaTime.
:P
 
Why does mine work "occasionally" though?
My co-worker ran dos2unix on the file, and it magically starts working again
 
6:47 PM
@Drise undefined behavior in the code not shown
 
@MooingDuck Are you sure it's a Gregorian one?
 
@R.MartinhoFernandes no, I just read the data.
 
@Drise Sounds like mixed line endings.
 
@R.MartinhoFernandes Checked, all LF
 
@Drise then dos2unix woudn't have fixed it
 
6:53 PM
@MooingDuck Oh well, then either the data is broken, or someone is misusing the API (which is perfectly fine, because that API is broken anyway).
 
oh, minutes/hours are wrong as well, they're always the current time. Awesome. And when I say it's giving me a random month, I mean Aug 1 2012 gave me month 30.
 
@Mysticial haha, trying to get to the rep-cap but all that is happening is people accepting 0 voted answers.. so I get no upvotes, a few hours left of this day - shitshitshit ;)
 
@MooingDuck Test thingy instanceof GregorianCalendar.
Oh, and make sure Calendar.AUGUST is not 30, just in case.
 
@MooingDuck What's wrong with month 30? That sounds like a cool feature, definitely not a bug.
 
@MooingDuck Ok. How does getline handle the last character of the file if it is not an endline?
 
6:56 PM
@Drise it reads until (A) finds endline (stream still good) (B) finds EOF (stream still good), (C) stream becomes bad (stream is bad)
 
@MooingDuck Serious? fuck my life. I'm almost sure EOF is bad
 
@Drise wait, lemme think
@Drise yes. If it read data successfully, the stream state is good.
@Drise only if it failed to read at all.
 
Ok, I'm off for dinner. Later.
 
@Drise the state of the stream tells you about the previous read, not the next read.
 
@MooingDuck Oh fuck me.
 
6:59 PM
good() implies !eof(). If you're witnessing otherwise, either you have UB, another thread fooling you, or a buggy implementation. I'm betting on the first one.
 

« first day (640 days earlier)      last day (4294 days later) »