Skip to content

Commit

Permalink
fixed issue #118
Browse files Browse the repository at this point in the history
  • Loading branch information
ksergey committed Mar 17, 2022
1 parent 99e0daa commit 2101ef9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/mfast/decimal_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ typedef boost::multiprecision::number<decimal_backend> decimal;

inline decimal make_decimal(int64_t mantissa, int16_t exponent) {
decimal r(mantissa);
r *= decimal_backend(1.0, exponent);
r *= decimal(decimal_backend(1.0, exponent));
return r;
}

Expand Down Expand Up @@ -119,7 +119,7 @@ class decimal_cref : public field_cref {

decimal value() const {
decimal r(mantissa());
r *= decimal_backend(1.0, exponent());
r *= decimal(decimal_backend(1.0, exponent()));
return r;
}

Expand Down
8 changes: 4 additions & 4 deletions src/mfast/field_visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ template <> struct result_holder<void> {

template <class FieldAccessor,
class Result = decltype(
static_cast<FieldAccessor *>(nullptr)->visit(int32_cref()))>
std::declval<FieldAccessor *>()->visit(int32_cref()))>
class field_accessor_adaptor : public field_instruction_visitor,
private result_holder<Result> {
FieldAccessor &accssor_;
Expand Down Expand Up @@ -157,7 +157,7 @@ class field_accessor_adaptor : public field_instruction_visitor,

template <class FieldMutator,
class Result = decltype(
static_cast<FieldMutator *>(nullptr)->visit(int32_mref()))>
std::declval<FieldMutator *>()->visit(int32_mref()))>
class field_mutator_adaptor : public field_instruction_visitor,
private result_holder<Result> {
allocator *alloc_;
Expand Down Expand Up @@ -291,7 +291,7 @@ inline void field_mref::accept_mutator(FieldMutator &mutator) const {
}

template <typename T>
inline decltype(static_cast<T *>(nullptr)->visit(int32_cref()))
inline decltype(std::declval<T *>()->visit(int32_cref()))
apply_accessor(T &accessor, field_cref v) {
detail::field_accessor_adaptor<T> adaptor(accessor);
v.instruction()->accept(adaptor, const_cast<mfast::value_storage *>(
Expand All @@ -300,7 +300,7 @@ apply_accessor(T &accessor, field_cref v) {
}

template <typename T>
inline decltype(static_cast<T *>(nullptr)->visit(int32_mref()))
inline decltype(std::declval<T *>()->visit(int32_mref()))
apply_mutator(T &mutator, field_mref v) {
detail::field_mutator_adaptor<T> adaptor(mutator, v.allocator());
v.instruction()->accept(adaptor, field_mref_core_access::storage_of(v));
Expand Down

0 comments on commit 2101ef9

Please sign in to comment.