473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Are Built-in Data Types also Classes

Prof. Bjarne Stroustrup said "built-in data types have default
constructor" at §10.4.2 in `TC++PL, special ed.'.

He also said that "built-in data types are not classes" at §11.4 in
`TC++PL, special ed.'.

(Sorry, I'm reading a Chinese edition of the book, and can't get a
English edition handy currently. Perhaps these words are not same as
his book, but I think the meaning is the same.)

Can I take Built-in Data Types as Compiler Defined Types. Then it's the
same as class (UDT) at this point.

Sep 8 '05 #1
3 1893
lovecreatesbeauty wrote:
Prof. Bjarne Stroustrup said "built-in data types have default
constructor" at §10.4.2 in `TC++PL, special ed.'.
Yes, _syntactically_ and _semantically_, not *literally*.
He also said that "built-in data types are not classes" at §11.4 in
`TC++PL, special ed.'.
Yes.
(Sorry, I'm reading a Chinese edition of the book, and can't get a
English edition handy currently. Perhaps these words are not same as
his book, but I think the meaning is the same.)
Pretty much. I don't have my copy of the SE handy either, but I am
certain that you quote it correctly.
Can I take Built-in Data Types as Compiler Defined Types. Then it's
the same as class (UDT) at this point.


What do you mean by "can I take"? The important difference is that
the built-in types (a) have some conversions defined that are implicit
and (b) have predefined operators that cannot be redefined and (c)
have no member functions. The similarity is only in two areas: the
built-in types can be "constructed" using syntax "type()", and there
is a "pseudo-destrutor call" defined for them, like "~int()". Those
things were added to them so that they can be used with templates,
IIUIC.

V
Sep 8 '05 #2
lovecreatesbeauty wrote:
Prof. Bjarne Stroustrup said "built-in data types have default
constructor" at §10.4.2 in `TC++PL, special ed.'.
Doesn't say that in the English version. However the English text
is pretty much WRONG and always has been wrong for C++. Not even
all class types work the way he describes due to the woefully
stupid decision of forgetting to default initialize pod types.

He also said that "built-in data types are not classes" at §11.4 in
`TC++PL, special ed.'.
Correct, they are not.

Can I take Built-in Data Types as Compiler Defined Types. Then it's the
same as class (UDT) at this point.

No, on a number of points.
Sep 8 '05 #3

"Ron Natalie" <ro*@spamcop.net> wrote in message
news:43**********************@news.newshosting.com ...
lovecreatesbeauty wrote:
Prof. Bjarne Stroustrup said "built-in data types have default
constructor" at §10.4.2 in `TC++PL, special ed.'.


Doesn't say that in the English version. However the English text
is pretty much WRONG and always has been wrong for C++. Not even
all class types work the way he describes due to the woefully
stupid decision of forgetting to default initialize pod types.


Someone *decided* to *forget*? Hmmm. :-)

-Mike
Sep 9 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JimmyT | last post by:
I just configured and installed 2.3.4 and noticed there is no datetime module. I noticed there is a datetimemodule.c file that did not get built (ie no object file). Is there something I need to...
1
by: Alex Elbert | last post by:
Hi I have built dynamic HTMLTable. Now I want to attach it directly to the Email Body - it is already built, so why not to use a ready table. However, I cannot find the way of getting plain HTML...
0
by: Andrew Crook | last post by:
does MYSQL have a quota built into it! I need it limit the size of each database AndiC
1
by: Mark | last post by:
Is there a way to execute a statement that is built dynamically by a .NET application. For example I have a loop that is reading values from a database and I want to do something like the...
4
by: Yasutaka Ito | last post by:
Hi, Is there a way to determine which version of .NET Framework any given assembly is built with? thanks! -Yasutaka
1
by: William | last post by:
Looking for a pre built dotnet corporate or small business website template.
1
by: William | last post by:
Looking for a pre built dot net website for consulting business. I am trying to put up a quick business web for a dot net frame work. I have a provider already. I am trying to save time. Any...
1
by: Daniel | last post by:
is there any way to get to a unique build verion of an assembly at runtime? e.g. a version that is unique to the time that the assembly was built?
48
by: meyer | last post by:
Hi everyone, which compiler will Python 2.5 on Windows (Intel) be built with? I notice that Python 2.4 apparently has been built with the VS2003 toolkit compiler, and I read a post from Scott...
3
by: drewj840 | last post by:
I built a Windows service that sweeps a set of folders every 60 seconds and puts the files into a SQL Server database. I am creating a second service that will delete this set of folders and recreate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.