7

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?

Community
  • 1
  • 1
Destructor
  • 14,123
  • 11
  • 61
  • 126
  • 2
    Did you read the top two answers of the question you've linked to? Which of your questions do they not answer? – Praetorian Jun 08 '15 at 16:18
  • 1
    Your question is a duplicate, whether you think so or not. Bjarne's quote is quite clearly addressed in both the question, and the accepted answer. – Benjamin Lindley Jun 08 '15 at 16:31

0 Answers0