#12944 closed Support Requests (fixed)
wchar_t conflict for common_factor_rt.hpp in visual studio
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | math |
Version: | Boost 1.63.0 | Severity: | Problem |
Keywords: | Cc: | lamar.moore@… |
Description
When attempting to use common_factor.hpp
I ran into an error where gcd_traits<>
had multiple explicit specializations for unsigned short
. Upon further inspection I realised the vc runtime defines wchar_t
as typdef unsigned short wchar_t
when the option -Zc:wchar_t (wchar_t Is Native Type)
is switched off. I had to patch the common_factor.hpp
header in order to use this (since I do not want wchar_t
to be a built-in type). Is there any other way around this? Am I misusing this interface?
Note:
See TracTickets
for help on using tickets.
I've fixed this in https://github.com/boostorg/math/commit/8c9709b31778c634eef095db63fc308dfbb5b68c.
A quick workaround would be to use boost/integer/common_factor_rt.hpp and boost::integer::gcd instead.