« first day (1488 days earlier)      last day (3453 days later) » 

5:01 PM
@Jefffrey Hi
 
and fuck C# too
just had to use Object because their dumb compiler can't infer the arguments properly in a trivially deducible situation
 
A base Object class feels so wrong in any language.
 
aww shit
47
A: In C++, is it still bad practice to return a vector from a function?

Peter AlexanderDave Abrahams has a pretty comprehensive analysis of the speed of passing/returning values. Short answer, if you need to return a value then return a value. Don't use output references because the compiler does it anyway. Of course there are caveats, so you should read that article.

link mostly answer has dead link
anyone feel like using the wayback machine to fix?
 
@Mgetz Jerry's answer, best answer.
 
I'm almost there! (Heavy breathing)
23
Q: Using `throw;` on a modified exception

Slodge MonsterI have a function foo that can throw a bar exception. In another function I call foo but I have the ability to add some more detail to the bar exception if thrown. (I'd rather not pass such information as a parameter to foo as it doesn't really belong there due to the generic nature of that func...

One upvote on the accepted answer and to on mine...
 
5:13 PM
@Mgetz ahhhh there are a million links to that article. dammit
It might just be a temporary thing, though, since all of cpp-next.com is currently down
 
@Columbo Don't be the new sehe, pls.
 
@LightnessRacesinOrbit we should probably still pull in the relevant content via the wayback machine
 
@Mgetz probably
 
I'm lazier and just linked to wayback machine
 
@Columbo Yours has 20 upvotes.
@Mgetz -.-
 
5:17 PM
Ahh, fuck you guys
 
@LightnessRacesinOrbit not intended to be a long term fix
I already pinged the answerer to fix it
 
@LightnessRacesinOrbit Yes, and that's the problem.
I need twice the upvotes
For the populist badge
Ahh, more than twice
 
@Mgetz I tried to find the cpp-next.com owner to tweet them, but failed a bit
 
That is, in need 23
 
5:20 PM
@LightnessRacesinOrbit given that the whole thing was powered by wordpress they probably got hacked
or actually it's more than likely the site died
the last update appears to have been in 2012
 
i.e. ...
 
hmm fuck
LINQ can't handle evaluating even trivial properties?
 
fuck fuck
fuckidity fuckidy fuck
fuck fuck fuck
 
how the fuck am I supposed to effectively re-use logic if they can't meet interfaces.
 
5:24 PM
copy & paste - job done
 
user1804599
boo
 
@Puppy wat?
 
I'm very interested in how @JerryCoffin answered that question.
29
A: In C++, is it still bad practice to return a vector from a function?

Jerry CoffinAt least IMO, it's usually a poor idea, but not for efficiency reasons. It's a poor idea because the function in question should usually be written as a generic algorithm that produces its output via an iterator. Almost any code that accepts or returns a container instead of operating on iterator...

Where can I read more about that?
 
@Mgetz If you try to invoke any kind of non-builtin method or property on an entity, LINQ bitches that it can't evaluate it, even though the implementation is trivial (e.g. returning a constant).
 
@Puppy Expressions or LINQ proper?
because the cheating way is to make it a property
 
5:27 PM
it is a property.
 
user1804599
@FredOverflow yay
 
@Mgetz hmm :(
> Hi Dave,
>
> Not sure whether you may already be aware, but the two listed websites are currently offline with an Apache holding page. Currently there are a lot of links to your content (e.g. http://stackoverflow.com/a/3134855/560648) so hopefully this is not the end of it!
>
> Best regards,
> Tom
shrug
 
> MIT license *and* a patent promise. Can you feel the winds of change?

Mono is being updated as we speak (incomplete implementations will be replaced by the end of the week). Lots of partying at Xamarin and Unity3d too!
Woot.
That's impressive news
 
the domain is dyndns so hopefully he just fucked up his local config, or reinstalled his Ubuntu, or something
 
Ell
@R.MartinhoFernandes it does look nicer now coliru.stacked-crooked.com/a/37fdb3ffd33feaa4
 
5:29 PM
@LightnessRacesinOrbit possible, but the site appears to have been dead for awhile
 
@Ell But it doesn’t work!
7 mins ago, by Luc Danton
i.e. ...
 
Ell
@LucDanton Oh that was for me? :P
It needs to be variadic? o.O
I'm confused
 
posted on November 12, 2014 by Herb Sutter

Today my team was part of the Visual Studio 2015 Preview announcement, and it’s nice to be able to share that Visual Studio is now going to support targeting Android and soon iOS, using the Clang compiler, from right inside VS. This is in addition to continued conformance and other improvements in our own VC++ compiler […]

 
@Ell ‘Needs’ is a strong word. But if you carefully look at your current code, you have a template<typename ChildT, int>.
 
@R.MartinhoFernandes nice
 
5:32 PM
When you do foo(c), what should the value of the second parameter be?
 
@LucDanton Actually, a , void>
 
oi wat
 
And that works?
 
Shouldn't.
 
Ell
5:36 PM
why is void default if it shouldn't work?
 
Nevermind that.
 
Why ask me?
You wrote it.
 
Ell
it's default here too en.cppreference.com/w/cpp/types/enable_if though
 
Admit it. You only read the code snippets.
 
Ell
5:39 PM
@R.MartinhoFernandes Oh yeah
true :p
 
Ell
I've read the post before though :P
I guess I ought to start using the better version
 
@Mgetz perhaps he died
No tweets since June; daveabrahams.com also dead
 
@LightnessRacesinOrbit that happens sometimes even to the best of us
nope
David Abrahams is a computer programmer and author. He is most well known for his activities related to the C++ programming language. In particular his contributions to the language include the delineating of a theory of exceptions, sitting on the C++ Standards Committee, being a founding member of Boost and co-authoring a book on the subject of template meta-programming. Abrahams became a member of the C++ Standards Committee in 1996. During the standardization process that resulted in the first ANSI standard C++ - in 1998 - Abrahams was a principal driving force behind detailing the exception...
 
oh bah he started working on Swift. What's the betting Apple made him remove all his own content from the net?
 
5:41 PM
Swallowed by swift
 
@LightnessRacesinOrbit that would be odd, even for apple
 
it would indeed
 
> There are only a handful of types we can use there: integral types, pointers, references, or enumerations. The default void isn't one of them.
 
Ell
I have to go to work now
see ya'll in 8 hours or so
 
5:45 PM
Since I know that there are Git pros hanging out here: I have some easy reputation points for you guys
0
Q: Rebase branch on other branch in past

Konrad RudolphI’ve got the following situation: develop ------o \ \ master ---o-----o-----o-----o-----o-----o-----o \ / A B \ / o-----o-----o Here, I accidentally developed feature branches A and B on top of master inste...

Save my destroyed repo …
 
@KonradRudolph and downvoted for spam
 
@Mgetz Ah well. I thought downvotes were reserved for bad contributions
 
@R.MartinhoFernandes that was a fascinating read
 
and I don’t think this constitutes spam anyway …
but okay, maybe I’m not regular enough to be allowed my little drive-by linkings any more
 
@KonradRudolph lol, I actually had this exact issue, but AFAIK you can just revert the shelved changes then pull from dev
 
5:52 PM
@R.MartinhoFernandes perhaps too depressing until the end
but it's fine, I have to go home in 10 mins anyway
 
@Mgetz Hmm. Pulling from dev won’t remove the past master commits though. I cannot revert those, since I still need them (but on master, not the other branches)
 
@KonradRudolph in my particular situation I ended up creating a branch at the point I wanted to revert to
 
@Mgetz I also forget to mention (but added now) that master has more changes in the past which should also be stripped out from A and B.
 
@KonradRudolph create a new branch before all this crap, and begin a cherrypick
 
Ouch, that’s pretty much impossible, there are changes in the far distant past on master which I have little hope of finding … :-(
But this might be the only way
 
5:57 PM
@KonradRudolph well you have two choices
you can either cherry pick exactly what you want
or you can just fix it in code
pick one
 
hehe, the choice of agony
And could I just re-play the changes AB onto develop, and then just delete them from master? Does this work with cherry-pick?
 
yes you can cherry pick them from master
 
yes, very good :)
Okay, so git whatchanged A gives me a truly scary list … no wonder I got so much crap. I think cherry-pick was the deciding hint
@Mgetz Okay, that was phenomenal. If you could just write a super brief answer, I could accept it and you get the deserved points. What worked:
git checkout develop
git cherry-pick master..B
 
@TonyTheLion OH fuck, I should be playing Dead of Winter now, but am still at work.
 
(and then prune/rename the branches)
 
6:08 PM
So yeah, not even that helps.
 
guys, I've got a tip for you if you're using chrome
you can edit search engines in chrome with a keyword
so if you add a search engine with the keyword "cpp" and as URL http://en.cppreference.com/mwiki/index.php?title=Special:Search&search=%s all you have to do is type cpp vector in your URL bar to go to en.cppreference.com/w/cpp/container/vector
 
we've known that since 1975 but thanks
 
rude
 
@KonradRudolph super brief answer posted
 
I said thanks!
 
6:13 PM
feel free to improve it with what you actually did
 
@R.MartinhoFernandes oh noes :(
 
Wheee! I got the Czech edition of the What If? book. It is funny. :)
 
@caps In the standard or almost any good book on C++. The basic idea is to model your functions to follow the same style as the existing algorithms in the standard library. For one example, consider the second code snippet here.
 
@JerryCoffin So it should be in Effective C++?
Or one of the "sequels"?
Effective STL?
 
@caps Effective STL is largely about how to use the existing standard library code, but the familiarity with it provides a decent guide about how to write similar code yourself.
 
6:21 PM
Effective C++ Standard Library
I should get like 60 points for this detective work. Never will, though.
 
Is there a 'best practice' for how to implement methods in libraries that are intended to be loaded at runtime?

Like, I feel like all the public methods should be virtual (so changing things doesn't change binary compatibility), but I'm curious what else is out there. Does that make sense?
 
@JerryCoffin Hm. Getting ready to write a little search panel module. I want to separate the interface (displaying items in a custom-drawn listbox) from the implementation (pulling data from our SQL db).
 
@QuestionC that does change binary compatiblity
 
Trying to decide if the interface should ask the db object for a container, or an iterator, or what.
 
@Mgetz Changing the definition of a virtual method does not affect binary compatibility.
Or does it?
 
6:27 PM
@QuestionC changing a method to be virtual very much explicitly breaks binary compatibility if there is code that depended on the old interface
 
@Mgetz When I say "changing things" I meant changing the method definition, sorry.
 
And actually I'm thinking one further layer than what I described. Search module object has functions for searching for this or that and can tell you the results, but the actual searching and returning is handled by a separate unit in the Search module. Then the form is just a wrapper on the Search module object. But since it needs to draw the results in the listbox it needs to get them from the Search module object, either in a container or through iterators or a GetNextResult() or something.
 
I understand that changing the method to virtual will break compat.
I'm just curious if there's a best practice though.
 
@QuestionC depends? I don't know enough about what you're trying to do, I would suggest asking this as a question on stackoverflow.com
 
Drepper’s How To Write Shared Libraries has a chapter on the topic. For ELF binaries.
It’s quite low-level though/about how things work though, not necessarily about software development per se.
 
6:33 PM
I'll put it on SO. I'll give it 20 minutes before it gets the 'opinion-based' hammer though.
 
Start your clocks
 
Well, it's gonna take half an hour to write the question.
Delay your clocks. We're working in Rosetta time here.
 
@QuestionC If you frame this not in asking for "best practice", but in asking whether any industry standard exists for ensuring binary compatibility and avoiding dependency hell, you'll avoid the close-cos-opinions hammer. However, you'll almost assuredly get closed-cos-dupe.
 
God I hate dupe closes too. =(
 
@QuestionC Depends on the OS you want to support. For Windows, you can create a COM object (which is basically a standardized version of what you described--what's exported is basically a vtable). For the general case, you just about have to funnel everything through a C interface.
 
6:35 PM
Generally, though, you find a list of code changes that break binary compatibility, and when you make any of those changes, you bump your library's minor version level. If you don't make any of those changes, just bump the patch revision and worry no more about it.
@QuestionC Why? Someone pointing you to your answer, for free! It's free research-for-hire! Do you have any idea how much a research assistant costs in the real world?
> I feel like all the public methods should be virtual (so changing things doesn't change binary compatibility)
I didn't really get this bit.
 
@LightnessRacesinOrbit I think dupe closes have a lot of false positives. Basically, you get redirected to a different question.
 
Section 3 in the Drepper article you got linked to by @LucDanton is a good start.
@QuestionC Sometimes.
 
Meh... '-1 For disrespecting PHP Devs ,and Aussies'. I hate getting downvoted for my honest opinions:)
 
@MartinJames It's actually -1 for poor punctuation. You should be disrespecting "PHP, Devs, and Aussies".
 
6:39 PM
@JerryCoffin lol, it was not my punctuation:)
 
you haven't been downvoted since at least a month ago
 
@LightnessRacesinOrbit meta:)
 
@MartinJames bah
That guy's profile:
> If a person comes to me ans says "PHP cant do this or that." . I respond : "Language is a tool to make awesome website/software, it depends upon you how much you can do with it ? Can you create your own Facebook????? If not then please recheck WHAT YOU JUST SAID ,Period !!! ".
I wouldn't worry too much about it.
 
@LightnessRacesinOrbit I'm not, it was fun! Thks for the upvote, anyway:).
 
@LightnessRacesinOrbit lol
 
user1804599
6:42 PM
guys
 
@Columbo And -1 to you too (for also being disrespectful to idiots PHP devs). Think how lonely those drivers of short buses would get if there weren't future PHP devs to keep them company!
 
@JerryCoffin buses?
 
bah. all this php bashing has me vaguely offended. :)
 
@cHao Yeah.. You should and try to get over that. It happens quite frequently.
 
@Columbo "short bus" is the require phrase. In the US, many school systems have small (short) buses to pick up the "special" (handicapped) students.
 
6:47 PM
@JerryCoffin You make me sick, Jerry.
2
 
Just be grateful he lets you stop there!
 
there's nothing wrong with implementing push_back as a wrapper to emplace_back, right?
 
@cHao We'll have to work on that. What would it take to make you more specifically offended?
 
Equating PHP developers and special students… think once before you talk, those innocent little kids might feel really offended!
 
@Columbo I probably should be ashamed. Horribly disrespectful toward the handicapped.
 
6:49 PM
@JerryCoffin ... just what I wrote one post above you :)
 
@Columbo Yeah, I'm on the slow side myself...
 
@JerryCoffin it'll take a lot of work. if i'm offended, it's usually vaguely. about all you could do is put a @cHao in it, and even that would require knowing i'll read it :)
 
/cc @MartinJames
 
@JerryCoffin Mooooom! He did it again!
 
6:50 PM
I'm at chapter 13 atm.
I never knew that Lisp, Smalltalk and even Prolog were actually used a lot in the past.
 
...
You should rewrite Coliru in Prolog.
 
@StackedCrooked How slow is Oda? Is the new chapter commin' out this week?
 
@StackedCrooked Careful how you tell Americans about that ("chapter 13" is often used to refer to chapter 13 of US law, which deals with a form of bankruptcy).
 
@Columbo AFAIK Oda is a productive manga author.
 
@LightnessRacesinOrbit Oh thanks. It's so nice to know that my respect for those who signed up for service and died for it is now associated with... that:( Imma burning my poppy.
 
6:52 PM
@MartinJames Are you sure you looked at it closely enough
 
Where is my fucking poppy?
 
@Columbo But I only follow the anime. So I don't know if a new manga is coming out this week.
 
BTW your respect is not tainted by other people's respect and other people's respect shouldn't be tainted by your opinion on the unrelated opinions of those other people so pipe down
 
4 hours ago, by Ben
please someone ban jalf this can be an offical petition all in favor of banning jalf and stopping the spam say i
^^ Clearly I missed some drama. :)
 
@LightnessRacesinOrbit I came into class at 11:00 yesterday... didn't know about that silence thing. Shouted "BOOM, bitches!" as loud as I could :o)
 
6:53 PM
@Columbo oh dear oh dear. how did you not know, anyway?
 
@Mysticial You missed some trolling.
 
@Mysticial I like @Cat's reaction.
 
And also some drama.
 
I completely missed the silence though :( Either my entire company forgot (which is not a stretch), or I was listening to music on my headphones and nobody around me dared interrupt me
 
@LightnessRacesinOrbit I'm german.,
 
6:54 PM
@LightnessRacesinOrbit I didn't get past BNP.
 
@StackedCrooked Depends heavily on your definition of "a lot". They've always been pretty much fringe languages. In the '80s there was a Japanese "fifth generation computer project" that was (famously) based on Prolog. Nearly all other use/study of Prolog seems to have stemmed from that, and the assumption that it would eventually mean something (which turned out false).
 
@Columbo awkward
 
@LightnessRacesinOrbit What, the fact that I'm german?
 
@MartinJames always scan for the punchline!
 
why does adobe flash's installer keep focus and not go away
I don't want to close firefox now
 
6:54 PM
@JerryCoffin lol prolog meaning something.
 
die adobe
 
@AlexM. Because he's an attention seeker.
 
@Columbo Well, more so the fact that you're German and blasted into a World War One commemoration of silence, shouting "BOOM, bitches!"
 
@JerryCoffin my definition:
 
That's a lot of alot
 
6:55 PM
@AlexM. BECAUSE IT'S SHIT AND TRIES TO INSTALL SHIT.
 
@LightnessRacesinOrbit I like the above alot.
 
@JerryCoffin Yeah, well, Prolog wasn't mentioned so often. (Joe Armstrong used it a lot.)
 
@LightnessRacesinOrbit Well, better than being a disgraceful twat. If you know what I mean.
 
@orlp :)
@Columbo Sure
 
@Jefffrey how are piadinas usually eaten?
 
6:56 PM
@LightnessRacesinOrbit I meant rightfold.
 
I thought I could roll one into a shawarma but they break so easily
I'll probably fail
 
@Columbo That's usually a given when the word "twat" is involved (<3 you @rightføld)
@AlexM. looks like any normal pitta wrap tbh
from Google images
 
yeah that's why I thought I could roll it into a shawarma
but it's more rigid than the lebanese pita bread
also more thick
 
shawarma
lol
oh what?
it's actually spelled that way in the rest of the world o.0
I've only seen the Dutch spelling Shoarma
 
I'd have called it shaorma but then I wouldn't be speaking English
شاورما
 
7:02 PM
@JerryCoffin for my cdeque I'm a bit on the fence whether I should provide front/back alternatives for every operation
 
I'd never heard of "shawarma" until the Avengers post-credits sequence. And then until now.
Kebabs and wraps m8
 
@JerryCoffin because whenever an operation removes an element a bit of free space gets created, and you have the option to add the free space to the front or to the back
@LightnessRacesinOrbit je moet een keertje een broodje shoarma eten in Amsterdam
 
the only place where I order wraps is McDonald's
even though they're shawarmas in disguise
 
@orlp Or you could treat the free space circularly that can be freely used at either end.
 
@JerryCoffin for example assign potentially generates a lot of free capacity, does that mean I should make two alternatives assign_front and assign_back?
@JerryCoffin that would violate the contiguous memory requirement, no? plus make indexing expensive
 
7:04 PM
@orlp u wot
 
@LightnessRacesinOrbit leer toch nederlands man
 
@AlexM. they're shawarmas spelt correctly ;)
@orlp leer toch den wot m8
 
@orlp I can see where you could, but I'm not sure I would. For assign, I think I'd just plop the data into the middle of the buffer, and leave it at that.
 
@JerryCoffin that would be different behaviour than std::vector though, which puts all capacity in the back
 
@orlp Since you're the one writing the requirement(s), I'm not sure whether a wraparound violates them or not. It could make indexing expensive though.
@orlp Sure--but the point (as I recall it) was to act more like a deque.
 
7:06 PM
@JerryCoffin and how would you know how to put the available capacity in the middle when assign is called with a non-random-access iterator?
@JerryCoffin without moving all elements
hmm
but then again even putting all available capacity at the end is impossible if the iterator is not a bidirectional one
I guess that solves the assign issue
 
whoa
I was curious to see if I could finally find a decent hot ketchup
it said "Xtra hot, to jump to the moon and back" on the package so why the fuck not
jesus christ it's so good
I'll enjoy every second of pain caused by this shawarma
 
@AlexM. I have a stepcousin that grows hot peppers and sells them and sauces made of them
 
@orlp One step down from quality assurance in a brewery.
'im crying here please help me ' - it's CSS, so no:)
 
7:33 PM
 
'Is it possible to call a C++ object instance's destructor before its constructor? If so, how?'

I'm not sure what kind of day this is overall, but it's shit so far.
 
@MartinJames Huh?
 
> Dangling Workers Rescued From World Trade Center abcnews.go.com/US/wireStory/…
I guess someone forgot to... nullptr the workers
YEAAAAAAH
 
wow, VS is starting to crack on with the language features.
 
7:41 PM
@MartinJames No--until the constructor completes, no instance exists, so there's no instance on which to call the destructor until the ctor finishes execution and returns.
 
generator<int> fib()
{
    int a = 0;
    int b = 1;
    for (;;) {
        __yield_value a;
        auto next = a + b;
        a = b;
        b = next;
    }
}
yaybuckets.
 
@Puppy I'd be very surprised if this doesn't make it into the next standard
 
I wouldn't.
 
The semantics are pretty well understood at this point, it's really a question of do they go ahead and just make them a library feature or language feature
 
on the upside, I'm acquiring that shit at like, 15MB/s
 
7:45 PM
personally I'd think it stupid if they don't do it as language
 
p sure it's gotta be language
 
@Puppy nope, they could just import boost::coroutine
not nearly as useful if they do it that way but they could
 
user1804599
@Mgetz ahahahahahaha macros
 
user1804599
That macro-based stackless coroutine shit is so limited you could just as well not use anything at all.
 
hi
 
user1804599
7:50 PM
You either need proper language support for this kind of state machine generation, or proper (read lisp) macros.
 
@Mgetz Like a lot of the thread/atomic operations stuff, it should probably be mostly defined in the library, but with a little bit of language support.
 
well if they're going to do range support
generators seem a pretty logical extension
 
user1804599
@Puppy Can you send to generator and receive from yield? Otherwise it's shittily limited.
 
@rightføld What, you mean like, pass arguments to each invocation of fib?
 
user1804599
Say I wanna do async I/O without explicit callbacks.
 
7:59 PM
that's what __await is for.
 
user1804599
In ES6 and Python you can do that with generators.
 
user1804599
@Puppy Oh I see.
 
user1804599
Nice.
 
__yield_value and __await/__async are essentially ports of the C# versions, as far as I can tell.
 
user1804599
I guess generator-based implementation doesn't work with static typing.
 

« first day (1488 days earlier)      last day (3453 days later) »