Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Is the vptr at the beginning of an object?

Reply
Thread Tools

Is the vptr at the beginning of an object?

 
 
Ian Collins
Guest
Posts: n/a
 
      04-11-2010
On 04/11/10 05:00 PM, DaveB wrote:
> Ian Collins wrote:
>> On 04/ 5/10 06:21 PM, DaveB wrote:
>>>
>>> Another, and again, posting outside of the scope of the question.

>>
>> Then why don't you ask on a group or forum where it would get an
>> appropriate answer? You mention gcc and VC, they both have their own
>> groups.

>
> Well, I was hoping to get an answer from someone who has experience and
> knowledge across a number of popular compilers. Getting JUST the answer
> about gcc would have been "OK", but I didn't even get that. Where better
> than a C++ group to ask? While I don't NEED the answer anymore, I am
> still curious about it. When I first posted though, I did need the info,
> and certainly not dogma.
>
> The question remains unanswered, unless it's in one of the posts I
> haven't read yet.


That says a lot about the question! I'm sure most programmers, no
matter how experienced don't know the answer, because they've never
needed to.

--
Ian Collins
 
Reply With Quote
 
 
 
 
DaveB
Guest
Posts: n/a
 
      04-11-2010
Kai-Uwe Bux wrote:
> Joshua Maurice wrote:
>
> [...]
>> Again as a practical matter, when I hear people ask questions like
>> "what offset is the vptr at?", simply answering the question does the
>> group and the person a disservice.

> [...]
>
> True,


Noooo. It's not TRUE at all. He removed the context to suit his agenda.
Think about it again. I don't think you'll buy what he is selling.

>Choosing to _only_ provide that additional
> information and brushing off the interest in the original question
> with "who cares" could legitimately be viewed as rude or patronizing.


I don't need anyone to interpret the standard for me. I have a copy or 2
or 3 of the draft. I used to chat on IRC. The popular opinion is that
when a public room gets too dominating by one person or group, they
should make their own place, because it limits and constrains people. Oh,
it IS awfully convenient though huh. Nuff said.




 
Reply With Quote
 
 
 
 
DaveB
Guest
Posts: n/a
 
      04-11-2010
James Kanze wrote:
> On Apr 5, 11:19 am, Peter Remmers
> <(E-Mail Removed)> wrote:
>> Am 02.04.2010 23:12, schrieb DaveB:
>>> "James Kanze"<(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> On Apr 2, 12:16 pm, "DaveB"<(E-Mail Removed)> wrote:
>>>>> James Kanze wrote:
>>>>> > On Apr 2, 9:56 am, "DaveB"<(E-Mail Removed)> wrote:
>>>>> >> In practice, across most compilers, is the vptr at offset 0
>>>>> >> of a class object? I've found some posts that say GCC puts
>>>>> >> it at the end, but they were very old posts and I don't use
>>>>> >> it now so can't test it.

>
>>>>> > Who cares? What does it matter where the vptr is placed?
>>>>> > (And of course, many objects have more than one vptr, and
>>>>> > not all of them can be at offset 0.)

>
>>>>> If you couldn't answer the question asked, you shouldn't have
>>>>> bothered posting!

>
>>>> I gave the only relevant answer. It doesn't matter where the
>>>> compiler puts the vptr. It could put it anywhere, and change
>>>> where it puts it from one version to the next, or even with a
>>>> change in the compilation options. And of course, the question
>>>> doesn't even make sense, since objects may have more than one
>>>> vptr.

>
>>> Techno gibberish. I asked about common practice, not
>>> hypothetical theory, and it doesn't take anyone with one
>>> ioda of intuition to assume that I was talking about the
>>> simple case. Use of this forum to spout technobabble at
>>> any/every opportunity, is annoying at best. (If you can't
>>> help it because you are a nerd, then I apologize for not
>>> being cognitive of the affliction, and hope you get the help
>>> you need).

>
>> I agree.
>>
>> James wasn't able to come down from his noble steed and answer
>> a simple question.

>
> Excuse me, but I did answer the question.


"Excuse lil ol me", but dude, I asked the question and I still have it so
you have not done that, but I know you're just trying to infalible. Guess
what demigod: you're not a god. You "****ed up", and now "have ****ed up
royally". Deal with it. No one has answered my question, you still have
not and this is sad that the thread overall is about you. "Ain't no
****ng question anymore". Nope. It's all you babe.

> The fact that the
> correct answer to the question (i.e. the facts) doesn't happen
> to please the original poster is a different issue; I can't do
> anything about that, since the facts aren't likely to change.


I don't know how to help you. Psychologist? Nope, they are in your
circle. Psychiatrist? Nope, you're not crazy, I hope! Wait, let me
consult my crystal... ah! Of course. The crystal said to me, and surely I
am just the messenger, "the wind is a harsh mistress" and "time...". Does
that message from the crystal make sense to you? I think it means ...
well it doesn't matter what I think it means. I hope it helps! (You off
of your high horse so I can kick your butt! Just kidding.)

>
> [...]
>> Maybe this question is compiler specific and should be asked
>> in a compiler specific newsgroup.

>
> It's not that compiler specific, since every compiler I know
> does use multiple vptr, and none makes any guarantee with
> regards to where the vptrs will be in the object.


Keep hiding JK. I'd say I hope it works out for you in your own ng, but
1. I don't think you'd venture that far and 2. I thought this **** was
over a decade ago. Maybe you should do 2 just to prove that it isn't so??
Aww c'mon, I dare ya.


 
Reply With Quote
 
DaveB
Guest
Posts: n/a
 
      04-11-2010
Peter Remmers wrote:

I saved what I wrote in response, cuz off-the-cuff, I'm not that kind and
don't need or want to be.


 
Reply With Quote
 
DaveB
Guest
Posts: n/a
 
      04-11-2010
Öö Tiib wrote:
> On Apr 6, 12:43 pm, Peter Remmers
> <(E-Mail Removed)> wrote:
>>
>> Answering a question for internal workings with "none of your
>> business" is just silly.
>>

>
> You read "who cares" as "You should not care" or even "none of Your
> business" ... I read it "I don't care". Latter is closer on common
> case ... people usually talk about themselves and not about others. In
> any case "who cares" does not mean that "stop reading", since he
> further explained why worrying about it has no value.
>
> As for rest of that Jameses answer


I never meant this simple question to be about JK or stumping him. But
apparently, the facts show that he is stupid and can't answer the
simplest of questions, and surely for fear for his life someone should go
to his home and feed him oatmeal so that he can continue to live for all
hope for him would be lost if it were known to anyone that he gave the
wrong answer. I will retract my question to relieve myself of this burden
and hardship that anyone wants to bring upon me. I will not ignore him
though, for I am, of course, now, the C++ DEMIGOD! I wish him the best,
in his retirement.


 
Reply With Quote
 
DaveB
Guest
Posts: n/a
 
      04-11-2010
James Kanze wrote:

[some gibberish]

I am learning to think before I speak. Hey, maybe you should too? Just
kidding. I know I'm "older and playing with the kids in the sandbox".

I had a real question. And now, I mean no offense, so, what I do is send
my posts to "draft", when it is anything political, religious or sexual.
Haha, someone, more than one, told me that a long time ago: don't ever
talk about politics, religion, sex. Surely it was a politician. ... for
to curb thought, is to own.... what? A hundred years ago, there were not
cars. A hundred years later, people DREAM of a world without cars.


 
Reply With Quote
 
DaveB
Guest
Posts: n/a
 
      04-11-2010
Ian Collins wrote:
> On 04/11/10 05:00 PM, DaveB wrote:
>> Ian Collins wrote:
>>> On 04/ 5/10 06:21 PM, DaveB wrote:
>>>>
>>>> Another, and again, posting outside of the scope of the question.
>>>
>>> Then why don't you ask on a group or forum where it would get an
>>> appropriate answer? You mention gcc and VC, they both have their
>>> own groups.

>>
>> Well, I was hoping to get an answer from someone who has experience
>> and knowledge across a number of popular compilers. Getting JUST the
>> answer about gcc would have been "OK", but I didn't even get that.
>> Where better than a C++ group to ask? While I don't NEED the answer
>> anymore, I am still curious about it. When I first posted though, I
>> did need the info, and certainly not dogma.
>>
>> The question remains unanswered, unless it's in one of the posts I
>> haven't read yet.

>
> That says a lot about the question! I'm sure most programmers, no
> matter how experienced don't know the answer, because they've never
> needed to.


I posed the question to "programmers"? Is that what you meant? If so, I'm
so sorry. I didn't know.


 
Reply With Quote
 
Krice
Guest
Posts: n/a
 
      04-11-2010
On 2 huhti, 11:56, "DaveB" <(E-Mail Removed)> wrote:
> In practice, across most compilers, is the vptr at offset 0 of a class
> object? I've found some posts that say GCC puts it at the end, but they
> were very old posts and I don't use it now so can't test it.


Look what I found from internets:
http://www.devx.com/tips/Tip/14876

Might just work. I don't know, I don't care.
 
Reply With Quote
 
James Kanze
Guest
Posts: n/a
 
      04-11-2010
On Apr 11, 6:51 am, Ian Collins <(E-Mail Removed)> wrote:
> On 04/11/10 05:00 PM, DaveB wrote:
> > Ian Collins wrote:
> >> On 04/ 5/10 06:21 PM, DaveB wrote:


[...]
> > The question remains unanswered, unless it's in one of the posts I
> > haven't read yet.


> That says a lot about the question! I'm sure most
> programmers, no matter how experienced don't know the answer,
> because they've never needed to.


Most of the programmers I know do know the correct answer: "it
depends, and it might change with the next release of the
compiler, but it doesn't matter".

--
James Kanze
 
Reply With Quote
 
DaveB
Guest
Posts: n/a
 
      04-12-2010
James Kanze wrote:
> On Apr 11, 6:51 am, Ian Collins <(E-Mail Removed)> wrote:
>> On 04/11/10 05:00 PM, DaveB wrote:
>>> Ian Collins wrote:
>>>> On 04/ 5/10 06:21 PM, DaveB wrote:

>
> [...]
>>> The question remains unanswered, unless it's in one of the posts I
>>> haven't read yet.

>
>> That says a lot about the question! I'm sure most
>> programmers, no matter how experienced don't know the answer,
>> because they've never needed to.

>
> Most of the programmers I know do know the correct answer: "it
> depends, and it might change with the next release of the
> compiler, but it doesn't matter".

My "response" is saved. You have nothing to tell me while you think it is
a secret. There is nothing wrong with you or who you are. You are good.
You come with a label, that I KNOW is not you but your "brand".

I drink too much, duh. Programme against that. It's "my job" to call you
out.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
index of string from beginning of line vs beginning of file Jesse B. Ruby 9 03-27-2010 04:04 PM
vptr Rahul C++ 3 11-04-2007 12:03 PM
A basic doubt on VPTR and VTABLES Subhransu Sahoo C++ 4 11-07-2006 12:42 PM
Explanation of Vptr and V-table pai C++ 4 10-18-2006 02:09 PM
What is Data Type of Vptr pointer Veeru C++ 7 09-15-2006 10:00 AM



Advertisments