Object Splicing

A

Anunay

Hello all,

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

Thanks,
Anunay
 
J

Jonathan Mcdougall

Anunay said:
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
 
A

Alf P. Steinbach

* 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].
 
J

Jerry Coffin

@g10g2000cwb.googlegroups.com>, (e-mail address removed)
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.
 
J

Joe Van Dyk

Joe said:
Alf said:
* 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top