« first day (710 days earlier)      last day (4254 days later) » 

sbi
8:00 AM
@MKSingh This is a compiler bug. It's probably triggered by an error in your code, but "INTERNAL ERROR" would still be a compiler bug. What you can do is to try to narrow it down. Remove half the code and see if the bug disappeared. If it did, try the other half. Hopefully you end up with a small repro case you can submit in a bug report. And once you found the offending code, you can also change it to circumvent the bug.
 
@MKSingh comment out code until it no longer crashes. That way you find the culprit.
 
@sbi
Yesterday it was running fine but now it is giving me error... Whatever changes I had made today I have commented them.. Still I am getting the error.
 
@LuchianGrigore Though it need not be deterministic. Often, the culprit is a combination of circumstances. Better to look for obvious stress factors (like, extremely long names, extremely large volumes of statics, stuff like that)
 
13 hours ago, by Cheers and hth. - Alf
@TonyTheLion the answer fixes the problem. so, asking for the point, i think you must be temporarily dumb.
wut ^
 
@MKSingh That must be wrong, or the compiler/include paths changed.
 
8:02 AM
his answer is downvoted to shit and he calls me temporarily dumb?!
 
> rampant incompetence in the IT industry.
Yes this ^
 
sbi
@MKSingh That might hint at the compiler invoking Undefined Behavior. Those errors come and go nondeterministically.
 
you can see that by the sheer amount of shitty questions on SO
 
are peoply really coming to see how we blow up iTunes?
 
8:05 AM
lol
 
Ok.. friends... I'll comment most of the code and then uncomment and find the culprit..
thanks...
 
I don't know how anyone can even remotely think that you could develop anything other than a pile of UNICODE POO with Itunes?!
 
@TonyTheLion I'm pretty sure I'd label that answer as temporarily @Alf <whistle/>
 
@sehe hahah
 
It's not really bad, but the tone is... well. The tone
 
sbi
8:06 AM
@TonyTheLion I flagged it as "Not an answer". It should have been a comment.
 
yes
@sbi oh cool
 
@BartekBanachewicz Not anymore. The room has practically been evacuated. You know US and terrorism fears
 
"The room has practically been evacuated" made me laugh
 
Xeo
@LuchianGrigore now I am
 
@SBI I found the room for 'c' but as I have told above but the room was not so active... SO I am going to find the out the problem myself as suggested by others.
 
sbi
8:08 AM
@sehe Oh, is that why the room was empty last night?
 
so I wrote a really angry email to my ISP last night, I wonder whether I'll get any decent response, besides the usual "we're sorry for your troubles" BS. Being sorry doesn't help me any. Fixing the issue, does however.
 
@TonyTheLion can't you just switch to another ISP?
 
@BartekBanachewicz Well, it's true:
1 hour ago, by sehe
someone say something, quick - the lounge dropped to second page of active rooms!!!
 
Xeo
lol
 
@sbi The only plausible explanation that comes to mind
 
8:09 AM
@jalf are you kidding me? No. It's just gonna be another few months of nightmarish waiting for them to do anything.
@sehe jeez, what's going on?
 
I'm afraid to ask who was first, then
Looking at Tiobe Ranking, it could be Obj-C
 
58 mins ago, by sehe
@TheForestAndtheTrees Not much ^
 
@sehe nop
 
sbi
@sehe Yeah, I saw this on twitter while commuting this morning. I especially like that we now have an answer explaining the compilation model. High time we have something to close those questions.
 
@Neil ACK
 
8:10 AM
lol
 
@sbi Oh, you get tweets for ? How?
 
sbi
My first FAQ entry: http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix
 
@sehe Feels dirty mixing assembly and TCP protocol
 
Fucking Android kids, they have FIVE rooms on the first page of recently active!
 
@sbi The compilation model is copy-pasted from here -
11
A: What are the stages of compilation of a C++ program?

Keith Thompson Are the stages of compilation of a C++ program specified by the standard? Yes and no. The C++ standard defines 9 "phases of translation". Quoting from the N3242 draft (10MB PDF), dated 2011-02-28 (prior to the release of the official C++11 standard), section 2.2: The precedence among t...

 
8:12 AM
@MKSingh this comment is spot on:
That doesn't seem to be a problem with GCC, but with the Pro*C/C++ compiler released by Oracle. Try to create a minimal example that exhibits this bug, and then report it (with the example program) to Oracle. Maybe in a few years time they might release a fix for it. — Joachim Pileborg 39 mins ago
 
Well, these self-answered faqs can yield shitload of rep
 
@LuchianGrigore you might want to defer to that answer, or credit very clearly. That seems fair
 
sbi
@LuchianGrigore Oh! I immediately made this an FAQ entry.
 
@thecoshman jealous? Go use Android :)
 
@sehe bewildered
 
8:14 AM
@BartekBanachewicz Well, it takes a decent amount of motivation to write it, too
 
Xeo
@sehe Well, not like it isn't listed exactly like that in the standard. :)
 
sbi
@sehe I just wanted to point this out myself. Actually, he could even just refer to it. /cc @Luchian
 
@sehe certainly it's easier than writing a book
 
8:15 AM
@Xeo Oh, that's what I thought. Anyways, @LuchianGrigore himself said he copied it verbatim from the other answer, not from the standard...
@BartekBanachewicz Erm. Yes. It's also easier than lifting a largish tree trunk
 
@Xeo the standard doesn't have the [SNIP] parts, so no... :)
 
@LuchianGrigore Someday they might fix the standard
 
@sehe Or blowing up iTunes. I meant, putting it in Q&A style is probably more natural, you can freely add more topics, and it's somehow similar to a blog post.
 
@BartekBanachewicz :) all true. And fair game, IMO
 
could someone please dub queen's "dragon attack" so that it sounds like "moron attack"
 
8:18 AM
Does it mean all the questions with unresolved externals will now be closed and pointed here? — Bartek Banachewicz 45 secs ago
 
@sehe wow! that really is obscure
 
then could play that every time
 
@BartekBanachewicz Well, I'd personally love that :))
 
@sehe I would prefer
 
I think I'm gonna switch to GameDev SE for a while, until newbies here make up another C++FAQ to farm rep on ^^'
 
8:20 AM
@thecoshman Wut. Ella is not obscure by any stretch of imagination. But oh well
 
Xeo
@LuchianGrigore Duh. :P
Anyways @Luchian, what did you need from me some hours ago?
 
oh
it wasn't hours ago
 
@sehe more the way drew the connection :P
 
@Xeo I remembered you're into game dev, and thought you might know what'll be C++11 support for nextgen.
 
8:22 AM
@BartekBanachewicz Mmm. I don't follow
 
Xeo
@LuchianGrigore That'd be console development, and it all depends on the compilers (CodeWarrior in case of Wii) and compiler extensions (Sony's PlayStation uses one for MSVC)
 
Ok... I'm not good at that stuff, I just write the code :D
 
Xeo
And I can say atleast that C++11 support looks grim for Wii stuff, if Nintendo isn't willing to drop CodeWarrior
 
sbi
@sehe This is just another collection of "scientific studies" confusing correlation with causality.
 
@LuchianGrigore Lol at the comments
@sbi Any specific complaints? IMO, it's just a popular list of links to separate researches
 
8:26 AM
@sehe Luchian's FAQ will (I hope) get all the unresolved externals, just as I wrote. So it means there will be less newbies with this problem.
 
sbi
@sehe Shrug. Some seem worse than others, but overall...
I am constantly amazed at the number of so-called "scientific studies" being cited in the news that confuse correlation with causality.
 
0
Q: (((long)*(ptr)) << 1) >> 1;

keyoflovprel31_to_addr(ptr) { long offset = (((long)*(ptr)) << 1) >> 1; (unsigned long)(ptr) + offset; } One of my friends asked me this question,and I do else not know the meaning of the function.Maybe like the note above them "/* sign-extend to 32 bits */".But I want to know t...

 
+ I've already been thinking about boosting myself on gamedev to about 1k.
 
if you've ever seen ugly code
there it is
 
@sbi Because that's the easiest way to make sense of it
 
8:28 AM
Fun experiment #2: search your codebase for goto and post how many there are.
 
That of course, doesn't make it right, but that's what people conclude when they're told there's a connection between x and y
 
@BartekBanachewicz Oh aha
 
sbi
@Neil Yeah, and the result of this nonsense is that global warming is caused by the decrease in the number of of pirates, and that storks deliver babies.
 
Xeo
@LuchianGrigore 0, I don't even need to search. :)
 
@Xeo where do you work man?:))
 
8:29 AM
btw, the guy is really into security, if you ask me
I think we can suppose that passwords are stored not hashed so we can just try symbol by symbol or something else. All I need is the formula to determine that password a will be cracked instantly but asdsdvf@#234324|.,dsfs only in 309 sextillion years — arthur.borisow 3 mins ago
 
@sbi What do you mean... you mean storks don't deliver babies?
 
Xeo
@LuchianGrigore Nowhere. :(
 
Oh... well, that explains it
 
Xeo
But I have my own codebases!
 
sbi
@LuchianGrigore When there's a point in even trying that, then this is a sign for a bad code base. In a good codebase I'd count the number of lines invoking delete per MLoC. Anything above a dozen is suspicious.
 
8:31 AM
@sbi Oh, well. Yes, the coverage seems a bit suggestive. However the summary used 'Never spanking can be worse for children than spanking them.' doesn't overstep any lines for me. I feel the information is mostly just presented, and I can ignore the 'hype'/'pooha' around it fairly easily.
Also, it basically reinforces the common sense "never take any single golden rule for granted/fact". That, would in fact be precisely the pitfall that you just had an allergic reaction to.
 
@Xeo Given you're like 2.76x better than me, you should find job in 1/2.76 time that it will take me. And I want to be employed at most at the end of the next month
 
@sbi well... fun for starters.
@BartekBanachewicz @Xeo is it that hard to get jobs? Where are you guys from/looking for jobs?
 
@LuchianGrigore I'm in Poland.
 
@BartekBanachewicz ROFL
 
Xeo
@BartekBanachewicz Well, fact is, I still have an open employment offer. However, it's rather low-paying and I have something else in sight, I'll hear from those guys tomorrow
@sbi And in a great codebase, you'd count the number of news :)
 
8:33 AM
Well, I got pretty reasurring mail from my inside contact. The guy not only put my CV right into HR with recommendations, but also said that I should apply on normal position, even being a student, and ask for about twice the money I wanted.
 
sbi
@sehe But they haven't established a causal link between spanking and personal success! All they have established is a correlation between "raised in families who spank once in a while" and success. What causes the success, isn't clear. For example, depending on the cultural background, there could be a correlation between "families who spank" and "families who care", and families not spanking just don't care enough for their kids to help them succeed.
 
0
Q: Concatenating string in C++

ewlungI need a quick solution, for this simple task. I am modifying a source code, which has this function: OFCondition MdfDatasetManager::saveFile(const char *file_name, E_TransferSyntax opt_xfer, E_EncodingType opt_enct...

 
Xeo
@BartekBanachewicz What did you originally ask for, if I may ask?
 
4 identical answers in under a minute
 
@Xeo you mean what like in position, or how much? ;)
 
8:35 AM
@sbi I know that. It just questions 'common rule' that /spanking is bad. period./
 
@BartekBanachewicz both.
 
Xeo
@BartekBanachewicz > twice the money I wanted
 
@LuchianGrigore Well, I wanted to apply for what they call "Trainee". But the amount of money would be really small, compared to western standards, I'm afraid :( /cc @Xeo
 
@sbi I mean, yes I can see why you think the implicit conclusion "spanking isn't always bad" is... bad. But in my mind, that's not what was written. I interpret this, automatically?, as "spanking doesn't always result in grownups with problems"
 
Lol... I told a guy to do that once... he didn't get a call back.
 
8:38 AM
@sehe, BTW You can only get a measure, not an estimate Shouldn't it be quite the opposite? That you can only estimate?
 
Xeo
@BartekBanachewicz I wanted to apply for a Junior position (the original email offered me this), and in the final interview they said they could offer me a traineeship with 1500eur gross
 
@Xeo For part-time, right?
 
Xeo
And Junior Developer after that (6 months) would be 1.8-2k
@BartekBanachewicz full-time
 
@TonyTheLion The trick is to clear the high bit of the address, making sure it is not in kernel range. This is a security measure, I presume
 
@Xeo how much would that be (net)?
 
Xeo
8:40 AM
@LuchianGrigore 1.1k
 
@Xeo and you live where? (it's all relative)
 
Xeo
Berlin, atm
Willing to relocate. :P
 
@BartekBanachewicz I mean, a 'proportional' measure; as in a factor (like 2x, or 200x) to be multiplied by the time taken to calculate the hash, assuming salt is known
 
@Xeo isn't berlin expensive?
 
Xeo
Not really, I'd say. The living expenses are relatively low, I think
Well, depending on where in Berlin you live, of course.
 
8:41 AM
Is 1.1k doable?
 
Xeo
Some parts are getting huge rent increases.
 
@Xeo I'm hoping for about 1.4k euro for a full time, so I would really get this * part-time - taxes, around 0.8k
 
sbi
@sehe No, it doesn't just question. It implies that a little spanking is good. A questioning article would say "it's not as clear cut", rather than listing it among the top ten things parents get wrong.
 
Considering Poland is cheaper, I'd say it's even more. But I don't know how much I will really get, ofc
@sehe ah, ok.
 
Xeo
@LuchianGrigore Would be, with ~450 (prob some more) for a flat (I could go as low as 250 for a 1 room flat, but I don't like that) and some fixed costs. However, I also have some debts to pay back that would leave me with... like, 0 eur at the end of the month
 
sbi
8:44 AM
@LuchianGrigore Not where @Xeo lives now. :)
 
Bleh!
 
@Xeo maybe @sbi can take you in?
 
Xeo
Yeah, Treptow-Köpenick isn't yet getting high rent increases.
 
Xeo
@LuchianGrigore pffff
 
8:44 AM
@wilx and hello to you, Random Citizen!
 
I hate that std::lower_bound() needs a value of type T for its parameter.
 
Xeo
as if
 
Hi.
 
sbi
@LuchianGrigore Yeah, considering his maturity he'd fit right in with all my kids!
 
@wilx you usually start off with "Hi."
 
Xeo
8:45 AM
:(
 
@LuchianGrigore: Usually, this is unusual situation!
 
sbi
@LuchianGrigore Yeah, and "bleh" only comes if you're already a bit established. You wouldn't enter a non-virtual room loudly burping, after all.
 
@sehe ah, well it seems it's something ARM specific. To calculate an effective address
for a stack unwind
 
@sbi wait. You wouldn't?
 
8:46 AM
How do I binary search in a sorted vector of Things using a custom predicate and using only a fragment of the Thing?
 
sbi
afk
 
@sbi It says 'Never spanking can be worse for children than spanking them.'. Now that is common sense, of course, but it certainly doesn't say 'a little spanking is good'. I agree, the entire article is a bit tendentious, as is the whole site. But the thing I like about it, is that it makes people think. I hope people who prefer not to, don't go there for 'advice'
 
@wilx you can use boost::multi_index. Or, even easier, vector<unique_ptr<Thing>>
 
No C++11 here.
 
@sehe I've been spanking random kids for half an hour now. Am I doing it right?
 
8:48 AM
Well, VS 2010 here.
 
@wilx No No-C+11 here
 
:)
 
Get 2012, it has unique_ptr. I'd say even 2010 has it, but I'm not sure
 
@LuchianGrigore Only two (outside a thirdparty .asp page and some batch files). The first one is somewhat egregious: pastebin.com/Ye0LDkc1. They did comment why they used gotos, though
 
So just #include <memory> and check @wilx
 
8:49 AM
@StackedCrooked Keep going. If it works, you'll know
 
Alright.
 
Hi...
 
@sehe that's pretty good.
+ I learned something new, didn't know you can use goto with switch clauses.
 
There isn't the algorithm. There can be, on the other hand, an algorithm. Which is the topic for the whole another question - How to implement features from the answer below?Bartek Banachewicz 24 secs ago
 
8:51 AM
HI,
Could anyone assist me with a "Noob" question?
 
@Drazick tried Stack Overflow?
 
Yes, no one has answered.
 
@Drazick is it related to C++?
 
@Drazick link it, I have some spare time right now (if it's related to my tags)
 
0
Q: Switching from Debug into Release Mode with VS2010 as IDE and Intel C++ Compiler 13

DrazickI have a code of a Plug In from an SDK. The code is in Debug Mode. I use Intel Compiler which only applies optimizations in Release Mode. Under configuration manager of the project only "Debug" mode is defined. How could I switch to "Release" mode and enable all Intel Compiler's optimizations? ...

Yes it does related to C / C++.
 
8:53 AM
More to visual studio, but I get it. :)
 
ergh... stand ups
 
@BartekBanachewicz Wouldn't that need to be shared_ptr?
 
I just doesn't get how to enforce Linking and Compiling in "Release Mode".
I do use the /MT switch.
 
sbi
0
A: Switching from Debug into Release Mode with VS2010 as IDE and Intel C++ Compiler 13

sbiI wouldn't know about integrating icc, but in VS you switch configurations by switching them in the configuration dropbox in the "standard" toolbar.

 
@Drazick a release configuration should be created when you create the project.
 
8:55 AM
That's the problem.
 
If it wasn't that's a problem in MSVS. If it was, and you accidentally deleted it, I suggest you create a new project.
 
@LuchianGrigore You think? I thought it is pretty awful. I have a branch on which I refactores this. And the whole mess of code that is behind it. But, in the end, the functional specs were confused, so it had to go back to the client to confirm details. That branch is now >1 year old. I reckon it will never see merge.
 
Setting the right options by hand is tricky.
 
Xeo
@sbi If he doesn't even have "Release" defined...
 
It is a code sample from SDK.
"Release" isn't defined.
 
8:56 AM
@Drazick Start with a new project. Drop in the files. Profit
 
@BartekBanachewicz Why not vector<Thing>? Or does "fragment of the Thing" mean forward declaration?
 
Xeo
In the configuration manager, you should be able to select "<new>..." though
and add "Release" through that
 
@sehe you missed the "???" part
@Xeo it's tricky getting all the settings right
 
@StackedCrooked Fragment of the thing means, 99% sure, Thing::member
 
@StackedCrooked The point is, he wants binary search but the container is sorted by another predicate
 
8:56 AM
I think he should just start over.
 
sbi
@Xeo Oh. I didn't see this in the question.
 
Ok, it seems that writing a custom comparator with three overloads <(Fragment, Thing); <(Thing, Fragment); <(Thing, Thing); seems to work.
 
Yes, I can do that, configure "Release".
 
Ugly though.
 
Yet still it seems to compile in Debug mode as something in the code tells it to do so.
 
8:57 AM
@wilx As long as the ordering is deterministic and equivalent, otherwise binary search will silently fail
 
@sehe I was thinking about replacing storage entirely. If you just want to add index, of course, you need shared_ptr. But I'd use multi_index then
 
sbi
@LuchianGrigore That's the part where you setup all the project-specific settings in the new solution.
 
Linear search can be surprisingly fast on vector. You might consider that.
 
@sehe, I will try the new project suggestion though I'm not sure I'll be able to do so.
 
8:58 AM
@BartekBanachewicz I rather dislike multi_index. Surprising/bad performance characteristics. Ugly usage patterns.
 
sbi
@Drazick You mean there is no Solution Configuration named "Release"? If so, are there Project Configurations with that name?
 
It is. I just need to search for / sort by Thing::getId() without having to construct the whole Thing for the std::lower_bound parameter.
 
@Drazick You have a mouse? Just click the buttons :)
 
@sbi, neither the configuration drop list nor the project properties has "Release" option.
 
@wilx Can't Thing be derived from Fragment? Then indeed std::vector<std::unique_ptr<Fragment>> would be the simplest solution
 
9:00 AM
@sehe: No. Fragment is just one attribute of the huge Thing class.
 
@sehe Oh, too bad that I've used it in the "Boost example" in my job. Though I'm leaving in a month, so I don't really care. Thanks for advice, though, of course I didn't profile it and double check -.-
Lesson learned, don't just trust boost in being optimized well
 
sbi
@Drazick Then you need to create them. Copy the Debug configurations and change the settings. You can look at some project that has a Release configuration to see what needs to be changed. Also note that you can multi-select projects and then change all their settings with a single click. Watch out, though, this can be perilous, because where the selected projects have different settings, this just shows a blank field...
 
However, does it essentially mean that there are no general-purpose multi index containers for C++?
 
@sbi, I will create a Release Configuration.
 
@Drazick did you ever read my answer? ^^ I'll add the part about copying
 
9:04 AM
@BartekBanachewicz It is optimized. It just usually does a lot when it isn't required. In many cases, you would bulk insert data into a multi_index container, and it would hardly make sense to keep it ordered and indexed at each insertion. I'm sure there are optimizing overloads for bulk insertion like that, but (a) that's where the surprising part comes in (b) those might not be convenient always
 
Is there a certain Switch, Flags, etc... I should pay attention for in order to enforce "Release Mode" compilation?
 
@BartekBanachewicz YES No. Boost multi_index is okay, but it is hard to make general purpose things that perform well. In general, doing the legwork is both clear and more performant. If you are writing highlevel code with no peformance requirements, boost Multi_index is fine. (You'd just be left with 'ugly' call sites :))
 
@BartekBanachewicz, I might have missed it.
 
@Drazick You should look mostly at ICC options
 
sbi
@Drazick There's many of them. ("You can look at some project that has a Release configuration to see what needs to be changed.")
 
9:05 AM
@sbi, The problem they haven't supplied even one sample code with "Release Mode".
 
sbi
@Drazick Just create some other project then, and peek at the settings there.
 
I tried for 2 days :-)/.
I have no idea.
 
@Drazick Well, we can't fix that
 
When I create a new Configuration ("Release") it won't compile.
 
@Drazick nobody said programming is easy. Especially when you do it "the hard way" (ICC is the hard way)
 
9:08 AM
@B
@BartekBanachewicz, I will switch to MS just to solve it. The problem started by ICC saying t won't apply optmizations in Debug Mode.
 
@sehe Maybe I'll do some research about it when I'll find a while. Right now I'm a bit absorbed by the Borderland 2 ;3
@Drazick It makes sense it won't. Strange things happen in release. Your variables dissapear n'stuff.
 
@Drazick I see now ICC complicates matters. However, surely ICC has documentation. It shouldn't be hard to figure out how to enable optimization and disable debug info.
 
@LuchianGrigore I have a method def goto(x: Int, y: Int) in a Scala code base, does that count? ;)
 
sbi
@Drazick Then you will have to fix that.
 
@BartekBanachewicz Whole functions, even. Though step-through information might still refer to relevant code lines
 
sbi
9:10 AM
@FredOverflow Scala doesn't count here.
 
No one has, by any chance, experience with After Effects SDK, right?
 
@sbi Don't the words "Scala" and "count" even share a common word ancestor or something? ;)
 
@Drazick <*cough*/>
13 mins ago, by Luchian Grigore
AFK
 
Xeo
@Drazick I recommend you read the newbie hints (linked on the right as rules for bad posters) to learn how the chat works.
 
@FredOverflow Yes......
 
9:14 AM
Sorry for that.
 
Programming-related, SFW. 9gag.com/gag/5450811
 
Anyhow, I'll try your ideas. Thank You for that.
 
@BartekBanachewicz That pretty much sums it up, yep
 
sbi
I like this one. Should I ever fly with that mysterious NASA airlines, I'll call them out on that.
 
Xeo
@sbi Meh, being able to carry a space shuttle and having overweight luggage fees are totally unrelated.
 
sbi
9:21 AM
@Xeo You don't say! But, really, I guess that all the people plus their luggage are still lighter than a space shuttle. ICBWT.
 
Xeo
@sbi You're doing it wrong, you should've used the meme!
 
Xeo
like that.
 
@Xeo haha, just barely made it
 
sbi
9:23 AM
 
Xeo
0
Q: Class namespace?

inxIs it me or the implementation of object oriented paradigm in C++ is missing the concept of class namespace? Here is an example of what I mean: Document { Header {} Body {} Footer {} } Document is an object that can have a header, body, and footer. A straight forward way to address such o...

Anybody sees a use for this?
 
@sbi Dat irony.
 
Xeo
Especially the "inherit the nested parts" ?
 
sbi
@Xeo There's some spare room in the bin.
 
@Xeo isn't he thinking of some trait sets? too clever. dunno, seems awfully stupid
btw, does a class have to have a name?
 
Xeo
9:30 AM
nope
struct { ... } foo; object foo of unnamed class type
 
I knew about structs, but I was afraid that maybe class keyword imposes that I create a class
because, in fact, anonymous class is an Object, not a Class
However weird it might sound
 
Xeo
@BartekBanachewicz what
 
@Xeo think about it. What's the essential difference between the object and the class?
 
Xeo
@BartekBanachewicz struct and class are the same except the default accessibility
 
@Xeo Okey.
 
Xeo
9:34 AM
@BartekBanachewicz One is a type and one is an object? I don't see where you're going.
 
lol 69
 
Xeo
I considered this, but we don't want to implement it this way — HellBoy 1 min ago
wtf.
 
@Xeo even though anonymous class creates a new type, in terms of logic of the program we can look at it as just one object having a set of features.
 
@BartekBanachewicz object occupies data memory, class doesn't (method can occupy instruction memory)
 
Xeo
@BartekBanachewicz Nah. struct { ... } foo1; decltype(foo1) foo2;
Now there's two of em
 
9:37 AM
@Xeo I knew you'll use the decltype example. Still, even if the dynamic (from the reflection point of view) languages will have equivalent of this. Yet, it's not a class
 
Xeo
and you are guaranteed that they're default constructible since you can't provide ctors for unnamed classes. :)
 
@Xeo Not sure if that is allowed. IIRC gcc complains about this.
 
Xeo
@BartekBanachewicz I could aswell have used auto and copied from foo1 :P
@StackedCrooked what should it complain about?
 
@StackedCrooked I doubt it. It's perfectly valid.
 
Let me see if I can find the example. Maybe it was different.
 
9:39 AM
`<language = Lua (or other, similar)> X = { fun = function() end } `
`T = some_sort_of_lua_decltype(X) </language>`
Is T a class or not?
 
who the fuck uses yellow in a damn email!?
 
nope
lua has type(X) and it returns a string.
Lua doesn't have classes, and neither does JS
you might get one back in Python, though
 
@thecoshman Nine year olds?
 
@DeadMG did you read the beginning of the discussion?
 
Xeo
0
A: Class namespace?

XeoWhy not use the type aliasing abilities of C++? #include "Header.h" #include "Body.h" #include "Footer.h" class Document : public Header, public Body, public Footer { public: typedef ::Header Header; typedef ::Body Body; typedef ::Footer Footer; }; Live example. Should do what you wan...

 
9:44 AM
@R.MartinhoFernandes and apparently people at work :S
 
@Xeo Ok, it was a little different. Objects of unnamed type cannot be captured as template argument (at least not in C++03).
 
Xeo
@StackedCrooked Sure it's the unnamed part and not because they're most likely local objects?
 
@StackedCrooked who cares about C++03? It makes just the same sense to me as if you wrote (at least not in Borland Turbo C++ 6)
2
 
> 2 A local type, a type with no linkage, an unnamed type or a type compounded from any of these types shall not be used as a template-argument for a template type-parameter.
4
A: Passing unnamed classes through functions

David Rodríguez - dribeasMaybe it would be better if you explicit what you want to do. Why do you want to create an unnamed class? Does it conform to an interface? Unnamed classes are quite limited, they cannot be used as parameters to functions, they cannot be used as template type-parameters... Now if you are implment...

^ From this post.
 
9:48 AM
@FredOverflow I have never used Java, but I have the feeling that I wouldn't like this feature. — Simon 7 mins ago
He has my sympathy.
 
FYI: This unnecessary restriction on local classes and unnamed types as template parameters has been lifted from C++0x :) — Faisal Vali Jun 14 '09 at 2:15
 
@BartekBanachewicz I don't know about C++11.
 
Xeo
Oh, wait, I can see a reason not to put it in the base class... the base class might be empty without the member and derived classes could benefit from EBO to save space! </sarcasm>
0
Q: Why does C++11 have `make_shared` but not `make_unique`

Let_Me_BeWhy does C++11 have a make_shared template, but not a make_unique template? This makes code very inconsistent. auto x = make_shared<string>("abc"); auto y = unique_ptr<string>(new string("abc"));

close votes
 
Oh, come on, @Luchian! I didn't even start to type -.- (vector copying)
 
@FredOverflow It's like exceptions, but with all the manual labour of error codes!
 
9:55 AM
@BartekBanachewicz that's ok :)) repcapped anyway.
 
Wow, you should see Ideone without adblock.
It's pure horror.
 
I don't use AdBlock.
 
What is adblock? ;)
 
@LuchianGrigore so you might as well take a look at my answer. I'm not 100% sure that std::vector::operator= is overloaded for &&
 
@StackedCrooked All I see is a small ad for "High School Programming League" (whatever that is) on the top right corner.
 

« first day (710 days earlier)      last day (4254 days later) »