tfussell / xlnt

:bar_chart: Cross-platform user-friendly xlsx library for C++11+
Other
1.49k stars 418 forks source link

the template complied error in visual studio dll project found in numeric.hpp #545

Closed emmmmm566 closed 3 years ago

emmmmm566 commented 3 years ago

it goes wrong when I try to complied in DLL. The problem was found in numeric.hpp line 51. it seems to be that visual studio cannot understand the template as follows: ///

/// constexpr max /// template <typename NumberL, typename NumberR> constexpr typename std::common_type<NumberL, NumberR>::type max (NumberL lval, NumberR rval) { return (lval < rval) ? (lval) : (rval); }

///

/// constexpr min /// template <typename NumberL, typename NumberR> constexpr typename std::common_type<NumberL, NumberR>::type min (NumberL lval, NumberR rval) { return (lval < rval) ? (lval) : (rval); } And I fix it the template as follows: /// /// constexpr max /// template <typename NumberL, typename NumberR> constexpr typename std::common_type<NumberL, NumberR>::type (max)(NumberL lval, NumberR rval) { return (lval < rval) ? (lval) : (rval); }

///

/// constexpr min /// template <typename NumberL, typename NumberR> constexpr typename std::common_type<NumberL, NumberR>::type (min) (NumberL lval, NumberR rval) { return (lval < rval) ? (lval) : (rval); }

tfussell commented 3 years ago

Thanks for reporting. This should be fixed in the master branch now.