mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-25 06:44:26 +08:00
Fixed functions declaration template<class Tf> inline constexpr coord_t scaled(Tf val) and template<class Tf> inline constexpr Tf unscaled(coord_t val) to use constexpr on versions of Visual Studio which support it
This commit is contained in:
parent
c5037540e9
commit
9ffd294f07
@ -49,13 +49,21 @@ typedef double coordf_t;
|
||||
//inline coord_t scale_(coordf_t v) { return coord_t(floor(v / SCALING_FACTOR + 0.5f)); }
|
||||
#define scale_(val) ((val) / SCALING_FACTOR)
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1910)
|
||||
template<class Tf> inline coord_t scaled(Tf val)
|
||||
#else
|
||||
template<class Tf> inline constexpr coord_t scaled(Tf val)
|
||||
#endif // _MSC_VER
|
||||
{
|
||||
static_assert (std::is_floating_point<Tf>::value, "Floating point only");
|
||||
return coord_t(val / Tf(SCALING_FACTOR));
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1910)
|
||||
template<class Tf> inline Tf unscaled(coord_t val)
|
||||
#else
|
||||
template<class Tf> inline constexpr Tf unscaled(coord_t val)
|
||||
#endif // _MSC_VER
|
||||
{
|
||||
static_assert (std::is_floating_point<Tf>::value, "Floating point only");
|
||||
return Tf(val * Tf(SCALING_FACTOR));
|
||||
|
Loading…
x
Reference in New Issue
Block a user