ridiculousfish / libdivide

Official git repository for libdivide: optimized integer division
http://libdivide.com
Other
1.09k stars 77 forks source link

size_t support #58

Closed william-silversmith closed 5 years ago

william-silversmith commented 5 years ago

Hi,

This might be a naïve question, but I had trouble compiling some C++ code using the admittedly variable width size_t. It compiled on Ubuntu using g++ but failed on Mac OS using clang.

././libdivide.h:1951:63: error: no type named 'divider' in '(anonymous namespace)::libdivide::libdivide_internal::dispatcher<unsigned long, -1>'
    typedef typename libdivide_internal::dispatcher<T, ALGO>::divider div_t;

I changed my code to use uint64_t, which is fine for my use case. Is it possible to support size_t? No urgency here, just curious.

Thanks! Will

kimwalisch commented 5 years ago

Thanks for your feedback.

Someone else posted a pull request a few days ago which I think would also fix your issue. But that pull request needs to be improved a little and I am currently on holiday. So we will definitely fix this issue but it will take some time.

william-silversmith commented 5 years ago

Thanks, that's really helpful! Thanks so much for this very cool library. :)

On Thu, Jul 25, 2019 at 1:49 AM Kim Walisch notifications@github.com wrote:

Thanks for your feedback.

Someone else posted a pull request a few days ago which I think would also fix your issue. But that pull request needs to be improved a little and I am currently on holiday. So we will definitely fix this issue but it will take some time.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ridiculousfish/libdivide/issues/58?email_source=notifications&email_token=AATGQSKWLO6YMTQSWNYF523QBE5GVA5CNFSM4IGXBNAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YNSBQ#issuecomment-514906374, or mute the thread https://github.com/notifications/unsubscribe-auth/AATGQSPX35N5J56W2YANJK3QBE5GVANCNFSM4IGXBNAA .

kimwalisch commented 5 years ago

@william-silversmith: Do you need C++98 support? Or would you be OK with a C++11 only fix?

william-silversmith commented 5 years ago

At least for me, I've been writing all of my code to a C++11 standard. Thanks for your help!

Will

On Mon, Aug 12, 2019 at 10:56 AM Kim Walisch notifications@github.com wrote:

@william-silversmith https://github.com/william-silversmith: Do you need C++98 support? Or would you be OK with a C++11 only fix?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ridiculousfish/libdivide/issues/58?email_source=notifications&email_token=AATGQSPVQQ2LRLU6UOVONILQEF22FA5CNFSM4IGXBNAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4CZOHY#issuecomment-520460063, or mute the thread https://github.com/notifications/unsubscribe-auth/AATGQSJFGK3WMCQ746OYS7DQEF22FANCNFSM4IGXBNAA .

kimwalisch commented 5 years ago

Fixed by https://github.com/ridiculousfish/libdivide/commit/623f9be3e406712be192e75833019f790aef8a51

Thanks for your feedback!

william-silversmith commented 5 years ago

Awesome! Thank you I'll check it out.

Will

On Tue, Aug 13, 2019, 4:23 AM Kim Walisch notifications@github.com wrote:

Fixed by 623f9be https://github.com/ridiculousfish/libdivide/commit/623f9be3e406712be192e75833019f790aef8a51

Thanks for your feedback!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ridiculousfish/libdivide/issues/58?email_source=notifications&email_token=AATGQSJ5YKQZKDWVMJ5H4E3QEJVRTA5CNFSM4IGXBNAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4E5S5A#issuecomment-520739188, or mute the thread https://github.com/notifications/unsubscribe-auth/AATGQSK2GV76MK5HV5IY5DDQEJVRTANCNFSM4IGXBNAA .