From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d2f0af5e440b367f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-03 18:17:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!news-in-sterling.nuthinbutnews.com!cyclone1.gnilink.net!wn12feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: proposal for new assignment operators From: James Rogers References: <3EF9CD5F.6030608@cogeco.ca> <3doRhIgUmUYX@eisner.encompasserve.org> <3F038B77.2F2E41B7@adaworks.com> Message-ID: User-Agent: Xnews/5.04.25 Date: Fri, 04 Jul 2003 01:17:36 GMT NNTP-Posting-Host: 12.86.38.36 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1057281456 12.86.38.36 (Fri, 04 Jul 2003 01:17:36 GMT) NNTP-Posting-Date: Fri, 04 Jul 2003 01:17:36 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:40036 Date: 2003-07-04T01:17:36+00:00 List-Id: Hyman Rosen wrote in news:Q5NMa.632$i57.44@nwrdny02.gnilink.net: > It's not that frequent to need to do it in C++ either, as long as you > avoid low-level types such as pointers that are better handled by > encapsulation in proper holder classes. Of course, in C++ you can > define assignment between different types, and then you do find > yourself writing assignment operators for describing that operation. > For example, I might have a simple > template struct ObjectHolder > { > T theObject; > > template > ObjectHolder &operator=(const ObjectHolder &other) > { theObject = other.theObject; return *this; } > }; > so that I can assign one kind of ObjectHolder to another. (This > assignment will be legal only when the underlying types are assignment > compatible, and will otherwise result in a compiler error message, so > we are not decreasing type safety here.) In C++ template syntax above, does "typename" apply implicitly to only classes and structs, or does it also primitive types such as int, char, and float? Jim Rogers