Skip to content

Commit

Permalink
Umgehen eines Compilerfehlers in Visual C++ Compiler bei verwendfung …
Browse files Browse the repository at this point in the history
…des *=-Operators in einem konstanten Ausdruck.
  • Loading branch information
martinfehrs committed Aug 20, 2024
1 parent 1fda335 commit 75d0cce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/pcalc/pcalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ using namespace zs::units;

int main(int argc, char** argv)
{
constexpr auto a = zs::int_t<cm>{ 100 };
constexpr auto x = zs::int_t<m >{ a }.value();

// Checking arguments
const auto [wall_thickness, outer_diameter, pipe_length] = read_args(argc, argv);

Expand Down
2 changes: 1 addition & 1 deletion include/zollstock/scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace zollstock
{
if constexpr(this_unit != that_unit)
{
this->value_ *= unit_scaling_factor(that_unit) / unit_scaling_factor(this_unit);
this->value_ = this->value_ * unit_scaling_factor(that_unit) / unit_scaling_factor(this_unit);
}
}

Expand Down

0 comments on commit 75d0cce

Please sign in to comment.