Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12944 closed Support Requests (fixed)

wchar_t conflict for common_factor_rt.hpp in visual studio

Reported by: lamar.moore@… 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?

Change History (2)

comment:1 by John Maddock, 6 years ago

Resolution: fixed
Status: newclosed

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.

comment:2 by lamar.moore@…, 6 years ago

Thanks for the quick update

Note: See TracTickets for help on using tickets.