From: David Abrahams (abrahams_at_[hidden])
Date: 2000-11-10 00:06:57
----- Original Message -----
From: "Petr Kocmid" <pkocmid_at_[hidden]>
> Oh, thats exactly what I needed, very thanks!
Very welcome, I'm sure!
> > > question arises: What's the benefit of having boost::numeric_cast<>
> > > at all inside py.cpp, not counting the joy of maintaining twice the
> > > same thing?
> > What on earth are you talking about? I haven't copied the source of
> > boost::numeric_cast<>!?!
> I am sorry I expressed myself ambigously. What I really mean is why
> at all are two branches in py.cpp, conditioned by BOOST_NO_LIMITS,
> one using boost::numeric_cast<> and another using static_cast<>.
> I feel having only the second one would be simply more efficient.
> I understand the numeric_cast is more safe, but introduces unnecessary
> overhead. Perhaps, conversion checking mechanism should
> be selectable. Seeing a real-time engine, feeding tons of ints into it's
> scripting doing try/catch the bad numeric cast which never happens
> makes me less happy...
Trust me, Peter, if you are feeding these ints through Python you will never
notice this check. Be my guest and patch it out if you want to inspect the
timing. On a really poor compiler, you might notice the try/catch, but I
even doubt that.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk