lmi
[Top][All Lists]
Advanced

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

Re[2]: [lmi] passing objects instead of references to value_cast


From: Vadim Zeitlin
Subject: Re[2]: [lmi] passing objects instead of references to value_cast
Date: Mon, 2 Jun 2008 03:23:33 +0200

On Mon, 26 May 2008 16:07:37 +0000 Greg Chicares <address@hidden> wrote:

GC> >  Would replacing
GC> > "From" with "const From&" unconditionally be acceptable?
GC> 
GC> I think that would be a more natural signature anyway, so I have
GC> no objection at all in principle.

 Excellent, I'll try to provide a patch for this change although it can
require me more time than I originally thought (doesn't it always...).

GC> Experimentally, I changed
GC>   s/From from/From const& from/g
GC> in that file, and the unit tests succeeded with gcc-3.4.4;

 Amazingly everything indeed works for me with g++ 3.3, 3.4 and 4.2 but
with 4.1 many things break and I'm still not sure I understand why even
though I had already spent a couple of hours on this. I'm also not sure if
the problem is actually due to the compiler version difference or boost
version difference but I think it's probably the latter. The trouble is
that I can use g++ 4.1 with boost 1.33 or g++ 4.2 with boost 1.34 but can't
test the other combinations easily. But just in case the problems are
indeed shown to be fixed by upgrading boost, would this be acceptable or do
you want to continue to support boost 1.33?

GC> but they failed with como, giving errors like this:
GC> 
GC>     instantiation of class "std::_Numeric_limits_base<__number>
GC>         [with __number=const char [2]]" at line 324
GC> 
GC> apparently because of
GC> 
GC>                 std::numeric_limits<To  >::is_specialized
GC>             &&  std::numeric_limits<From>::is_specialized

 This one is actually easy to correct: std::numeric_limits<> can't be
instantiated with an array type but boost::is_arithmetic<> can and it also
seems more consistent to use it here instead as it's already used just
below anyhow.

GC> We want this to work for all of {g++, como, msvc}.

 I'll test the patch with all of those.

GC> I'd somewhat prefer to keep it "working" for borland,

 I won't test it with Borland but normally nothing should change for it as
all the code I'm modifying is inside "#ifndef __BORLANDC__" anyhow.


 Anyhow, sorry for a rather information-free post, but I just wanted to let
you know that I was working on this and didn't forget about it. But I still
have problems with boost::is_convertible<> not working with (char) arrays,
at least in boost-1.33/g++-4.1 combination. I thought boost::decay<> would
help with the arrays but somehow it doesn't... still investigating.

 Regards,
VZ





reply via email to

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