« first day (487 days earlier)      last day (4466 days later) » 

10:26 AM
Whoa, @Johannes got a makeover!
@Xeo Well, I'd rather see you eat apples than windows...
@FaheemMitha uniform initialization
 
2 hours ago, by sehe
@FaheemMitha uniform initializer syntax
2 hours ago, by sehe
@Xeo Apples are healthy
 
@sbi : Hmm. so pure virtual methods can have implementations. Interesting, but presumably useless.
 
It seems we have a similar way of scanning chat history
 
1 hour ago, by sbi
@IntermediateHacker I have another good reason for you to disregard outer appearance of females: The hottest woman I ever had in bed was not one you would have craned your neck to have a second look at should you pass her by on the street. But IME great sex will make you adore any woman, and make you think of her as the most beautiful thing on earth. Think again. What would you rather have — a girlfriend your friends envy you for, or one they should be envying you for? :)
You know. that's a good point.
@sbi I think you've actually succeeded in changing my opinion about the outer shell.
 
@FaheemMitha It's vital to know that pure virtual functions can have implementations if you want to pass an advanced C++ interview ;)
@sehe Except I seem to do it the other way around :)
 
10:41 AM
@FredOverflow : I hope I never have to pass such an interview. I'm sure I would fail.
 
@FaheemMitha you know, you've got exactly the same name as my step-uncle.
 
@FaheemMitha My blind spot in C++ is virtual inheritance. Since I've never used it, I know almost nothing about it.
 
@FredOverflow +1
 
We must be soul mates or something ;)
 
I once used virtual inheritance. but over-all the feature is completely useless.
 
10:47 AM
@FredOverflow There are some strange rules there.
 
@IntermediateHacker Ever used istream or ostream?
 
sbi
Virtual inheritance is very useful when you are doing the style of OO programming that was en vogue in the C++ community in the 80s and early 90s: deep inheritance hierarchies and plenty MI. I guess most of you simply missed that. Count yourself blessed for being born too late for it.
3
 
@Potatoswatter :)
 
sbi
@Potatoswatter Haha, I didn't think of that!
 
@FredOverflow same. I'm still not sure what it is.
 
sbi
10:48 AM
@jalf What?
 
@sbi Well, you're right that the inside of iostreams is an example of that obsolete style.
 
Side casting is also such an oddity.
 
sbi
Those baby programmers extensively exploit SFINAE, but don't know what virtual inheritance is for. OMG, I must be old.
 
@sbi what what? I've never had a need for virtual inheritance, so I've never looked into what it does
 
sbi

sbi's gripes with IOstreams

Nov 20 '11 at 22:25, 34 seconds total – 9 messages, 2 users, 0 stars

Bookmarked Nov 20 '11 at 22:27 by R. Martinho Fernandes

 
10:50 AM
Inheritance is mainly used for CRTP… duh
 
Xeo
@Potatoswatter I loved the remark by STL at GoingNative... "The next person who suggests more features for constexpr gets to maintain the iostream wording"
 
sbi
@Potatoswatter Snort!
 
Basically virtual inheritance allows you to have class diagrams that have diamond shapes.
In object-oriented programming languages with multiple inheritance, the diamond problem is an ambiguity that arises when two classes B and C inherit from A, and class D inherits from both B and C. If D calls a method defined in A (and does not override the method), and B and C have overridden that method differently, then from which class does it inherit: B, or C? For example, in the context of GUI software development, a class Button may inherit from both classes Rectangle (for appearance) and Clickable (for functionality/input handling), and classes Rectangle and Clickable both inherit...
 
sbi
@jalf Yeah, but it's so incredibly simple a concept, that you don't need anything more than reading it once to grasp the idea.
 
Xeo
@sbi You know that you're old already
 
sbi
10:51 AM
@Xeo I didn't know the difference to you folks is that huge.
 
@StackedCrooked yeah, I know that much. But how does it do that?
 
Xeo
@jalf Basically, a pointer in the most-derived object
 
room topic changed to Lounge<C++>: If you know how virtual inheritance works, you're probably at least as old as sbi. [c++] [c++11] [c++-faq]
 
Xeo
And that most-derived class is also responsible for constructing the virtual base
 
sbi
@jalf Putting a pointer to the virtual base class into the derived classes. The base class object is then found using that pointer, rather than a fixed offset.
@Xeo In the directly derived classes!
 
Xeo
10:53 AM
@FredOverflow But I'm not that old. :'(
 
@jalf It prevents the duplication of base class data members. Don't know the implementation details.
 
@Xeo Then you're the exception to the rule!
 
Xeo
@sbi Sorry, meant "most-derived object"
 
sbi
@Xeo What's "object derivation"?
 
@Xeo I actually put some effort into figuring out how to smooth over filebuf and codecvt… and have some back burner improvements to libstdc++-v3 to actually make that interface work, there's really never been a proper implementation! So, maybe I should propose someone else's constexpr extension ;v)
 
Xeo
10:54 AM
@sbi Lemme rethink my arguments.
 
@sbi JavaScript ;)
 
@Xeo That's the weird part when using it (even though it makes sense).
 
Xeo
@StackedCrooked Hey, you can create sealed classes with it!
 
@Xeo Each object of a class that inherits virtually gets its own pointer.
 
@sbi Such hierarchies are sometimes a good fit for exceptions! Boost.Exception suggests the use of virtual inheritance.
 
10:56 AM
@Xeo Sealed classes?
 
sbi
One thing you need virtual inheritance for is when you want to use MI in your exception classes. It's very unfortunate that std::exception isn't derived from virtually by the exception classes in the std lib.
@LucDanton Darn! You beat me by seconds.
 
Xeo
template<class D>
class sealed{
protected:
  sealed(){}
  friend D; // C++11 extended friend syntax
};

struct X : private virtual sealed<X>{ ... };
@StackedCrooked Classes you can't inherit from
 
ok, I think I get it :)
thanks
 
@Xeo Clever :)
 
Xeo
@Potatoswatter That's why I said "Lemme rethink my arguments" :)
@StackedCrooked Pop-quiz: Explain why it works!
 
10:58 AM
I have eaten way to much ATL myself. I was an enthousiast: I wrote my own classes using MI and even regretted that WTL didn't take off.
I don't consider myself old, though. (And I have learned to shun MI in most cases these days)
 
sbi
@Xeo I think Stroustrup published that in TCPL, 2nd. (I never read the first.)
 
@Xeo can't you get the same effect by declaring the destructor final?
 
@Xeo I like how you tried to think of a use for VI, and used CRTP.
 
Xeo
@sbi He also has it on his C++FAQ
@Potatoswatter I only used CRTP to make it generic
 
@Xeo If class Y wants to inherit from X then it must to initialize sealed (most derived class must initialize the virtual base) which it cannot do because sealed was inherited privately by X.
 
sbi
10:59 AM
@Xeo Ah. See, I recognized the source... :)
 
@Xeo Yes… but I was just saying how inheritance is used mainly for CRTP these days…
 
Xeo
@KillianDS Good question actually, though that would mean you need to mark the destructor virtual
 
@StackedCrooked No, because sealed has a protected constructor. private would work too.
 
@Xeo However, I don't understand why the friend declaration.
 
Xeo
@Potatoswatter Actually, I think only private would work. /oops
 
11:01 AM
Yeah, just noticed that. Was that copied verbatim?
 
Xeo
no, typed from memory
 
@Potatoswatter Protected constructor of sealed is reduced to private after it was inherited privately by X.
 
@Xeo OK, you get the bonus points back.
 
@FredOverflow Mmm. Didn't see that. I seconded the motion: MI/VI does go unnoticed. I have used it :) I was happy using it. But I was 'happy' about all things C++ (it was new, especially to me, back then)
 
@StackedCrooked But the other client could just inherit from the same class to steal access.
Likewise, the friend declaration exists to grant exclusive access.
 
11:02 AM
@Potatoswatter Didn't think about that.
Sometimes I feel C++ is similar to chess.
 
sbi
Wow, when I look at the starboard, I see one starred message about undefined behavior, two about hot girls, and one about virtual inheritance. I think that this gives entirely the wrong impression of me. :-/
 
@sbi What about the one about meet ing you? ;v)
2
 
sbi
@Potatoswatter And the one about reading the newbie hints. Well, I'm a social guy, and I like to help newbies. :) I'm fine with the impression of me that would give.
 
Xeo
@KillianDS According to the standard, yes, you can do that (just checked)
class X{
  virtual ~X() final{} // sealed
};
 
11:06 AM
@FredOverflow : That sounds... unlikely.
 
Xeo
> 10.3/6: "Even though destructors are not inherited, a destructor in a derived class overrides a base class destructor declared virtual"
 
sbi
Hint to recruiters: when you start off an email to me with "Hi George" you're not likely to get very far...
 
@Xeo I actually saw on wikipedia you can simply declare a class as final (I'm trying to find the section in the standard that confirms that)
 
sbi
LOL!
 
Xeo
@KillianDS Can't. final only exists as an override specifier
 
sbi
11:08 AM
@KillianDS That must have been the Java standard you have seen this in.
 
@Xeo Thought so, that's why I was searching in the standard
 
Xeo
I just noticed, with the sealed class given above, you can still inherit from the class, you just can't instantiate an object of the derived class. Hm...
 
I've finally created a guide to Coder-Jargon.
 
@Xeo Actually, it's also a class-virt-specifier (first paragraph section 9)
 
> 3 If a class is marked with the class-virt-specifier final and it appears as a base-type-specifier in a base-clause (Clause 10), the program is ill-formed.
Looks like Java didn't have the final word, yuk yuk yuk
Hey, is there a list of differences between N3337 and N3290? Nothing stands out at open-std.org/jtc1/sc22/wg21/docs/papers/2012
 
11:20 AM
@KillianDS Is your name somehow related to the Nintendo DS?
 
@IntermediateHacker nope, those are the initials of my last name :P
 
oh. damn, guess I'm the only game console here. :(
 
@IntermediateHacker Aw, now don't feel like a Nomad…
 
sbi
@IntermediateHacker And here I thought you were human!
 
sbi
11:23 AM
Hey, I just found a statistic about how often per year people in different nations have sex. Very interesting. It might also explain why the Greece economy is so incredibly down. On second thought, it might also explain the drop in the Japanese economy since the end of the 80s. :)
 
Xeo
@KillianDS Wow, thanks for the reeducation! :)
Clang even supports it already: class X final{}; class Y : X{};
> error: base 'X' is marked 'final'
 
@sbi I wonder whom they polled in South Africa…
 
Xeo
Even though final class X would look nicer
 
sbi
@Potatoswatter What do you mean?
 
@sbi It's a big country and notoriously hard to get statistics about sex.
 
sbi
11:27 AM
@Potatoswatter Harder than Brazil or Russia??
 
Btw, does anyone know where the robot is?
 
@sbi South Africa is very much part of Africa. I don't think the government has much reach in many parts. Or independent pollsters.
 
@sbi I seriously doubt that list is authentic. Nigeria has more s.a than Japan and the USA?
 
sbi
@StackedCrooked See the short conversation starting here.
@Potatoswatter And don't you think that's just as hard in the jungle along the Amazon river, or in eastern Siberia?
 
@IntermediateHacker s.a = s.x? And Japan is definitely at the bottom in real life. Looks plausible to me.
@sbi Those countries have spent a lot more resources on development for the common man.
Russia in particular… people live in Eastern Siberia because of government support.
 
sbi
11:31 AM
@IntermediateHacker What statistic are you looking at? On the one I posted, Nigeria has less than the US. And everybody has more than Japanese.
 
Also, Brazilians are very open about sex, so it's probably easy to get information. South Africans, supposedly more conservative and superstitious.
 
@sbi hm, norway isn't even on the list
 
sbi
@Potatoswatter Shrug. I wouldn't know. I take it you're from ZA, then? (Oh, that would explain your last name, right?)
@AlfPSteinbach Yeah, many others are missing, too. I'm not sure why. Maybe you're off the chart? :)
 
@sbi Nah, I'm just talking out my ass. My last name is a corruption of Kravitz, from a Russian Jewish ancestor.
 
I think, with the exception of the last two (asian countries), it seems that the more often people have sex, the shorter they are?
Or maybe not.
Sorry.
 
sbi
11:33 AM
@Potatoswatter Oh.
@AlfPSteinbach Huh? It's just past noon, and you already seem to be drunk. :)
 
@sbi tell me about what signals "drunk" to you. i can't figure it out?
 
sbi
@AlfPSteinbach What you say makes no sense.
 
@sbi no? rabbits are small. they have sex very often.
And Americans are tall. They seldom have any sex.
 
sbi
@AlfPSteinbach Last time I looked, they weren't people, though.
 
Xeo
@sbi You seem to accuse him of being drunk quite often lately. :P
 
11:37 AM
What about a person who has sex with rabbits?
 
@sbi Maybe they interact with people though?
 
sbi
@AlfPSteinbach Yeah, and French are smaller than Dutch, right? And people from New Zealand must be much shorter than their British Ancestors. And I didn't know that Austrians are taller than Germans. Laughs.
 
ooh, large!
 
Clearly a virgin.
 
sbi
11:40 AM
@AlfPSteinbach Oh, does she wear long black gloves? Looks creepy with the arms just cut off.
@Potatoswatter You know, you recognizing this right away sheds a strange light on your interest in my opinion about people who have sex with rabbit.
 
@sbi Yes, what is your opinion about people who have sex with rabbits?
 
@Xeo Huh, does the standard really say that destructors are not inherited? does it then define "inherited"?
 
sbi
@Potatoswatter Well, if the rabbit is that large, then it's Ok to me assuming mutual consent. For the size of rabbits we know here, I'd consider it cruel — at least if the human is male.
 
@AlfPSteinbach Destructors aren't inherited because they aren't proper functions. You can't call or name them.
 
Xeo
@AlfPSteinbach I just quoted the standard there.
 
11:44 AM
@Potatoswatter well, you can call them, and they do have names. that much i know. so you're wrong about that. but.
 
@sbi If memory serves, Germany originally bred such rabbits, if that's where "here" is. So maybe there's a law on the books!
 
sbi
@Potatoswatter What is ptr->~T() if not a call to a dtor?
 
@sbi That's a pseudo-destructor call. And you can't do it to call an "inherited" base class destructor.
 
@Xeo huh, i wonder if that goes back to C++98 or if it is a recent attack by formalists (impractical)
@Potatoswatter No, it's as real as can gets: it calls the destructor.
 
sbi
@Potatoswatter This is a big German rabbit.
 
11:47 AM
@Potatoswatter And it's pretty trivial to call the not inherited destructor, although the effect is pretty UB at least for non-virtual
 
@AlfPSteinbach See §5.2.4. It's not even a proper function call expression at all. It does have the effect of executing the body of the destructor, yes.
 
@Potatoswatter Hey, talking about rabbit sex, thinking that an expression that results in execution of a function body is not a "call", that sounds like academic masturbation
Heh.
People used to make such arguments about constructor calls. Even in the face of e.g. the definition of default constructor. It's weird, but most people are not logical.
 
Ah, hmm, maybe 5.2.4 only applies to non class types. Maybe I'm wrong then. But anyway the semantics are different in that the "inherited" constructor is implicitly called, no overridden, by the derived one.
 
You mean inherited destructor. It's just called non-virtually. If it's virtual then it's overridden (by the quote from the std above), but it's called non-virtually.
I'm just perplexed about the wording about "not inherited". It sounds like a weird definition of "inherited". Somewhere.
 
Xeo
I have to admit, while my internet was down, my progress on the game was significantly better, even though I didn't have access to resources for stuff I had problems with...
 
11:52 AM
@sbi From that link I gather that a big rabbit is called KANINCHEN in German.
 
Xeo
@LucDanton Actually, Kaninchen are the smaller ones. The "-chen" suffix implies small (or cute)
 
What if the typeface is extra, extra bold?
 
sbi
@LucDanton Yep.
 
Xeo
Then the typeface is extra, extra bold.
 
@Xeo maybe it's halfway between 3D and 2D?
 
sbi
11:54 AM
@Xeo While that's true grammatically, no name without the suffix is in use.
 
@LucDanton We have Hase and Kaninchen, but I'm not sure what the difference is.
 
Different species?
 
@FaheemMitha What sounds unlikely? Have you ever used virtual inheritance in a real scenario? That is, class Derived : public virtual Base {}?
 
Hares and jackrabbits are leporids belonging to the genus Lepus. Hares less than one year old are called leverets. Four species commonly known as types of hare are classified outside of Lepus: the hispid hare (Caprolagus hispidus), and three species known as red rock hares (Pronolagus spp.). Hares are very fast-moving. The European brown hare (Lepus europaeus) can run at speeds of up to 72 km/h (45 mph). They live or in pairs, while a "drove" is the collective noun for a group of hares. Their bodies are capable of absorbing the g-force produced while running at extreme spe...
That's a Genus.
 
sbi
@FredOverflow Hares are different species than rabbits. They have longer ears, have their relatively developed offspring in the open. Rabbits are built a bit differently, bury holes in the ground, and their offspring is born naked and blind.
 
12:00 PM
@sbi Okay so Hase = Hare?
 
sbi
@FredOverflow Yup. Lepus europaeus is the European Brown Hare aka "Feldhase".
 
Rabbits are members (among others) of the Leporidae family.
 
@FredOverflow : No, the "got exactly the same name as my step-uncle" thing.
 
@FaheemMitha Well… my father's middle name is the same as my mother's brother's first name. My mother's middle name is the same as her brother's wife's first name. Caused me much confusion as a child.
(And they aren't very common names, either.)
1 hour ago, by IntermediateHacker
@FaheemMitha you know, you've got exactly the same name as my step-uncle.
 
@FaheemMitha I never said anything about your step-uncle.
 
sbi
12:08 PM
@FredOverflow He most likely mis-clicked when he tried to reply to @Intermediate. His message is right above yours.
 
And today's "Miss Clicked" award goes to: @FaheemMitha!
 
@FredOverflow : Right, sorry about that.
 
No problem, I was just a bit confused.
 
But I wonder if he was talking about "Faheem", which is actually not that uncommon a name. I jumped to the conclusion that the match was both firstname and lastname, which would be unlikely. Though there is someone living in London who does have exactly my name. Though that's it as far as I know.
 
sbi
 
12:16 PM
Is typename/template needed here? typename mynamespace::template foo<>
 
sbi
@Pubby No. Neither.
 
@sbi Alright. It compiled both ways so I wasn't sure.
 
sbi
Well, except if mynamespace actually is the name of a dependent type.
58
Q: Where and why do I have to put the "template" and "typename" keywords?

MSaltersIn templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway? I have the following code: template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail { // ... template<typen...

 
Xeo
@sbi For the sheer amount of times I see that FAQ linked, it seriously doesn't have many upvotes
 
sbi
@Xeo It just got two new ones. :)
 
Xeo
12:20 PM
I have to admit, one of them was me. I thought I already voted on it. /oops
 
C++03 style "variadic" templates suck
 
0
Q: Multidimensional Arrays in C++

BasmahI have to implement a grid file. Requirement is to build grid files for 1-32 dimension. like i may need to build one grid file with 4 dimensions, one with 32 dimensions etc. Please suggest a suitable data structure which may support grid directory and can be used for 1-32 Dimensions inclusive. ...

Wasn't it someone here who recently made that thing once and for all?
 
Gasp
I asked a question on SU, people edited it and removed the relevant part, and then closed it as exact duplicate.
 
12:35 PM
Hey, it gets things done faster than answering you know.
 
Sure, after all SE is all about productivity now.
 
Yup. Can't argue with Meta
 
@kbok Where? Link?
 
Xeo
@AlfPSteinbach The robot, but his code invokes UB
 
@AlfPSteinbach I think he needs an N-ary tree?
 
12:49 PM
@StackedCrooked vector< vector< … > > is an N-ary tree.
 
It really sounds like he's asking about a file format, though.
 
@Xeo just reported for duty. My fav link resources always were elsewhere on the web (e.g. stackoverflow.com/questions/8256636/…)
@Potatoswatter ?
 
sbi
@kbok Actually, this seems fine to me.
 
@sehe The 32-dimensional array dude, seems to want to store several such arrays in a file.
 
12:53 PM
@Potatoswatter Ah. Context retrieved. Is a serialization job, alright
 
Xeo
@Potatoswatter Then JSON might be a good choice, with native support of arrays
Wait, arrays or trees?
 
@kbok it's not really clear what you meant to ask. As far as I can figure out, you want to trace back where an entry in your PATH comes from (so you can remove it), but what you appear to be saying is simply a statement that your PATH variable is made up by concatenating two or more sources
 
Although it's officially unsupported, a recursive vector type is essentially portable. struct ntree { std::vector< ntree > children; };
 
Xeo
@Potatoswatter It's a real bummer that the standard demands complete types for std::vector (or even all containers?)
 
sbi
12:57 PM
@jalf Yeah, but essentially that is exactly what's happening. The OS takes the system's PATH variable and adds the user-specific PATH's stuff. Both can be edited from the same dialog. The accepted answer on the question this was closed as a dupe of explains where to find that. // @kbok
 
@Xeo By default, it's required for all containers. But there's no reason any container should need a complete type. I think there's some recent effort to change that.
 
Xeo
@Potatoswatter std::array does, obviously. :)
 
Actually it hasn't been much edited, It's more like I failed to correctly formulate the question.
 
sbi
@kbok Maybe. What you seemed to ask according to my understanding was answered in the one yours was closed as a dupe of.
 
@Xeo Yeah, fair nuff. I think that's actually the best reason for std::vector too, for a small-vector optimization where the contents are kept locally. But whether anyone's actually done that… or whether it would be acceptable to move such implementation to an extension class…
 
12:59 PM
My problem is that two additional folders are in my PATH and they aren't in any of the two variables mentioned.
 
Xeo
@Potatoswatter Heh, llvm has a SmallVec<N> for that :) (Atleast I think that's what it's for)
 

« first day (487 days earlier)      last day (4466 days later) »