summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-06-04 11:06:19 +0800
committerErik Kundiman <erik@megapahit.org>2023-07-19 11:03:26 +0800
commit85e61212ef42e649eaea444bd9cbcad4fc26d31a (patch)
tree204c4ce543748be6278faf9864f95787477a717f /indra
parentb981877c4a9edbd5df49517b294a84d665c59a5d (diff)
Explicit when using function_ptr Phoenix binder
From the errors: base type ‘float (*)(float, float) noexcept’ fails to be a struct or class type struct functor_action : public FuncT { ^~~~~~~~~~~~~~ ‘float (*)(float, float) noexcept’ is not a class, struct, or union type struct result { typedef typename FuncT::result_type type; }; ^~~~ type ‘float (*)(float, float) noexcept’ is not a direct base of ‘phoenix::functor_action<float (*)(float, float) noexcept>’ : FuncT(fptr_) {} ^ it seems that GCC, at least the ones on my system, failed to deduce that the binder meant to be used when trying to bind the C Std Math Library's powf and fmodf functions is of course the function pointer one (specifically the 2 args specialisation), and not the functor one.
Diffstat (limited to 'indra')
-rw-r--r--indra/llmath/llcalcparser.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h
index dff5bf3af3..e4656d2376 100644
--- a/indra/llmath/llcalcparser.h
+++ b/indra/llmath/llcalcparser.h
@@ -131,14 +131,14 @@ struct LLCalcParser : grammar<LLCalcParser>
power =
unary_expr[power.value = arg1] >>
- *('^' >> assert_syntax(unary_expr[power.value = phoenix::bind(&powf)(power.value, arg1)]))
+ *('^' >> assert_syntax(unary_expr[power.value = phoenix::bind<float, float, float>(&powf)(power.value, arg1)]))
;
term =
power[term.value = arg1] >>
*(('*' >> assert_syntax(power[term.value *= arg1])) |
('/' >> assert_syntax(power[term.value /= arg1])) |
- ('%' >> assert_syntax(power[term.value = phoenix::bind(&fmodf)(term.value, arg1)]))
+ ('%' >> assert_syntax(power[term.value = phoenix::bind<float, float, float>(&fmodf)(term.value, arg1)]))
)
;