trivial or non-trivial object

B

baibaichen

hi, i am reading a C++ book, it mentions a term non-trivial object.
what i understand is:
if a object has:
a) trivial constructor
b) trivial assignment operator
c) trivial destructor

then it is a trvial object, otherwise it is a non trivial obect, right?

thanks
 
A

Alf P. Steinbach

* baibaichen:
hi, i am reading a C++ book, it mentions a term non-trivial object.
what i understand is:
if a object has:
a) trivial constructor
b) trivial assignment operator
c) trivial destructor

then it is a trvial object, otherwise it is a non trivial obect, right?

"Trivial object" is not a term defined by the standard or in common use as a
technical term. It probably means just what it says, like, "green bird".
 
J

Jim Langston

baibaichen said:
hi, i am reading a C++ book, it mentions a term non-trivial object.
what i understand is:
if a object has:
a) trivial constructor
b) trivial assignment operator
c) trivial destructor

then it is a trvial object, otherwise it is a non trivial obect, right?

thanks

"trivial object" is not a standard C++ term. He is probably refering to POD
or not. POD being plain old data.
 
O

osmium

baibaichen said:
hi, i am reading a C++ book, it mentions a term non-trivial object.
what i understand is:
if a object has:
a) trivial constructor
b) trivial assignment operator
c) trivial destructor

then it is a trvial object, otherwise it is a non trivial obect, right?

There are a bunch of hits on Google for <trivial object c++>.
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top