When actually primitive type constructor gets called & used?

118 views Asked by At

I know that similar kind of questions already asked on SO, but my question is different so please don't mark it as duplicate or as something else before you read it completely.

Bjarne Stroustrup in his book The C++ Programming language says that

10.4.2 Built in types also have default constructors

also read section 6.2.8 of same book.

The following links also says that built in types have default constructors in C++.

  1. http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=15

  2. http://www.geeksforgeeks.org/c-default-constructor-built-in-types/

But the answers on the following link says that built in types don't have constructors.

Also, read following links that says that statements like int i=int(); causes value initialization that basically ends up being zero initialization.

Here is the question I asked sometimes ago, that says what happen in case of int a=int() in C++98 & I got the answer as default initialization.

If I'm not wrong, there is no mention in the C++ standard or the C++ standard doesn't say that primitive types have also constructors. So, from Bjarne Stroustrup's book, can I say that it is conceptually true that they have constructors but practically there is no such thing like constructor exist for built in types? Is it really flawed text in his book? Or if it really true according to Bjarne Stroustrup's book when they are actually gets called & used?

0

There are 0 answers