From 9f5a52ad719020bda209013c190ed3438af600aa Mon Sep 17 00:00:00 2001 From: Trevor Knight Date: Thu, 25 Jan 2024 16:10:50 -0500 Subject: [PATCH] Constructs struct with protected ctor with () rather than {} The base class of the struct has a protected constructor so this commit uses parens instead of brackets for regular construction in both C++14 and 17, rather than aggregate construction in 17. See the following for details. https://stackoverflow.com/questions/56367480/should-this-code-fail-to-compile-in-c17 --- src/conversion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conversion.cpp b/src/conversion.cpp index 024bf45..ceae050 100644 --- a/src/conversion.cpp +++ b/src/conversion.cpp @@ -268,7 +268,7 @@ namespace ear { void toPolar(ObjectsTypeMetadata &otm) { otm.cartesian = - boost::apply_visitor(guess_cartesian_flag{}, otm.position); + boost::apply_visitor(guess_cartesian_flag(), otm.position); if (otm.cartesian) { CartesianPosition cart_pos = @@ -290,7 +290,7 @@ namespace ear { void toCartesian(ObjectsTypeMetadata &otm) { otm.cartesian = - boost::apply_visitor(guess_cartesian_flag{}, otm.position); + boost::apply_visitor(guess_cartesian_flag(), otm.position); if (!otm.cartesian) { PolarPosition polar_pos = boost::get(otm.position);