471,122 Members | 851 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,122 software developers and data experts.

Object Splicing

Hello all,

Can you explain me the basic concept of "OBJECT SPLICING" ? When does
it occur?

Thanks,
Anunay

May 17 '06 #1
5 4140
Anunay wrote:
Hello all,

Can you explain me the basic concept of "OBJECT SPLICING" ?
splicing or slicing?
When does it occur?


If you are talking about slicing:

struct A
{
int first;
};

struct B : public A
{
int second;
};

int main()
{
B b;
A a = b;

// 'b' was sliced: its B part (b.second) was not
// copied into 'a' (because it doesn't exist)
}

If you are really talking about "object splicing", then I don't know
what that is.
Jonathan

May 17 '06 #2
* Anunay:

Can you explain me the basic concept of "OBJECT SPLICING" ? When does
it occur?


It's not a C++ term or concept.

So it's off-topic in [comp.lang.c++].

I've set follow ups to [comp.programming].
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
May 17 '06 #3
In article <1147875257.580597.9220
@g10g2000cwb.googlegroups.com>, an*********@gmail.com
says...
Hello all,

Can you explain me the basic concept of "OBJECT SPLICING" ? When does
it occur?


I think you've misunderstood a reference to "object
slicing". This results from converting a derived object
to a base object -- everything that's not present in the
base object gets sliced off, leaving only a base object.

--
Later,
Jerry.

The universe is a figment of its own imagination.
May 17 '06 #4
Thanks all. I, by mistake, typed "splicing" at both places.

May 18 '06 #5
Joe Van Dyk wrote:
Alf P. Steinbach wrote:
* Anunay:

Can you explain me the basic concept of "OBJECT SPLICING" ? When does
it occur?


It's not a C++ term or concept.

So it's off-topic in [comp.lang.c++].

I've set follow ups to [comp.programming].

Assuming that the OP meant "object slicing", isn't that a C++ topic?

Joe


Err, C++ concept, not topic.

Joe
May 22 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by lawrence | last post: by
1 post views Thread by Bijay Kumar | last post: by
28 posts views Thread by Daniel | last post: by
7 posts views Thread by Nick Zdunic | last post: by
reply views Thread by Bijay Kumar | last post: by
26 posts views Thread by yb | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.