G
Gianni Mariani
dropping comp.lang.c ...
Which version of MSVC are you using ?
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Are you saying it should not work ? Please explain. Templates *are*
made for arithmetic, it says so in the standard. Also, if your code did
work, try finding the number of set bits in int(-2).
Generally, C++ compilers today are much better at conforming to
standards than they were a year ago. There is a conforming solution to
this problem that is accepted by all the `recent' compilers.
That's nice. This is a hypothetical situation that you decided to
engage in an attempt to answer your question. Re-read the response in
that light and you'll see there is no insinuation or understanding of
candidacy.
Are you saying there is no portable answer ?
You should try it some-time.
What's not MSVC 2003 ? The outside of the box it came in says "Visual
Studio Professional Version 2003".
This NG is about the C++ standard. If you think there is no "standard"
answer then I'd like to know about why you think so. Otherwise you're
just pontificating and I'm not one for tolerating "religion".
That would be a good thing for you to do.
If you care to know, which I suspect more than likely you don't, the
problem here has more to do with what happends before ~Task is called.
There is no state to set up the object.
How do you know this is exposed ? This may be deep inside an
implementation. Oh - wait a minute, is this pontification again - yep,
I said it before, Religion !
As I said, this is a pre-interview questionaire. How do you know my
answers are wrong since you don't have them yet ?
* Gianni Mariani:
Worked fine with Visual C++ 7.1, at highest warning level. 2 Anyway, as I
stated, _don't do that_. Templates were not made for arithmetic, much
less bitcounting.
Which version of MSVC are you using ?
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Are you saying it should not work ? Please explain. Templates *are*
made for arithmetic, it says so in the standard. Also, if your code did
work, try finding the number of set bits in int(-2).
Generally, C++ compilers today are much better at conforming to
standards than they were a year ago. There is a conforming solution to
this problem that is accepted by all the `recent' compilers.
I do not accept the label 'candidate', nor that the insinuation that I'm
not rigorous.
That's nice. This is a hypothetical situation that you decided to
engage in an attempt to answer your question. Re-read the response in
that light and you'll see there is no insinuation or understanding of
candidacy.
I don't, however, do a long research project to get something portable
for a usenet posting where I'm warning you that it's not likely to be
portable -- what the &/()=? would be the point of that?
Are you saying there is no portable answer ?
Get a grip.
You should try it some-time.
That's _not_ MSVC 2003 (aka 7.1); not very rigorous of you...
What's not MSVC 2003 ? The outside of the box it came in says "Visual
Studio Professional Version 2003".
[umpteen lines of compiler error message]
That's one reason why it's not a good idea, yes.
This NG is about the C++ standard. If you think there is no "standard"
answer then I'd like to know about why you think so. Otherwise you're
just pontificating and I'm not one for tolerating "religion".
....
That's impossible to know in detail without knowing at::Task, but
in general terms, at::Task::~Task is executed, and 'main' returns.
Do you mean that what's "wrong" is somehow buried in at::Task::~Task,
which isn't defined in the question?
That's an interview I'd walk out of very very quickly.
That would be a good thing for you to do.
If you care to know, which I suspect more than likely you don't, the
problem here has more to do with what happends before ~Task is called.
The generated constructor is not OK: it doesn't take arguments to set
up the state of the object.
There is no state to set up the object.
Exposing public data members is something only the worst programmers do.
How do you know this is exposed ? This may be deep inside an
implementation. Oh - wait a minute, is this pontification again - yep,
I said it before, Religion !
If you're interested in getting better than the very worst, don't show
that code in interviews -- or include the wrongness in your "answer".
As I said, this is a pre-interview questionaire. How do you know my
answers are wrong since you don't have them yet ?