From b82c4c53fedb423dc3028a2979ffd616da242d01 Mon Sep 17 00:00:00 2001 From: yekose Date: Thu, 30 Jul 2026 16:04:27 +0200 Subject: [PATCH] ifcgeom: add a profile_point overload taking a plain double MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The profile mapping builds its points as profile_helper(m4, { {{-x, -y}, {f2}}, ... where `f2` is a `double` and profile_point's second member is a `boost::optional`. In recent Boost (somewhere between 1.85 and 1.91) optional's converting constructor became explicit, and an explicit constructor cannot be used in copy-initialization — which is what a braced element is. So every one of these call sites stops compiling: MSVC 19.4x: error C2664: cannot convert argument 2 from 'initializer list' to 'const std::vector&' clang-cl 22: error: chosen constructor is explicit in copy-initialization Twelve translation units are affected (IfcCShapeProfileDef, IfcIShapeProfileDef, IfcLShapeProfileDef, IfcTShapeProfileDef, IfcUShapeProfileDef, IfcZShapeProfileDef, IfcAsymmetricIShapeProfileDef, IfcCraneRailAShapeProfileDef, IfcRectangleProfileDef, IfcRectangleHollowProfileDef, IfcRoundedRectangleProfileDef, IfcTrapeziumProfileDef), roughly 100 call sites in total. Adding one overload that takes the double directly fixes all of them without touching a single call site, and changes nothing for existing code: the optional overload still wins wherever an optional is passed. Verified by building schemas 2x3;4;4x3_add2 with MSVC 2022 against Boost 1.91 and OCCT 7.9.3 — IfcParse, IfcGeom, the schema mappings and geometry_kernel_opencascade all archive cleanly. Without this, the same build against Boost 1.85 succeeds, which is what identified Boost as the variable. --- src/ifcgeom/profile_helper.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ifcgeom/profile_helper.h b/src/ifcgeom/profile_helper.h index 849b43631d..1066657dca 100644 --- a/src/ifcgeom/profile_helper.h +++ b/src/ifcgeom/profile_helper.h @@ -13,6 +13,14 @@ namespace ifcopenshell { profile_point(const std::array& p, const boost::optional& r = boost::none) : xy(p), radius(r) { } + + // Recent Boost makes optional's converting constructor explicit, + // and an explicit constructor cannot be used in copy-initialization + // - which is what `{{x, y}, {radius}}` in the profile mappings is. + // Taking the double directly keeps every call site working. + profile_point(const std::array& p, double r) + : xy(p), radius(r) { + } }; struct profile_point_with_edges {