lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [PATCH] Fix value_cast defect shown by the unit test


From: Vadim Zeitlin
Subject: Re: [lmi] [PATCH] Fix value_cast defect shown by the unit test
Date: Mon, 9 Jan 2017 15:36:13 +0100

On Mon, 9 Jan 2017 11:20:22 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2017-01-08 18:03, Vadim Zeitlin wrote:
GC> > On Sun, 8 Jan 2017 17:50:08 +0000 Greg Chicares <address@hidden> wrote:
GC> > 
GC> > GC> Switching from boost to std is always good, especially when it removes
GC> > GC> a defect. I was tempted to replace type_traits globally throughout 
lmi,
GC> [...]
GC> > replacing one with the other is
GC> > an almost completely mechanical task.
GC> 
GC> It seems straightforward to replace is_base_and_derived with is_base_of,

 Thanks for doing this!

GC> This article:
GC> 
GC> 
http://stackoverflow.com/questions/28665645/why-is-stdis-base-oft-t-true-when-t-is-a-class-type-but-false-when-t-is-a/28666177#28666177
GC> 
GC> gives some interesting background, and leads me to conclude that we
GC> no longer need to test is_same along with is_base_of.

 Yes if the arguments are known to be classes -- which I think should be
the case in 99.99% of cases.

GC> (Howard Hinnant's message cited above explains the "not unions" part.)

 I'd never have thought that something apparently as simple as is_base_of
could be so complicated, but I already had to deal with it recently as part
of http://trac.wxwidgets.org/ticket/17623 and am not surprised by it any
longer. One of the lessons learnt was that std::is_convertible<D*, B*> may
be more useful than std::is_base_of<B, D>, in particular in case of
non-public inheritance.

GC> BTW, every time I do 'apt-get upgrade', I seem to get a new 'icedove'
GC> regression. The stackoverflow URL pasted above as a single line now
GC> shows up as two separate lines
GC> 
GC> 
http://stackoverflow.com/questions/28665645/why-is-stdis-base-oft-t-true-when-t-is-a-class-type-but-false-when-t-
GC> is-a/28666177#28666177
GC> 
GC> as I compose this message, even though I have mailnews.wraplength
GC> set to zero as mozilla recommends. I fear it will similarly be
GC> split in the html archives. Apparently stackoverflow accepts
GC> truncated URLs, even this:
GC>   stackoverflow.com/questions/28665645/why-is
GC> but in other circumstances this new wrapping will be harmful.

 My MUA knits together even the URLs broken over two lines, so I selfishly
don't care about this -- and even if I were more altruistic, I'm afraid I
know absolutely nothing about Thunderbird (under any of its names) to help
with this, sorry.
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]