« first day (1635 days earlier)      last day (3331 days later) » 

7:00 PM
And for such a short name std::string probably doesn't even dynamically allocate/copy the given string.
 
So the only way to get a memory leak is by using new, i.e. to have a raw pointer which you fail to delete yourself
 
@sehe so the name for the value held by a variable is "temporary"?
I'm trying not to use new right now
 
No. The value held by a variable is the object.
 
@Agostino Very good
 
"name1" is an rvalue.
 
7:01 PM
@Agostino This is why you shouldn't sweat it
 
I have no idea how C++ does this. Java has a garbage collector.
 
@Jefffrey Actually, it's just a literal for the purpose of this discussion
 
prvalue actually, I think
 
@Agostino c++ has the stack and destructors
 
but how does C++ stl "know" to discard the value
 
user1804599
7:01 PM
@sehe Not really.
 
user1804599
Cycling references with std::shared_ptr can be another cause.
 
@Agostino the stdlib doesn't, the destructor does
 
@Jefffrey Actually it's an lvalue
 
@Agostino MAAAGIC
 
String literals are lvalues
 
7:02 PM
@райтфолд It's hard to call that a leak. I'd call it a cycle :)
 
@AndyProwl Really?
 
@Agostino it is connected to skynet
 
@Jefffrey Yep
 
The more you know
 
Hi
 
7:02 PM
@Mgetz but the variable is the same, how comes a destructor is called?
 
@AndyProwl Hmm. What's the rationale for that?
 
better, how does it know to call the destructor on the object
 
user1804599
Destructors are called at the end of the scope for objects with automatic storage duration.
 
@Jefffrey Actually, it's just a literal for the purpose of this discussion. But, e.g. if you do auto x = std::string("xyz") + "abc" you will end up constructing and destructing two temporaries (barring optimizations under the as-if rule)
 
user1804599
{
    std::string x;
    f(x);
    g(x);
} // x.~string() automatically called
 
user1804599
7:03 PM
It's really the basics of C++. Buy a C++ book.
 
@Agostino in what case? destructors are called when the lifetime of an object ends, either by scope or by explicit destruction.
 
The "lvalue" and "rvalue" names are funny.
 
@Jefffrey Not sure. Probably related to the fact that you can get to the associated storage
 
@райтфолд isn't "scope" a thing for variables, and not values? The variable does not go "out of scope"
 
while for prvalues you can't for instance take the address
 
7:04 PM
@Agostino temporaries have lifetime too. That's colloquially also called "scope"
 
@райтфолд that's not the case I was presenting
@sehe and technically?
 
Also, temporaries are precisely not the values of variables (temporaries are unnamed objects, variables are named objects, if you will)
@Agostino Lifetime. I just said that
 
@sehe that is starting to make more sense
 
@Agostino scope is the area in which a value is visible (that alone should make it abundantly clear why a temporary is destructed at the end of its expression)
 
Well, I'm surprised someone made a Let's Play of our most recent game.
 
7:06 PM
temporary variable lifetime is extended until the end of the statement.
 
@Rapptz I said it more accurately before (chat.stackoverflow.com/transcript/message/22563956#22563956)
 
@AndyProwl "get to the associated storage"? As in they are pointer literals and you can read the pointer value?
 
@Mgetz exactly, but the variable itself is still in scope here, the value "name1" is not
std::name = "name1";
name = "name2";
 
@sehe He wasn't getting it.
 
user1804599
@Agostino string literals have static storage duration.
 
7:07 PM
@EtiennedeMartel lol mobile LPs
 
user1804599
They're destroyed at the end of the program.
 
Also yeah show 2 minutes of loading screen
 
@Agostino The string gets copied
 
user1804599
The constructor of std::string makes a copy of the input.
 
@Rapptz Oh well. I'm not sure repeating it but differently will help :)
 
7:07 PM
Goddamn tubyoubers
 
Also, that intro cutscene? I did that. Well, me and a few colleagues.
 
@Rapptz Lounge is certainly not the best place to get the basics
 
@sehe Was worth a shot.
 
@Agostino "name1" is an l-value literal, that is passed to the operator= of the string (or constructor if not marked explicit)
the compiler is of course free to elide this
 
lol literally 2 minutes and there's still no game, just an annoying guy getting too excited about a vidya game
 
7:08 PM
@райтфолд maybe the string operator= calls the destructor on the old value before assigning the new one?
 
user1804599
Of course it destroys the previous value.
 
Does anyone know where I can find a list of sticky io manipulators?
 
I kinda hoped he'd read terms of service and privacy policy aloud, tubyubers like doing that
 
user1804599
It not doing so would be incredibly stupid.
 
@CatPlusPlus What's that?
 
7:09 PM
@CatPlusPlus It's not loading, it's downloading.
Because iOS.
 
Same thing
Edit that shit out who gives a fuck
 
@райтфолд then is that how "name1" gets deleted without the need for a garbage collector?
 
Look, we have... interesting players.
 
At least he doesn't talk over the cutscene
Not that there's much talking in that
 
user1804599
@Agostino Yes.
 
7:10 PM
> We're just looking at Jurassic Park Builder!
Ssshhh, don't tell anyone.
 
@Agostino because it was never allocated
it's a read only value
even C# and Java have these
 
@Mgetz oh, that's interesting
 
Okay annoying is going through the roof
 
user1804599
std::string's constructor makes a copy of the string literal "name1".
 
@райтфолд yes, that's true
 
user1804599
7:11 PM
std::string's assignment operator then destroys that copy and assigns copies the other string literal value.
 
What language do dargons use?
Scala
 
A what
 
@райтфолд now it all makes sense
 
@Cinch are dargons releated to volgons?
if so I don't want to hear their poetry
 
@Jefffrey They are array literals, you can take their address and stuff
Like, &"hello"
But I know this doesn't really make for a "rationale"
 
7:12 PM
Why can't blind developers program systems?
 
If there's a profound one, I don't know it
 
no more bartek?
 
Added a full live demo: Live On Colirusehe 15 mins ago
 
Because they can't C.
 
Never miss an opportunity for complete overkill
~ITreeNode() {
    for (auto* c : _children)
        delete c; // TODO make depthfirst deletion using iteration instead
                  // of breadth-first using recursion to avoid
                  // stack-overflow on large trees
}
 
7:13 PM
thank you all, sorry for the initial misunderstanding
 
@Cinch Coding in Braille doens't make C programmers less productive
 
But they're one generation behind with B.
Plus I hear they get stung a lot by it.
 
@Rapptz I half remember cppreference had one. And SO? Arg. I don't keep links. I just use std::ostream local(incoming_stream.rdbuf()); and manipulate on that
2
 
thousand curses upon you
 
@sehe if someone starts making jokes about getting a better Feel for the code....
 
7:15 PM
@Cinch hehehe.
 
What is an alternate for sexy sexy Lua?
Cmooth
 
Behemooth
 
@CatPlusPlus what did I do
 
user1804599
@Cinch Perl.
 
7:15 PM
@sehe According to my search most are sticky except for width.
 
Why do PDF files have relationship with problems?
 
user1804599
Terrific. Mill Booleans are now immutable.
 
@sehe Starred so I won't forget
 
Because they get so attached To things
 
@sehe Not you :v
 
7:16 PM
phew
 
@Cinch :)
 
@Cinch subtle use of casing
 
Why do EXE files never live to be old?
They're always bound to be executed.
 
Because your mom is fat
 
@Cinch You never gave me time to type it
 
7:17 PM
@Jefffrey Depends on the library. VC++ does SSO, but gcc normally doesn't.
 
Speaking of bad jokes I ran out
 
Why are compilers grammer nazis
 
@CatPlusPlus awaiting the punchline
 
I ran out of those too
 
@Cinch They aren't
 
7:18 PM
(The punchline paradox)
 
@JerryCoffin I thought that became non-compliant in c++11?
 
@sehe No, that was COW
 
@CatPlusPlus and caught the flu but missed the bus?
 
@sehe COW became non-compliant, not SSO.
 
@CatPlusPlus ok.
Thanks for correcting my soul deepest beliefs corrupt worldview faulty memory
 
7:18 PM
Line 1:32 - Cannot determine whether statement or question.
Did you mean, "You are a worthless loser?"
 
What are cows
 
Why is D such a tease?
 
@CatPlusPlus The live form of beef, of course.
 
is it possible to tell criterion how many samples to take? the new version doesn't seem to have "samples" command line option... (Haskell much)
 
Because he can never seem to penetrate anything.
 
7:19 PM
@Cinch Because she wants it
 
@JerryCoffin I don't think this is true.
 
@Rapptz Which part?
 
@ScarletAmaranth Why do you want that
 
The latter.
 
@CatPlusPlus because I want to take exactly 1 sample (yes I understand what implications that has)
 
7:20 PM
That was probably the same memory fault
 
@ScarletAmaranth Then just time it in GHCi or something?
 
How do you know parsers are cat lovers?
 
@ScarletAmaranth ...
 
@Rapptz They may have added SSO in gcc 5, but at least up through gcc 4.9, it uses a (now non-conforming) COW string.
 
They seem to put 'cat' into everything.
 
7:21 PM
@Cinch You're already plonked by everyone now. Just link to the damn page. We can read web pages
 
You won't get anything out of Criterion with 1 sample anyway
 
@Cinch Better question: how do I know Cinch is about to get booted if he can't find something else to post?
 
No I'm on a roll I'm on 4 hours of sleep
Okay I'll stop now
 
@Cinch Thank you.
 
My god tokenization is a bitch. I stayed up till 4 trying to find the best way to do this
 
7:22 PM
noob :)
 
Ikr
 
@sehe Speak for yourself. I hear the web was dangerous, so I don't go there. :-)
 
I still don't know which method is best
 
@Cinch kek
 
7:23 PM
Web is dark and full of nerds
 
@Cinch What are you trying to tokenize? It's not usually that hard.
 
@Cinch the one that works and actually got used is best
 
Well first of all idk whether to go character by character or grab the entire line
 
NesC is a language that's both nice and terrible at the same time :X
 
7:24 PM
I did the former
 
I should rewrite my tokenizing and parsing code to use Ogonek, so the whole thing at least pretends to care about encoding...
 
But I can't think of how to read variable length tokens better than using std::isdigit
 
You have to ultimately go character by character anyway
If you're doing character by character I/O then you're terrible at I/O
 
user1804599
@MarcoA. Nice.
 
user1804599
Go is nice.
 
7:25 PM
@CatPlusPlus I am
But idk how else to do it
 
@MarcoA. that thing is uncannily good
 
user1804599
Alright.
 
Like I used ostream >> char but I couldn't figure out how to cut the string and then return the shortened version
 
they got us used that in the IT industry it's always Christmas
 
@Cinch For reference, my lexer's backend, with some concepts shamelessly copied from @Puppy 's lexer of Wide.
 
user1804599
7:26 PM
I disallowed creating Mill values from C++ values of fundamental types.
 
how would diffs work with lfs
 
I don't know if it's for reference of "how to do it" or "how not to do it", though.
 
user1804599
Because otherwise you end up with trouble with shit like int vs pid_t.
 
So... dunno. :D
 
the only info you'd have with a 'text url pointer' is "the file changed"
 
7:28 PM
@Griwes urg... made me conceptually shameless references to Puppy's backend
 
I guess you'd use commit logs to describe the changes
 
> A bus station is where a bus stops.
> A train station is where a train stops.
> On my desk I have a workstation
 
@sehe My English semantic analyzer panic'd on this message
 
@Pris lfs is storage
 
@CatPlusPlus Did you hear this for the first time today? Very nice.
 
7:29 PM
No, I was inspired by Cinch to look for old jokes
 
@CatPlusPlus and you do "lazy programming " :>
 
@CatPlusPlus :D
 
@Pris Files you'd use it for are likely undiffable anyway
 
@Cinch scrub. Use std::istreambuf_iterator and never use stream interface again for lexing/parsing a serious grammar (ofcourse, abstract away the iterator, so you can use whatever)
 
@sehe inb4 he tries to use std::istream_iterator
 
7:31 PM
@Pris They don't.
 
This turns out to be a very fun anime. @Xeo @Mysticial @ScarletAmaranth @AlexM.
 
Xeo
Funny anime? Try Plastic Nee-san
 
@StackedCrooked o boy; haven't seen any anime for... ages :-\
 
@CatPlusPlus I could argue that a bus station is also where a bus starts.
 
No ninjas. Not interested.
 
7:33 PM
In other words, your joke sucks and you should feel bad for sharing it with us.
 
@ScarletAmaranth you should quickly catch up then :D
 
@EtiennedeMartel n/a
 
I bet people are dumping C++ from GitHub projects because of the pink color associated with it in the project's codemap
3
 
@Pris ugh, terrible
 
7:34 PM
What color do you think best represents c++ lounge
 
black
 
Black
beat me
 
user1804599
Pink is nice.
 
or brown
 
@Griwes I can't wait for all the additional noise when searching for SO questions with google
 
7:35 PM
@Pris octarine
 
I read the parser thing
 
@Pris ;_;
 
Seema interesting
 
> the parser thing
 
@MarcoA. I had that dilemma. wrote 40,000 lines of code but dumped it all for Java when I saw that abhorrent color.
 
7:36 PM
How do you parse UTF
 
Are you implying there's exactly one parser "thing"?
 
@wavemode that's a wise choice sir
 
The Java colour is poo brown.
 
The lexer...?
 
POO is French OOP
 
7:36 PM
If you are asking me, then... I don't. Duh, I think I said that already.
 
I think red best represents c++ because it makes me extra mad
 
But it should be pretty much trivial - dump everything into ogonek::text, normalize it, walk the iterators. Prolly some changes in the is_xxx functions.
 
python should be green for obv reasons
 
lol trivial and Unicode
 
I have some utf8 -> utf16 and utf16 -> utf8 things
 
7:40 PM
Isn't UTF-8 = master-race?
 
I don't know what UTR is
 
@CatPlusPlus In Robot I trust.
 
@Cinch UTR?
 
I also use enums
 
I don't understand [these job offers](https://careers.stackoverflow.com/jobs/85090/angularjs-developer-lafosca-studio-sl) ..

"Our ideal Angular candidate would look like this: You feel like your code from last year is crap compared to this year's, and next year would beat the crap out of today's code."
That would mean I wrote shitty code last year.. and that might still be in the codebase
 
7:45 PM
Guess they're looking for someone young.
 
> We are a young team
Also
> You care about online news and user experience. Eager for knowledge. Will use any free time to learn new stuff.
Yeah, I use all my free time to learn stuff to be a better employee for you. Seems like a great idea
 
I'll send a resume with this last year's code attached and ask to be hired due to big merit start: while(1) { if(0); goto start; }
 
Next year's code will beat the crap out of it. It will use for(;;)
 
@MarcoA. yes. because all them neckbears are soooo fashion sensitive :S
@CatPlusPlus Do you actually use that are was this why you said "I was inspired by Cinch to look for old jokes" :)
> The -f flag is useful for just this situation: it lets users design scanners that work in a “push” model, i.e. where data is fed to the scanner chunk by chunk. When the scanner runs out of data to consume, it just stores its state, and return to the caller. When more input data is fed to the scanner, it resumes operations exactly where it left off.
Looks interesting enough
 
I never had the patience for generators, but it looked okay
 
7:51 PM
I've seen simpler ones. CoCo/R was my weapon of choice for a (long) while. Until I grokked Spirit actually.
I know I eyed Spirit around 2004 or so, but then the IBM VisualAge compiler wasn't up to the task (and arguably, neither was I).
When I came back to Spirit around ~2009 I had this recollection of trying to grok it before.
So the intervening years were CoCo/R for my projects
 
I also considered Ragel
 
@sehe You might like the answers here, they're pretty cool.
 
I knew about the state savers. I just never bother with them
 
copyfmt seemed cool
 
I had forgotten about that one. I'm a bit skeptic that it will work for extensions too?
Is that working on all systems? When I try it, my std::cout refuses to output anything after...ever! — user2225104 Jan 26 at 6:59
uhoh (likely PEBCAK there)
 
7:57 PM
maybe his std::cout is non-compliant
 
I usually do auto flags = out.flags(); ... out.flags(flags);
 
> I'm an AI construct that escaped from the Australian Defence Department a couple of decades ago. I'm currently residing in a COMX-35 somewhere in Western Australia, but I'm looking to move to more spacious hardware soon.
 
and the same for width/precision
 
@Blob more like he always restored it after causing a bad stream state anyways
 
I didn't know this guy became a mod/developer
 
7:58 PM
God I'm just going to make an FST chart already
ASM chart time
 
@StackedCrooked Yeah, I watched that show. It's dump and hilarious. :)
 
@Rapptz I don't like anything that special cases stuff. One-offs like that irk me
 
?
You like sticky operations? :v
 
separate tokenization from verification?
 
If I modify the state, I reset it back to normal (i.e. what it was before my function was called)
 

« first day (1635 days earlier)      last day (3331 days later) »