Skip to content

Commit

Permalink
Constructs struct with protected ctor with () rather than {}
Browse files Browse the repository at this point in the history
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
  • Loading branch information
trevorknight committed Jan 25, 2024
1 parent 10e0717 commit 9f5a52a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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<PolarPosition>(otm.position);
Expand Down

0 comments on commit 9f5a52a

Please sign in to comment.