ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: boost::any: explicit constructor?
by Kevlin Henney other posts by this author
Feb 28 2004 4:45PM messages near this date
Re: [boost] full functoids | [boost] FC++: formal review
In message <uk727uuvv.fsf@[...].com> , David Abrahams 
<dave@[...].com>  writes
> >>
> >>The conversion to boost::any isn't a widening conversion in the usual
> >>sense, though, is it?  Normally, a widening conversion preserves not
> >>only the information but the *interface* of the original data -- you
> >>wouldn't consider an implicit conversion from int to string a widening
> >>conversion, would you?
> >
> > Your assumption is not quite correct: most widening conversions are
> > not interface preserving.
> 
> So you're saying it's not even a little correct, it sounds like.  Can
> you give some examples of non-interface-preserving widening
> conversions?

T * to void *, derived * to base *, int (32 bit) to double (64 bit), T * 
to const T *, etc. Widening conversions are in the direction of the 
supertype, hence they often have a subset of the interface of source 
type. The corresponding narrowing of the interface with the widening of 
the type is not always the case, eg an int to long is effectively 
interface preserving -- the same set of operators is supported for both 
types.

Kevlin
-- 
____________________________________________________________

   Kevlin Henney                   phone:  +44 117 942 2990
   mailto:kevlin@[...].com     mobile: +44 7801 073 508
   http://www.curbralan.com        fax:    +44 870 052 2289
   Curbralan: Consultancy + Training + Development + Review
____________________________________________________________
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved