|
Boost : |
From: Joel de Guzman (joel_at_[hidden])
Date: 2007-11-05 11:50:02
Joel de Guzman wrote:
> John Maddock wrote:
>> Hartmut Kaiser wrote:
>>> John,
>>>
>>>>> I'll look into this later tonight.
>>>> Thanks Harmut: if you need a simple user-defined number type
>>>> to experiment with then try
>>>> boost::math::concepts::real_concept in
>>>> boost/math/concepts/real_concept.hpp.
>>> Ok, I tried that and fixed the pow() issue first (it's in SVN now).
>>> After this change the code compiled, but as you pointed out the
>>> actual parsing fails. The reason is that
>>> std::numeric_limits<boost::math::concepts::real_concept>::max() always
>>> returns zero, which triggers the overflow detection in the spirit
>>> real_parser, making the overall parse fail.
>>>
>>> I didn't investigate the numeric_limits::max issue, though.
>>> Do you have any ideas?
>> Ah, numeric_limits is deliberately not specialised for the real_concept
>> type, because I wanted to work with types that vary precision at runtime,
>> and numeric_limits just can't cope with that :-(
>>
>
> Ok, Hartmut briefed me with this sometime this morning. It *is* indeed a
> bug with Spirit that's already been addressed in Spirit2. I'll see if I
> can patch Spirit1 code to follow the Spirit2 behavior. Do you need
> something immediately? Will a few days wait for a patch ok?
Alright, I think I have a fix. Is there a Trac ticket for this?
Regards,
-- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk