mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 17:31:06 +00:00
Fix compilation
This commit is contained in:
@@ -101,11 +101,13 @@ namespace IfcGeom {
|
|||||||
virtual const void* value_ptr() const = 0;
|
virtual const void* value_ptr() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef SWIG
|
||||||
template <typename T, typename = void>
|
template <typename T, typename = void>
|
||||||
struct has_exact : std::false_type {};
|
struct has_exact : std::false_type {};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct has_exact<T, std::void_t<decltype(std::declval<const T&>().exact())>> : std::true_type {};
|
struct has_exact<T, std::void_t<decltype(std::declval<const T&>().exact())>> : std::true_type {};
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct NumberModel : NumberConcept {
|
struct NumberModel : NumberConcept {
|
||||||
@@ -130,7 +132,8 @@ namespace IfcGeom {
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
if constexpr (has_exact<T>::value) {
|
if constexpr (has_exact<T>::value) {
|
||||||
ss << value.exact();
|
ss << value.exact();
|
||||||
} else if constexpr (std::is_floating_point<T>::value) {
|
} else {
|
||||||
|
if constexpr (std::is_floating_point<T>::value) {
|
||||||
ss << std::setprecision(std::numeric_limits<T>::digits10 + 1);
|
ss << std::setprecision(std::numeric_limits<T>::digits10 + 1);
|
||||||
}
|
}
|
||||||
ss << value;
|
ss << value;
|
||||||
|
|||||||
Reference in New Issue
Block a user