Re: [boost] [fusion] implementing distance_impl<>

The problem is with distance<begin, end>::value. My distance_impl<> doesn't provide a nested value. It provides a nested type. If this were distance<begin, end>::type::value, it works. It also works if I change my distance_impl<> specialization, but I don't think I should have to. Bug?
From what I can see in the MPL docs, a numeric metafunction is only required to return ::type, and ::value is just a convenience that I shouldn't count on. So I agree, a bug. I'll patch up shortly, thanks for picking this up.
The defect above should now be fixed on HEAD. Cheers Dan ___________________________________________________________ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/

dan marsden wrote:
The problem is with distance<begin, end>::value. My distance_impl<> doesn't provide a nested value. It provides a nested type. If this were distance<begin, end>::type::value, it works. It also works if I change my distance_impl<> specialization, but I don't think I should have to. Bug?
From what I can see in the MPL docs, a numeric metafunction is only required to return ::type, and ::value is just a convenience that I shouldn't count on. So I agree, a bug. I'll patch up shortly, thanks for picking this up.
The defect above should now be fixed on HEAD.
Great, thanks! If you haven't done so already, you may want to change all of your own distance_impl<> implementations so that they do not have a nested ::value. That way, your own tests will catch this problem if it ever creeps back in. Ditto for size_impl<>. Just a suggestion. -- Eric Niebler Boost Consulting www.boost-consulting.com
participants (2)
-
dan marsden
-
Eric Niebler