« first day (310 days earlier)      last day (4630 days later) » 

12:00 AM
I think we discussed some aspects of it to do with the last day of the month in February when it's a leap year or something like that.
 
Yeah, that question came straight from the NodaTime mailing list.
 
Oh, I thought it was something you encountered.
Ack, still trying to support smart pointers. Now I can avoid the conflicting using declarations but I still face ambiguous overloads.
And with that I think I'm finally hosed. SFINAE can remove overloads from a set but certainly can't order it.
Funnily enough I can order the overloads on the cv qualifications as applied to the (possibly smart) pointers.
I could still go with a perfect match on the referee.
So overload<void (foo::*)() const>()(&p) would fail for foo* p;
 
 
3 hours later…
3:12 AM
Can I specialize template aliases?
 
No, because a template alias does not declare a template-name
You can declare a metafunction, specialize it, and declare an alias to that, though
 
:( ok.
So, this won't work: template <typename T> using foo = bar<T>; template <> class foo<int> {};?
@Potatoswatter I think I didn't make myself clear.
 
right, because foo is not a class template
The code you posted illustrates the question I intended to answer :)
 
template< typename t > struct foo_impl { typedef bar< t > type; };
template<> struct foo_impl< int > {};
template< tyepname t > using foo = foo_impl< t >::type;
^ this accomplishes the same thing by declaring the needed template-name.
 
3:20 AM
My intention was to have that foo<int> part declaring a specialization of bar, just as you would with template <> class bar<int> {};.
 
That would make the code confusing, no?
 
Yeah. In my case the foo alias will be different depending on a preprocessor symbol. Whatever foo comes to be, it needs to have two specializations.
I'll do it some other way.
 
yikes
 
I know it sounds scary :)
Ok, I might need some help with the preprocessor. I need the closest possible thing to a "local macro". I don't have any other options besides using a hopefully unique prefix on its name, right?
 
The "local macro idiom" is to #undef it when you're through with it
 
3:30 AM
Oh, wait, I only need the specialization on one situation after all. Hah, no nasty macros.
 
good deal!
 
 
2 hours later…
5:47 AM
what is wrong with this declaration?
map<long, vector<int>* > compl;
 
6:02 AM
compl is an alternative token for ~.
2
What the compiler sees is map<long, vector<int>* > ~;
 
i wouldn't have guessed
oh my
i wonder who the culprit is, who convinced others that it would be a good idea
 
Took me a while to see through the weird "error: expected class-name before ';' token".
 
6:45 AM
Syntax color helps a lot to prevent these kinds of errors.
 
7:08 AM
In the other direction, this compiles with MSVC 10.0:
int main()
{
    int default = 666;
}
:-(
 
Report a bug!
 
it's not something i discovered, just something i remembered. others have probably reported it many times. and most likely, the resolution is to do nothing about it.
 
 
1 hour later…
8:33 AM
Hi
 
Hola
 
I just had a look at the "Dancing Dolls" question
1
Q: Dancing Dolls Problem : on GCC linux

Udit GuptaAs a preface, I really do not want the exact solution to my problem, just guidance. I don't want you to give me the code. This isn't homework, it's just an exercise I'm trying to solve. I just want you to tell me how to access VDU and directly change character on same screen. The screen is divi...

Do you think this could be solved by inserting a kernel module ?
 
'solved' sounds like it's the wrong word here.
 
lol
sure.
I mean, 0xB8000 can be accessed directly in a kernel module or not ?
 
8:37 AM
IIRC kernel code is still in protected mode. But I don't know enough about the problem domain to know if that's a good argument either way.
 
Ok.
 
i think in windows one can just install vc 1.42 and produce an old dos program. then it will presumably run in a virtual dos-box. and appear to have access to that memory. the memory is hardware feature, not an os feature. but access to it is os-specific.
i hope i remembered the version number right
the simulation i presented isn't quite the same, since the user code controls the screen updates
i guess one could make it more realistic with multi-threading, but it start getting pretty complex pretty fast then
 
@AlfPSteinbach Yes, I think it's the simpler way.
BTW, linux does access the video buffer directly :
But @LucDanton is right, writing a kernel module for that sounds like a terrible idea.
I think I'll do it anyways. For the lulz.
In C++.
 
Is there an English description of the new C++ threading model out there? I'm wading through the standardese but it's not really the best "getting started" resource. It would definitely help understand it if I had any vague idea of it first.
 
8:50 AM
"It did right what the Posix memory model specs didn't", is the gist of it I think.
That won't help with atomics though :|
 
Oh, "it's better than the POSIX one" is a very rough description.
 
@RMartinhoFernandes You can watch this 3 year old video about threads in C++:
> The C++ volatile qualifier continues to have nothing to do with threads.
volatile must be one of the most misunderstood keywords ever.
 
It may be that 64-bit Windows 7 can't run old MS-DOS programs
Testing:
d:\dev\test> echo MZblah >test.txt

d:\dev\test> test.txt
This version of d:\dev\test\test.txt is not compatible with the version of Windows you're running. Check your computer's
system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the
software publisher.

d:\dev\test> _
 
Just install DOSBOX.
 
yeah but it says "not compatible", not the old done-some-invalid-stuff?
 
8:55 AM
@FredOverflow volatile ensures that the compiler does not optimize said identifier, no ?
 
@AlfPSteinbach You are trying to execute a .txt file, is that even possible in DOS?
@kbok volatile doesn't give you any thread-related guarantees.
 
that's always been possible :-)
 
I honestly didn't know that, thought you could only execute .exe, .com and .bat
 
no, the command interpreter checks for executable signature at start of file
like MZ
 
@kbok It has a semantic meaning, it's not just about optimizations.
 
8:57 AM
What happens if a bat file starts with the line "MZebras how delicious"?
 
same as shown above
in windows 7
in xp it will just crash
i think
 
@LucDanton What do you mean ?
 
@LucDanton If thread 1 writes to a volatile variable and 1 second later thread 2 reads that same volatile variable, you have no guarantee that thread 2 will see the new value in C++ (whereas Java gives you that guarantee).
 
no sorry it actually executes it as bat
 
@AlfPSteinbach But that line could mean "call the executable MZebras with the two arguments how and delicious..."
 
8:59 AM
@FredOverflow In Java (and C# for that matter) volatile is all about threads.
 
@FredOverflow I misquoted, the message was not directed to you sorry.
 
It means all access to it is fenced.
 
@RMartinhoFernandes Yes, I know, but this is C++ we're talking about.
 
@fred: sorry it actually executes as bat, so it does what you say
or tries to
but for other kinds of files like text files it check the first few bytes for magic number like MZ
much the same as the start command checks for URL-likeness
 
@RMartinhoFernandes But volatile has different meanings in Java and C#, right?
6
Q: volatile with release/acquire semantics

FredOverflowSince Java 5, the volatile keyword has release/acquire semantics to make side-effects visible to other threads (including assignments to non-volatile variables!). Take these two variables, for example: int i; volatile int v; Note that i is a regular, non-volatile variable. Imagine thread 1 exe...

 
9:01 AM
i mean start ww.google.com and start www.google.com are treated very differently
 
@FredOverflow I'm not very versed in Java, but I think it's roughly the same.
 
@kbok For instance inside a signal handler variables of volatile std::sig_atomic_t type don't necessarily have an unspecified value.
 
@RMartinhoFernandes Well, it's not even the same in Java 1.4 and Java 5, so I doubt C# and Java have the same volatile semantics.
 
> A volatile read has ―acquire semantics‖ meaning that the read is guaranteed to occur prior to any references to memory that occur after the read instruction in the CIL instruction sequence. A volatile write has ―release semantics‖ meaning that the write is guaranteed to happen after any memory references prior to the write instruction in the CIL instruction sequence.
 
Does anybody know about a free and fairly stand alone codecvt_utf16 facet?
 
9:08 AM
@FredOverflow Seems to me like the Java 5 semantics you described.
(Though I'm quoting from the CLI spec, not the C# spec, but I doubt it differs.)
 
9:31 AM
-2
Q: What shoes are really comfortable for walking on concrete floors?

andyzhao0817I wore Nike Wide Width running shoes last year. However, this year, we are not allowed to wear tennis shoes to work. We must wear dress shoes. I work on old concrete floors and am on my feet all day. Dress shoes are causing blisters, pain in the ball of the foot, and cuts. I cannot find any shoe ...

 
Now, please explain why there is a tag.
Oh, it's a ruby thing.
 
There's a Ruby library or something called Shoes.
 
Finding the best shoes for implementing sneakernet is a topic specific to the programmer profession!
 
It's not a programming problem though.
It's a better fit for Programmers, maybe.
 
9:35 AM
Maybe there's a Q&A for comfortable shoes ?
 
@TonyTheTiger Shoes are as important as chairs!
3
Q: What is the best programming chair?

FredOverflow Possible Duplicate: Which chair do I buy? According to Joel Spolsky, programming productivity skyrockets in a comfy chair. So what is the best programming chair out there? I have some money to spend and can't stand my $10 Ikea chair anymore.

 
> I sit on a throne made from the skulls of my enemies. It's not particularly comfortable, but it certainly makes the testers think twice about sending spurious or poorly documented defect tickets to me.
Awesome.
 
What's the kind of ordering required for map et al.?
 
strict weak ordering
In mathematics, especially order theory, a strict weak ordering is a binary relation  Strict weak orders are very closely related to total preorders or (non-strict) weak orders, and the same mathematical concepts that can be modeled with strict weak orderings can be modeled equally well with total preorders. A total preorder or weak order is a preorder that is total; that is, no pair of items is incomparable. A total preorder \lesssim satisfies the following properties: * For all x, y, and z, if x \lesssim y and y \lesssim z then x \lesssim z (transitivity). * For all x and y, x \...
 
Ack. I was trying to remember something with 'partial' in it, no wonder I couldn't find anything :(
 
9:43 AM
@FredOverflow lol
 
If I want my pinky to survive much longer, I need to remap Ctrl to a location that isn't as painful to use. Any suggestions?
 
I remapped to Caps Lock
Well, I swapped with Caps Lock to be precise. Not that I use Caps Lock at all.
 
Hmm, I have an Esc there, and I've grown fond of it.
Makes using vim so much better.
 
+1 for caps lock. It's basically useless.
3
 
That does sound more usable... I really need a spot for Escape.
 
9:50 AM
I also have a key between Z and maj which is totally useless.
 
I'll try to remap that to Ctrl, then I can rotate Caps Lock to Escape!
@kbok Don't we all :)
 
@kbok Here that key is < and >.
Pretty useful, I say.
 
@LucDanton That makes sense.
 
@kbok No, you're correct.
But a lot of us don't have a QWERTY layout to begin with.
 
@LucDanton Oh, I understood "We don't all"
I have a fr keyboard with a qwerty mapping so, for me this key is a dupe of others.
 
9:52 AM
Same here, hence my comment.
 
Also TBH, left maj doesn't need to be that big.
 
Neither should Enter.
FWIW my right shift is pretty big.
 
Also the close button in Windows XP. But I digress :)
 
This is horrible. Now I have two Caps Lock and can't escape.
 
Shout at some people on the internet before fixing that.
 
10:02 AM
what does it mean when they want someone to code 'low-latency' software?
is that essentially like high perf, can't take a lot of time type thing
 
means what it says on the box: low latency. As in, they want to be able to respond to incoming data in a matter of microseconds (or less)
usually it means "we're trying to get rich on high frequency stock trading"
whereas high perf might just as well mean "we need a huge throughput, but the latency on individual operations isn't too important"
 
oh I see
 
that's how Google works
 
There's more than one kind of high performance and I imagine that for low-latency it means e.g. a 'tight' upper bound for the worst case scenario.
 
they need to process a million billion squillion search requests, but no one cares if each request gets a reply in 0.1 or 0.5 seconds
 
10:05 AM
yea
 
Are you kidding me? 0.5 seconds is FOREVER.
 
sbi
room topic changed to Lounge<C++>: 0.5 seconds is FOREVER. [c++] [c++11]
You hadn't changed that all weekend!
 
High frequency trading should be outlawed.
 
sbi
@RMartinhoFernandes ??
 
Yet another example of a stupid word filter.
 
sbi
@RMartinhoFernandes Ah, "entity". I missed that.
 
Also, I'm luring Tony.
 
Clbuttic.
 
10:26 AM
I can't help but lol every time I see that.
I like how the error message tells you to open the FAQ and see the list of unacceptable words.
You won't let people use those words as part of other words in their input, but you are willing to put it on what is supposed to be a page that lots of people will see.
 
@RMartinhoFernandes "you might learn something"
 
"Following is a list of all the obscenities we could think of. Please email us if you know an obscenity that we missed."
 
sbi
23 hours ago, by DeadMG
no two students make the same mistakes in self-authored programs, but if you copy from someone, you also copy their bugs
That's not wholly true. My students often ran into the very same dead ends and made the same mistakes, even if it was obvious that they weren't "collaborating". OTOH, I could tell many dupes by the programs' _structure_: how the functionality was broken down into functions, which intermediate results were stored in explicitly named variables, etc. - these things often gave away a copy.
However, I agree that, if you are a good tutor, none of your students are ever able to turn in their program at the first try.
 
Of course there are mistakes everyone makes on their own.
 
8 mins ago, by R. Martinho Fernandes
Also, I'm luring Tony.
huh?
 
10:33 AM
Success! I have rotated Ctrl, Caps Lock and Escape!
 
Someone said the word "entity".
 
sbi
@TonyTheTiger It's a link to the WTF site and speaks about (sexual) "obscenities".
 
As in the two "entities" that a lady carries on her torso.
 
@sbi yea I just noticed, but what have I got to do with it?
 
sbi
@TonyTheTiger Better now?
 
10:35 AM
@LucDanton Ctrl on the top row, Esc on the middle and Caps Lock on the bottom row?
 
@LucDanton By... rotating the keyboard?
 
@RMartinhoFernandes Well... no.
@CatPlusPlus Haha, no, the rest of the keyboard is unchanged.
I am reminded of the idiom 'when you have a hammer'...
No keyboards were harmed in the making of my messages.
 
When you have a hammer, every time is a hammertime.
 
Which one did you make the useless one (id est, Caps Lock)?
I'm thinking of using Left Shift for Ctrl. I always use the one on the right, because it's so big.
 
Escape, which is too far for comfort.
 
10:39 AM
@sbi oh... sex
 
Gosh, you were slow.
 
it that the only way to lure me, talk about sex. meh
 
Also I think proper form for touch typing is to press Shift with whatever hand is not pressing the other, relevant key. No one-handed 'power chord'. But I may be wrong.
 
@RMartinhoFernandes been known to be slow at times
that's what trying to find a job does for you, makes you slow :P
 
@LucDanton Well, in resting position, my right pinky is comfortably on top of Right Shift, so I say, screw "proper" touch typing.
 
sbi
10:40 AM
When your hammer is C++, everything begins to look like a thumb. Steve Haflich #FridayJoke
 
@RMartinhoFernandes Yeah, that doesn't sound like home row.
 
@sbi lol
 
@LucDanton Well, my Right Shift is huge, and my pinkies are a bit on the small side.
 
Perhaps one of those curved keyboards then?
 
> C++ is like teenage sex: 1. It is on everyone's mind all the time. 2. Everyone talks about it all the time.
 
10:42 AM
That's why it hurts so much to use Ctrl.
 
3. It transmits diseases?
 
I hope not.
 
meh
the CPP disease
 
How can C++ be on everyone's mind all the time?
 
10:44 AM
It's not on my mind all the time.
 
Everyone's mind is too busy thinking of sex to also have C++ on it all the time.
 
@TonyTheTiger What's the complete quote ?
 
@kbok that is the entirety of the quote
it's from the same twitter feed that @sbi posted from
 
I thought there was also a "Everyone is doing it badly anyways" line.
 
maybe they missed that bit
 
10:46 AM
The problem with twitter is that one visit generates 10+ tab openings.
 
011000111110001110010110011101
@kbok oh rly?
 
sbi
@TonyTheTiger Uh oh. That joke was the cause for a big time meta-police action, causing a lot of trouble here.
 
@kbok That's tame compared to real tab-explosives like The Wiki.
And I don't mean The Other Wiki, I mean The Wiki.
 
@sbi I can't delete it anymore :(
you can flag it if you want
 
@TonyTheTiger No! You'll get suspended.
 
10:47 AM
The Wiki Which Should Not Be Named.
 
@RMartinhoFernandes ok then, we just ignore it
 
sbi
7
Q: Is mentioning sex ok or is it not?

sbiAfter we had a discussion about sex on the Internet in Stack Overflow's C++ chat room yesterday, the room description was changed to something mentioning sex. Before you think you discovered something held back by me, I did this particular change, but it's by no means the first time sex was ...

 
All my friends who have boyfriends want to be single... All my friends who are single want boyfriends. As for me, I just want a hot slave.
Problem solved, thanks Debbie !
 
sbi
@TonyTheTiger That infamous bashing started with me copying this jokes.
 
I want hot food.
 
10:48 AM
@sbi I remember that discussion
 
sbi
@kbok Oh, I've drafted another Debbie fan. :)
 
@sbi damn :(
 
@sbi but that only got noticed on meta because Tina thought it was unsuitable, iirc
 
sbi
@TonyTheTiger I'd rather not. Let's just not put this into the room's description.
@jalf No. Tina didn't. Others thought it was unsuitable for her! That's what was so enraging.
 
@sbi I think that's what caused the biggest issue, putting it in the tagline
/me remembers the violent discussions around Tina
 
sbi
10:50 AM
@TonyTheTiger Actually, for some (like that Adam guy who chased me through all the comments), this just tipped them off.
 
@sbi yes but only because she had a habit of complaining whenever sex was mentioned
 
@sbi meh
@jalf yea I remember that she complained
 
@sbi bowing before the meta police. Never thought I'd see the day...
;)
 
sbi
@jalf, @Tony: Let's just say she had a habit of complaining.
 
@sbi That sounds retarded.
And sexist somehow.
 
10:51 AM
room topic changed to Lounge<C++>: 0.5 seconds is FOREVER... in bed. [c++] [c++11]
3
 
lowl
 
sbi
@RMartinhoFernandes Exactly my argument.
 
@CatPlusPlus lulz
so how long has Tina been gone for now?
she never morphed again into another form, after the Miss episode
 
Evolved into a train.
 
10:53 AM
Who is this Tina ?
 
don't ask, long story
a story of many furious discussions on this chat and in meta land
 
sbi
@jalf I'm old enough to have learned to know where making a stand is necessary (the room's tag line isn't, really), and where it's worth the fighting (against right-Christian zealots it isn't, because they won't be persuaded by arguments). I'm fine with doing another round of this, however, if you all would back me up. But look at the comment discussions on the question I linked to. That Adam Davis has upvotes on all his arguments, most of mine have none. That was not fun.
@TonyTheTiger I forgot. Was Miss banned, too?
 
@sbi she was blocked from asking questions on SO proper, is the last thing I recall
 
I think she left shortly after the system blocked her questions.
She tried asking here a few times after that, but met the usual resistance.
 
and then one day she disappeared out of the chat too, after we repeatedly refused to answer her questions, cause she wasn't listening
 
sbi
10:57 AM
@kbok If you really want to know, you might want to search for the first appearance of a user "miss" here. I wrote a little message essay to Miss explaining the events that took place here after Tina disappeared.
 
@RMartinhoFernandes where you around when Tina was around? I forget.
 
@sbi This seems a great way of wasting some more time. I'll check that out once I have found that C++ teen sex joke in complete form.
 
@TonyTheTiger I started chatting here about the time the issue got cold.
 
oh ok
 
@sbi well, the people whose opinion matters (the ones who are here, and who'd actually see the topic line) have no problem with sex jokes. Honestly, who cares what people who aren't here and don't have the necessary context think?
 
11:00 AM
meta police cares
 
if they bother to check the topic line and come here and figure out why it was posted and what to do about it
 
true that
 
I'll never understand people that discriminate groups that are common victims of discrimination, in order to fight their discrimination.
 
which they likely won't, if they're not acting on a complaint from someone
 
11:01 AM
so I'd just ignore the whole meta debacle, and post what we like here
 
that's been a while, this place has been fairly peaceful since...
 
Well, there are limits.
Like posting TVTropes links without warning.
 
besides the occasional argument, and the FredNurk thing
www.tvtropes.tv
 
sbi
@jalf Of course it's fine here. The trouble is that the madhouse meta will interfere with us due such things. And that, as we have learned, can get really ugly.
 
@TonyTheTiger I think the fact that it has TVTropes in the text counts as a warning.
 
sbi
11:02 AM
For example, a noteworthy fact is that Jeff publicly revealed Tina's true sex (I think in a comment to one of the answers to the question I linked to above), which he determined from private details of her profile, and which really got this room up and in arms for a day. You might want to take this into consideration for deciding, e.g., which email you give to SO.
 
@RMartinhoFernandes lol
 
@sbi yeah, but I think Jeff being a moron is pretty much independent of the amount of sex in this room's topic
 
sbi
@TonyTheTiger What about Fred Nurk? Didn't he leave in rage about someone? (Alf?)
 
@sbi people know my true sex, though not my true identity, if SO ever revealed that, I'm gonna be pissed
@sbi he did leave in a rage, don't remember who though
 
Mr. Anderson.
 
11:04 AM
lulz
 
@TonyTheTiger Might have been me. But tbh I can't remember either
 
sbi
@jalf All I'm saying is that I see no need to give him the opportunity to be a moron about us if there's no real need about it.
Lunch here. BRB.
 
My email is public, so they can reveal it all they want.
 
@jalf I do recall he was pissed at me for supporting whomever he was originally pissed at.
@CatPlusPlus funnily enough, a lot of people on this chat now know my real identity...
 
Big deal.
 
11:07 AM
it depends how you look at it, I guess.
 
@TonyTheTiger You're not Batman, are you?
 
@RMartinhoFernandes yea I wish
 
What? You want your parents murdered?
What a horrible person you are.
 
@RMartinhoFernandes I wouldn't want my parents dead, WTF?!?!!!
 
But that's how you become Batman!
 
11:09 AM
lol
lulz
 
If you're an alcoholic, how do you celebrate the fact that you've stayed sober for a whole year?
 
It's Norwegian girls dancing a Congolese dance thing. :-)
@sbi: "I might add that I totally disagree with the manipulation of history that seems to be so common here." right! i might add that trolls regularly do that.
 
@sbi I can't find it. Apparently the message search dialog does not know about that "sbi" guy. lol.
 
@kbok You can't go with sbi in the username box.
It needs a user ID.
 
11:16 AM
@RMartinhoFernandes You can type usernames and it translates it.
 
Oh, you meant that it doesn't show up in the popup thingy.
 
@RMartinhoFernandes Champagne!
Oh...
 
Ok, seriously, this search engine sucks.
 
@sbi he did?
 
Apr 14 at 17:53, by sbi
Since you asked, @Miss: When Tina/Model's messages suddenly disappeared, we asked what had happened to her (http://meta.stackoverflow.com/questions/87152/what-happened-to-that-user), and @Tony finally found out that she had been suspended. Most of us considered this a very bad move on behalf of SO.
Took me hours to find.
 
11:27 AM
Well, regarding Tina, Jeff sent me private e-mail about the end of that chat room. I think she had some run-in with Jeff earlier.
 
It is pretty difficult to have a public forum fit a person with disabilities.
 
@TonyTheTiger That seems broken.
@AlfPSteinbach Tina was disabled?
There, I FTFY.
 
idk, but the she had this notice on her account: "delete me". so maybe jeff did.
 
That's standard procedure for deletion.
If it sounds ridiculous, it's because it is.
If you want to delete your account, you need to put that text there.
And that doesn't mean she was disabled.
> You came in those pants? You're braver than I thought.
 
11:30 AM
he he star wars
 
lulz
> Search your pants, you know it to be true.
 
> "Don't do that, my pants are dirty." "My pants are dirty, too."
lol
 
> It appears you are to be the main course at a banquet in my pants.
This is pure romance.
 
Neither of your links works for me :(
 
Wait, I broke it when I tried to fix it.
Hmm.
 
11:33 AM
Ah, I get it. Some encoding snafu.
 
Damn Markdown.
 
I imagine that's what happened to Alf's link in the first place.
 
Hmm, I think Alf's issue is that he regularly posts links within [].
 
@RMartinhoFernandes huh, i do that only on facebook. what are you guys talking about now?
 
This:
2 days ago, by Alf P. Steinbach
[http://www.dagbladet.no/nyheter/2004/10/26/412462.html]
 
11:36 AM
3 mins ago, by Luc Danton
Neither of your links works for me :(
 
oh, sorry, i think that came from facebook
perhaps
in facebook, if you comment on something with just a link, or for that matter just a fragment of C code, nothing happens, but put link in brackets and you get lookup of the resource and icon etc., for a comment
or maybe any text will do
i haven't thought about it
 
2
Q: How can an object know if it has been allocated on the stack or the heap?

spraffstruct Foo { Foo (); }; int main () { Foo foo; // Case A Foo * p_foo = new Foo (); // Case B } Foo :: Foo () { if (allocated_on_stack) { // Case A } if (allocated_on_heap) { // Case B } } Can Foo's constructor distinguish these tw...

 
11:56 AM
There was an item for that in More Effective C++.
 
It was closed while I was writing an answer. That sucks.
 
lol
The amazon image reads "Click to look inside !"
You click. No effect.
 

« first day (310 days earlier)      last day (4630 days later) »