« first day (175 days earlier)      last day (4770 days later) » 

12:46 AM
*room topic changed to Lounge<C++>: C++: better than Java, C#, C, JavaScript, and VB. *
 
lol
 
I did not mind the previous description, but apparently others did.
 
sbi
1:08 AM
@studiohack Well, so flag it. <shrug/> That's what you get for pissing off the Grumpy Old Man. You are hilariously silly, infantile, and an outright affront to my culture and upbringing. You are also only the third person in here to get me fuming. IOW, you deserve much worse.
 
1:22 AM
I have no desire to have a flame war or anything...just wanted to keep the site high-quality in general.
okay @sbi? no hard feelings between us personally? I want to get along...
 
sbi
And this will be the last I will ever have read from you. <plonk/>
 
:|
 
1:44 AM
Oh no, can`t we talk about sex here anymore? :(
 
hello. If I iterate over the keys of either side of a Boost bimap, will the keys be ordered?
 
@jweyrich No, no. You misunderstand. You can still talk about sex. You just can't talk about talking about sex. I believe it is the meta-sex that people find to be offensive.
@RafaelAlmeida Yes. "A bimap<X,Y> can be thought of as a combination of a std::map<X,Y> and a std::map<Y,X>."
 
great :) thanks
 
@JamesMcNellis oh, my bad.
Kama Sutra should definitely be adopted as the new standard. There's much less undefined behaviours at least.
2
 
2:36 AM
FYI, an amazingly good TechTalk: No Time to Think - youtube.com/watch?v=KHGcvj3JiGA
 
3:04 AM
Hmm, that complaint question has vanished from meta... unfortunately I don't have 10k on meta and thus don't know what happened to it.
 
3:15 AM
Hey James, I just saw that you commented saying that you should avoid "using namespace std;" at all cost. I'm only in my second term of C++, but we use it in every program we write.
 
@JustinStryker I can tell you a story about why it is an awful thing. A friend of mine is just learning C++ this year as part of an MS program in CS. I warned him before he started never to use using namespace std;, but he used it anyway at the recommendation of his professor. During their midterm exam, there was a question similar to this: given a function void swap(int* x, int* y) and variables int a, b, how would you swap those two variables?
 
@JustinStryker "At all cost" is exaggerating (but not much). Don't do it, but realize that there are times that it's not necessarily a terrible thing.
 
Well, he wrote swap(a, b), which is not correct, and he got marked off for that, but he goes back to test it; unfortunately, in his test, he started off with #include <iostream> followed by using namespace std;. <iostream> happened to pull in std::swap, so his wrong code "worked," even though it wasn't using his function.
That wasn't a very good story. It's true, though: he was quite confused until I pointed out that the wrong swap was being used.
@JerryCoffin Well, I did follow that statement with "really, though, the costs of avoiding it are minuscule and the benefits of avoiding it are great"
22
A: Why is 'using namespace std;' considered a bad practice in C++?

sbiI agree with everything Greg wrote, but I'd like to add: It can even get worse than this! Foo 2.0 could introduce a function Quux() that is an unambiguously better match for some of your calls too Quux() than the bar::Quux() your code called for years. Then your code still compiles, but silently ...

@sbi's story is better.
 
So instead of using the function he wrote, it was using a function in std? Wouldn't that cause his function to prevent the compiling of his program?
 
@JamesMcNellis In reality, swap is one of the places that it can be useful. Assume you're writing a sort that obviously uses swap. If there's a swap defined for the type being sorted, you want to use it, but otherwise use std::swap. One way to solve this is using namespace std; before the sort, and just swap inside it. If there's a swap in T's namespace it'll be found via ADL; otherwise, std::swap is found and used.
 
3:27 AM
@JerryCoffin Right, and the C++0x Standard Library takes advantage of that via the new Swappable concept. A using namespace std; isn't required there, though: using std::swap; will suffice.
@JustinStryker Right, it was using std::swap, which was a better match (std::swap is a function template that has two parameters of type T&, so it was an exact match with T = int). His function didn't match at all (he was passing two int, but his only took two int*). Thus, overload resolution picked std::swap, which was brought into the global namespace via using namespace std;. But, yes, the program still compiled because in C++ functions can be overloaded.
There are a handful of other examples on Stack Overflow where Standard Library functions were accidentally used. I remember one in particular involved std::distance.
 
@JamesMcNellis I know that Classes can be overloaded for initializing variables, does it work the same way within a function?
 
@JustinStryker What do you mean by "classes can be overloaded for initializing variables"? (Can you give an example? That might help me to explain.)
 
Like when you are making a class, you can choose to write default and overloaded constructors for creating your object with different initial variables.
 
@JustinStryker Right. Normal functions can be overloaded too, so you can have both void f(int x); and void f(double x); declared in the same namespace together and if you call f(42), the first will be called and if you call f(3.0), the second will be called.
 
@JamesMcNellis I see. Please excuse my ignorance, but doesn't the overflow constructor have to be declared within the function it is referring to, and if he declared it outside as a separate function, does his code run if the proper arguments are passed to it? (Does overflow functions execute different code based on the arguments passed to it?)
 
3:44 AM
@JustinStryker Consider, as an example, this program: ideone.com/5jgnS
 
@JamesMcNellis 'tis true -- as I said, it's one way to deal with the problem. I first used it long enough ago that some compilers libraries (gcc) weren't in namespace std yet, so the using std::swap; would fail too...
 
@JerryCoffin Eeewwww
 
@JamesMcNellis Yes -- I once proclaimed "free" software to be the "most expensive" type. For some reason, a few people didn't seem to like that much!
 
@JamesMcNellis !!! That opens up so much For some reason, I thought that overload constructors were only for the initialization of variables, I know you could use code within them, but I though it was only for setting variables based on the arguments passed. I didn't know you could do anything within them. Thanks!
 
But, I should probably shut up about it -- this subject has been discussed to death and back many times before (e.g.: groups.google.com/group/comp.lang.c++.moderated/browse_frm/…) with no real resolution (and some pretty "high-powered" opinions involved too).
 
3:50 AM
@JustinStryker If you are serious about learning C++, I'd recommend getting a good introductory C++ book. There are hundreds of really awful books out there, and it is much easier to learn the language with a good book.
The book by Stroustrup is highly recommended by many if you are new to programming (I haven't read it.).
@JerryCoffin Ha! That thread is like a who's-who of C++ programming.
 
At the moment we are using Starting out with C++ early objects by tony gaddis, but please remember that I'm in my second week of my second term, so my knowlage is limited.
@JamesMCNellis Thanks for the info!
 
@JamesMcNellis How could you say that? I'm pretty sure I didn't post to that one at all! :-)
 
@JerryCoffin That's why I said "like" :-D
 
@JamesMcNellis good Cover. Of course, I did once express my opinion on the subject rather freely: groups.google.com/group/comp.lang.c++.moderated/msg/….
 
4:32 AM
@JerryCoffin I'd be ok with replacing using namespace with drag_in_everything_from_namespace std; :-)
 
 
3 hours later…
7:54 AM
Good morning my fellow coders!
i.imgur.com/63YL2.jpg best news since quite a while :)
 
sbi
8:25 AM
@JamesMcNellis Meta-sex is talking about sex. Talking about talking about sex is meta-meta-sex - which makes you talking about talking about talking about sex meta-meta-meta-sex. Let me recap that: meta is fine; meta-meta isn't; since you did it, meta is fine, meta-meta-meta seems fine, too. What the fuck?! (And, yes, I'd have written that as WTF, but now I got worked up over this.) These restrictions are so illogical, it makes my head hurt. Oh, and did I mention this whole thing is ridiculous?
@JamesMcNellis Interestingly, I got the Announcer batch for sharing it on twitter. I didn't even know I had so many subscribers on twitter. I now have a badge that links to a question which doesn't exist anymore. I hate it when the cleaner fishes change history and sweep stuff under the carpet by deleting it.
(And I wonder how the system knew those visitors were coming from Twitter. Through the http referrer?)
@JamesMcNellis This one?
@JerryCoffin Nonono, don't let yourself get silenced about this. (In fact, don't let yourself get silenced about anything. Gag orders are always bad.) Free stuff often comes with expensive strings attached. I remember an interview with Stroustrup where he says that there will always be a place for commercial programming. It's the boring and annoying kind of stuff, that free software will never tackle, because it's not hip to hack at it, while people will do it if it pays the bills.
 
8:45 AM
@sbi WOW that got really theoretical! Have you saved meta-data to back yourself up?
 
sbi
9:26 AM
0
Q: Is mentioning sex Ok or is it not??

sbiAfter we had a discussion sex in 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 mentio...

Note the tags.
 
@sbi I created a meta account to upvote it :)
 
sbi
@Tony Haha!
 
@sbi If you want my take on it, that's not a subject that should be taken 'offensive' or any other way, sex happens to be a part of life and you should be open to talk about it or laugh about it.
 
@sbi I love the [sex] tag ;)
2
 
@jalf agreed! Good tag! :)
 
9:36 AM
also, interesting experiment. I set my little brother, who's never programmed before, down in front of a python interpreter last weekend, and now, a week later, he sent me a guess-the-number game he wrote.
what fascinates me is that it's more or less written in a functional style. No global state whatsoever, no classes. But a couple of nested functions
 
@jalf pretty cool! :)
 
he even wrote his own ad-hoc rng, using a seed you pass in explicitly as a parameter
 
@jalf wow smart kid :)
@sbi someone already removed the sex tag!!! :(
 
sbi
I was waiting for that to happen.
 
well, it was the wrong tag anyway. Should've been [meta-sex], obviously
your question isn't about people having sex in the chat, after all ;)
 
sbi
9:52 AM
@jalf I put the tag back and added a remark pointing out to the hilarity of the removing of it. )
Openly and repeatedly criticizing Jeff didn't get me banned (although I got an email from Jeff warning me of continuing that). However, attempting to openly discuss sex might just do that. What a sad state of affairs this is.
 
@sbi hah, he actually emailed you?
By the way, the Michael guy left a comment. I told you, meta-sex is a more accurate tag (plus, it sounds funnier) ;)
 
sbi
@jalf I already answered the hypocrite. Feel free to solve the dispute by changing the tag to meta-sex. But you would have to explain how that would be more right than sex.
 
btw, you've got to hand it to Jeff. Given how much the you and I have disagreed on what's appropriate for SO, it takes a special skill to make both of us unhappy ;)
 
sbi
@jalf Yes:
> Hi sbi,
> Please try to keep your comments and questions constructive on meta.
> Constructive discussion and suggestions are always welcome, but endless shrill whining is not. This is considered trolling, which is harmful to our community.
> Thanks,
> Jeff
@jalf Does it? I didn't notice you being so different from me.
 
@sbi really? :(
 
10:02 AM
@sbi the C++ faq ring any bells? ;)
 
sbi
@jalf Approved your edit. :) Now that hypocrite got himself two sex-related tags instead of one.
@jalf Oh c'mon! So we disagreed about one thing. Unless you're been holding back everything you see something said by me which you despise we agree on a lot more topics than we disagree on.
 
@sbi dunno, I think that, and the associated "how do we deal with newbies asking the same three questions ad nauseum" is a pretty fundamental disagreement
but yeah, we agree on wanting SO to be a useful resource for programmers (and I guess Jeff has other priorities)'
Sweet, got an organizer badge for adding [meta-sex] to a question.
I bet that doesn't happen often
by the way, I still disagree with the idea of having a SO chat too
Me actually being on the chat hasn't changed that! ;)
 
@jalf what's your disagreement on that?
 
sbi
@Tony It's wasting his time?
@jalf: What suspicions do you have about which room??
 
alfs and tinas private room, obviously ;)
my misgivings about the chat? I feel that trying to turn SO into a community is harmful. It risks leading to too much elitism/clique-forming, with the people who hang out in chat and getting to know each others and forming opinions on how SO should be run
with everyone else being out of the loop
one of the things that initially attracted me about SO was that it didn't try to be a community, just a place where you could go and ask/answer questions, regardless of your connections, and regardless of who you knew
 
sbi
10:13 AM
@jalf Ah, that one. I don't like users making that kind of remarks about that. I consider it infantile.
 
@sbi that's why I kept it vague and tried not to mention names ;)
but you just had to ask anyway ;)
 
I posted a brief my two cents on your question @sbi
probably not gonna be very popular, but I couldn't care less...
@jalf that is a very suspicious room... :P
 
by the way, @sbi, you can't just mention sex on the internet, and then be surprised when people get infantile ;)
 
sbi
@jalf Among my friends and colleagues I'm well known for blurting out about the elephant in the room everyone tries hard to not to look at. It's a reputation I don't have any problem with. :)
@Tony Yep, I already commented on it.
@jalf <snort/>
 
so anyway, I'd better get back to wrestling with gdb
 
10:22 AM
@sbi ok made an edit
 
sbi
@jalf Please tell me how a website where users have to log in, know each others by nicks and avatars, sort themselves by topics according to their interests, and engaging in technical discussions about said topics, can not be considered a community. That's hilarious.
@Tony Removed my comment, kept the upvote. :)
 
@sbi Simple. SO didn't originally have much support for discussions, it was a pretty straight Q&A format. There isn't even a way to contact another user directly
 
@sbi :)
 
sbi
@jalf AFAIK, people were discussing technical topics in comments from the very beginning.
 
of course, as a regular you can't help getting to know some of the other regulars, but I think it was a strong point of SO that it was never about those relationships, but strictly about questions and answers
 
10:25 AM
@JerryCoffin Similarly, I like the example (does not bring all std:: but only std::swap into context) of implementing your own swap function:
 
sbi
Oh, and I forgot to mention that said website revolves all around the concept of gathering "reputation"! That's as community as you can get.
 
struct test {
   int x;
   void swap( test& other ) {
       using std::swap;
       swap( x, other.x ); // without the using std::swap this will fail
   }
};
 
@sbi not really. A community is where people know each others and have some kind of involvement with each others. That's what the chat gives you, and what SO didn't originally have
 
That is about the only place where I employ the using statement
 
sbi
@jalf I introduced a new tag, too, but it seems I didn't get a badge for it. <pout/>
 
10:27 AM
@sbi must be because my tag is better ;)
 
sbi
@DavidRodríguezdribeas Note that this a function-local using declaration, rather than a namespace-scoped using directive. I have very little against those, although, except for that one unfortunate syntactical necessity, I find them wholly unnecessary.
@jalf Or maybe they have a filter for their badge-bot weeding out tags like sex which failed at your meta-sex. :)
Anyway, I gotta leave, and might not find the time to check here for the rest of today. So please keep me posted about what happened, in case this question gets deleted, too, and I'm back at square one, not knowing why and whether I should take this as agreement or disagreement.
 
11:13 AM
woah
 
 
1 hour later…
12:25 PM
hmm
 
@JohannesSchaublitb hi
 
hello there
 
Hmm, suppose I have a class containing a member m of type std::aligned_storage<x,y>::type, into which I store another object (of some unrelated non-POD type T) using placement new. What is the well-defined way to cast a pointer to m to T*?
 
1:01 PM
Current topic is too serious. Serious is offensive to me.
 
@PiotrLegnica Be offended! :)
 
how do you change the topic, btw?
 
Probably from 'roomâ–¼' menu.
 
ooh, quite likely
hmm, or not. At least I can't find it
 
1:18 PM
@jalf maybe you're not a room owner?
@jalf go to info and then you can edit the topic there, since you are an owner of this room :)
 
oooh, there
now I just need a better topic
 
@jalf sex sex sex :P
 
too soon. I believe some people are still recovering from the traumas it caused earlier ;)
room topic changed to Lounge<C++>: where three-letter words are even more offensive than singletons
4
 
@jalf nice one :)
 
1:54 PM
hey
I haven't seen him
 
@jalf but TLA are awesome!
 
2:07 PM
anyone wanna enlight me?
1
Q: Why does this initializer_list use misbehave when passing strings?

Johannes Schaub - litbI've tried the C++0x initializer-list implementation of my G++ version but it outputs only empty lines. #include <initializer_list> #include <iostream> #include <string> int main() { std::initializer_list<std::string> a({"hello", "stackoverflow"}); for(auto it = a.b...

 
3:06 PM
@tina I'm not a VB programmer, but I think they default to private
ugh, I don't think I'll ever learn to remember which stringstream header is the non-deprecated one
 
sstream. Took me a while, too.
 
well, it's taken me something like 6 years so far, and I still get it wrong every time
 
3:23 PM
@tina "Coming" is only spelled with a single 'm' ;)
 
3:54 PM
@tina according to the starred posts, he surrendered to Java and turned into jalf. I'm so sorry for your loss.
@tina please, don't take me seriously. It was a joke.
22 hours ago, by StackedCrooked
jalf is the java port of alf, heehee
I would tell you about his wedding, but it might hurt your feelings. And I sincerely hope he doesn't kill me after that.
 
4:12 PM
don't worry so much, @tina, he's probably just busy :)
 
@tina Sorry, I haven't been present in this chat for months so I can't say where he is or isn't. I actually "know" him only from this chat (and probably SO).
@tina I have the right to say whatever I wish, you like it or not. But I won't go further into this. Good luck!
 
what do you mean?
@tina he's just joking. There's no law against that, even if you don't think the joke was funny :)
 
@tina three-letter for you: LOL (sorry if it's prohibited/censored here).
@jalf are you okay today?
 
I am exceedingly okay. I haven't been so okay for weeks
no clue. I don't think anything happened to me.
 
@jalf oh good to hear that. Also thanks for proving my point.
 
4:21 PM
whose?
oh, nah, I've never met him, except for here
 
@tina I never did. Relax.
 
probably referring to the room topic
2 hours ago, by jalf
room topic changed to Lounge<C++>: where three-letter words are even more offensive than singletons
which again refers to the old topic having 'sex' in it :)
well, he's one of the owners :)
there are 14 of us, as far as I can see
 
hi can anybody tell me how to calculate rising star ?
 
what star?
 
Ascendant (rising star formula)
zodiax
anybody ?
 
4:30 PM
hm
didn't even find the desctiption :(
 
@FilthyNight you might want to post it as a real question at Mathematics.SE. Not sure if there's an astrology SE site, yet.
 
maybe i know it AKA
 
ye its astrology but mathematics as well i guess
no its just based on some calculations
like date of birth
place and etc...
 
oh my
and it results in some "perosnal number"?
*personal
 
mean ?
okay 1 more thing
why i cant put question here
i mean on stackover flow :@
 
4:35 PM
don't know. Why can't you?
 
why i get blocked plus i could not find a place to see why i am being kicked out
is there any place i can ask or something like that ?
 
about > contact us
 
email, who would check that
 
lol
 
i dont think so, must be some fking place where they should tell that "OKAY THIS IS WHAT YOU DID WRONG" :@
 
4:37 PM
@FilthyNight the people whose email it is
 
hmmm
i am so dead
 
why is that?
 
i have to complete this project tonight else my weekend will be on :@
yup
 
@FilthyNight should've started earlier then. :)
 
everything clear but i am stuck with this formula from yesterday :(
 
4:38 PM
do you have the formula?
or not?
 
50 50 :D
The ascendant ( or As), or rising sign, is the zodiacal sign and degree that was ascending on the eastern horizon at the specific time and location of an event. According to astrological theory, celestial phenomena reflect or determine human activity on the principle of 'as above so below'. Thus astrologers believe that the ascendant signifies a person's awakening consciousness, in the same way that the Sun's appearance on the eastern horizon signifies the dawn of a new day. Because the ascendant is specific to a particular time and place, it signifies the individual environment and cond...
here is the link but way above my head
 
@FilthyNight Do not make your lack of planning our urgency.
 
oh my
 
must be in miles or light year may be
 
@jweyrich does he?
 
4:40 PM
no sir, i am not asking you to help me out and leave your works
@jw
 
well, what exactly is the problem?
 
carry on
:)
could not figure out what or how to do it
 
the formula is listed clearly on the wikipedia page. What is the problem with it?
 
think i understand the problem
thou the formula is quite clear, it's usage isn't
 
yes sir :(
 
4:42 PM
inclination of Earth's equatorial plane to the ecliptic or obliquity of the ecliptic
ok, show me the Bradis table :)
@FilthyNight i think the best thing to do is to leave precise numbers to the users
)
 
i wish tina, i could not figure a simple formula :D
 
@tina guess this is an astrology, not astronomy :)
 
@suddnelyme you mean i ask him for this ?
 
numerology to be precise
@FilthyNight him - whom?
 
if user gives dob, location and time and year
is there anything else i need to do this formula ?
i meant user
 
4:45 PM
yep
 
@tina you're thinking of astronomy, not astrology, I believe :)
 
you should calculate E
if location is given
and local time also
E is your problem, needs some other formula to be calcualted
 
yup
but the question remains :( how :(
 
seems like the page lists the two possible values
For values referred to the standard equinox J2000.0 use 23.4392911°, for J1950.0 use 23.4457889°
 
4:49 PM
will these remain constant ? all the time no matter what ?
 
jalf they are just to
 
sounds like it to me
 
nope guys :)
 
but I'm not an astrologer :p
 
hey guyz, thank you very much
 
4:50 PM
neither, but i know what precession is :)
 
i appericiate your effort and time
regardless of issue being solved or not but all of you thanks
 
gl hf
 
cheers
@tina you from pak as well ?
all gone ? or me gone :D
 
sbi
5:07 PM
54 mins ago, by jweyrich
@tina Sorry, I haven't been present in this chat for months so I can't say where he is or isn't. I actually "know" him only from this chat (and probably SO).
@jweyrich Let me guess: You've been tempted to come again due to the three-letter word, right?
I see that my question still isn't deleted. So Jeff's probably still in bed. :)
4
Anyway, just came in, going to leave again right away. See you!
 
@sbi precisely! The three-letters word brings a whole shiny new motivation.
 
 
1 hour later…
6:17 PM
there are, i think, two kinds of people. those who find the sound of a heartbeat reassuring. and those who freak out waiting for a skip.
 
10 kinds of people.
 
i understand binary then ;)
 
no, there are three kinds of people. those who can count and those who can't
2
 
don't get it
 
cpx
6:37 PM
there are people who like c++ and there are people who learn c++.
 
6:54 PM
@cpx and there are people who have a misguided idea about C++, and don't like it..
 
sbi
@tina I'm sure that was a joke. @Alf lives in Norway, whereas @jweyrich lives in South America. It's very unlikely the latter knows anything personal about the former. I guess nobody here knows anything about why Alf disappeared a few days ago. IIRC, he has done this before, and came back afterwards. Just be patient.
If you want to find out whether Alf has abandoned Stack Overflow or whether he dropped completely off the map, try to find out whether he's still on comp.lang.c++.moderated. He's a moderator there and ought to do his share of moderating incoming questions. Even if he isn't there, one of the moderators there might know whether he's sick or whatever else happened to him.
But be very careful with that newsgroup. That's a high-volume, high-quality, strictly moderated newsgroup. You might find yourself filed away as a spammer before you had the chance to install a spell checker, and never get the chance to reach anyone there again.
@tina First you could check whether he posted there. If not, check whether any of the postings in the last 12/24/72/whatever hours was approved by him. If all fails, you might want to contact the other moderators. But, don't expect any answer. And, as I said, be very careful when trespassing there. Compared to the rules in this Newsgroup, Stack Overflow is a children's dream of a lawless place.
Anyway, I'm off to visit a very good friend who's birthday is today. I might drop in here again tonight when I'm drunk coming back from the feast. Or I might not. :) I hope you all have a nice time meanwhile.
 
7:16 PM
@sbi have fun ;)
 
7:42 PM
I have just learned about arrays and vectors. We have covered how arrays can have any number of dimensions, and that vectors are similar to a one dimensional array. Is it possible to have a multi-dimensional vector?
 
7:52 PM
@JustinStryker by vector, do you mean the C++ standard library vector, or the mathematical concept of a vector?
 
@jalf C++ standard library vector
 
then no, not really. A vector is one-dimensional. But you can have a vector where each element is another vector, giving you something kind of like a multi-dimensional vector
 
@jalf I see, and what about objects. I know I can create an array of objects, does that work with vectors as well?
 
yeah
a vector is basically just a dynamically sized array of objects
of any type of object
 
It wouldn't be very useful if it couldn't do that. :P
 
7:56 PM
you can have vectors of ints, of strings, of vectors, or of your own object type or anything else
 
Array: Class object[n]

Vector: Vector <Class> Object(n) ???
 
The rule of thumb is that you shouldn't use raw arrays, unless you know you need them.
 
@PiotrLegnica what is a raw array?
(also, is my vector of objects syntax right?)
 
@JustinStryker Array that hasn't been cooked yet. ;) I call T foo[x] 'raw' (or plain), I don't really know if it's commonly used or is it just me.
 
@PiotrLegnica What would be an example of a "cooked" array?
 
8:13 PM
Vector, or boost::array.
 
So a vector is a cooked array?
 
@JustinStryker A vector is more like an array with clothing.
 
 
3 hours later…
cpx
11:02 PM
Does the compiler generated assignment operator guard against self assignment?

class T {

int x;
public:
T(int X = 0): x(X) {}
};

int main()
{
T a(1);
a = a;
}

Do I always need to protect against self-assignment even when the class members aren't of pointer type?
0
Q: Assignment operator - Self-assignment

cpxDoes the compiler generated assignment operator guard against self assignment? class T { int x; public: T(int X = 0): x(X) {} }; int main() { T a(1); a = a; } Do I always need to protect against self-assignment even when the class members aren't of pointer type?

 

« first day (175 days earlier)      last day (4770 days later) »