🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3426

Re: typedef not strong

#3426
From: Joe Buck
Date: Fri, 23 Feb 1996 18:45
32 lines
2217 bytes
"Paul D. DeRocco" <pderocco@ix.netcom.com> writes:
>The disadvantage of "class" is that it creates a structure type. If you 
>want to create a new arithmetic type, you can do that with "class", but 
>you have to define all the arithmetic operators over again, using 
>inlines. The Borland compiler, for one, will let you do that, but it 
>will never generate code quite as efficient as it will for the built-in 
>types, where it is happy to do arithmetic (addition and subtraction, at 
>least) in whatever registers are most convenient.

This is a weakness in current implementations, and it is not inherent in
the C++ language (GNU C++ has some of the same weaknesses).  These
weaknesses *are* related to the complexity of the standard; due to the
sheer complexity and the large number of new features, most C++ compiler
implementers are struggling to get the front-end parsing and semantics
right and haven't devoted the same resources to optimization.

Because this is true, the very *worst* thing to do would be to extend the
language still more in the hope of getting better code generation.  It
would probably produce the opposite effect.

-- 
-- Joe Buck 	<jbuck@synopsys.com>	(not speaking for Synopsys, Inc)

Work for something because it is good,
not just because it stands a chance to succeed.	   -- Vaclav Havel

[ To submit articles: Try just posting with your newsreader.
		      If that fails, use mailto:std-c++@ncar.ucar.edu
  FAQ:    http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID: <4gl1gt$lh2@hermes.synopsys.com>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
References: <4g5sm4$dtt@natasha.rmii.com> <r4d97clcgj.fsf@erawan.cognex.com> <31285017.4BFA@ix.netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: jbuck@Synopsys.COM (Joe Buck)
Newsgroups: comp.std.c++
Subject: Re: typedef not strong
Date: 23 Feb 1996 18:45:58 GMT
Organization: Synopsys Inc., Mountain View, CA 94043-4033
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <4gl1gt$lh2@hermes.synopsys.com>
References: <4g5sm4$dtt@natasha.rmii.com> <r4d97clcgj.fsf@erawan.cognex.com> <31285017.4BFA@ix.netcom.com>
NNTP-Posting-Host: taumet.eng.sun.com
X-Nntp-Posting-Host: deerslayer.synopsys.com
Originator: clamage@taumet