Skip to content

explicilty use std:: to avoid ambigious error - #22

Closed
emrys53 wants to merge 1 commit into
flatironinstitute:mainfrom
emrys53:fix/utils
Closed

emrys53 wants to merge 1 commit into
flatironinstitute:mainfrom
emrys53:fix/utils

Conversation

@emrys53

@emrys53 emrys53 commented Oct 14, 2026

Copy link
Copy Markdown

   42 |       w(j) = pow(-1, j) * sqrt((1 - pow(x(j), 2)) * wgl(j)); // Barycentric weights

      |              ^~~

/usr/lib/llvm-21/bin/../include/c++/v1/__math/exponential_functions.h:161:52: note: candidate function [with _A1 = int, _A2 = int, $2 = 0]

  161 | inline _LIBCPP_HIDE_FROM_ABI __promote_t<_A1, _A2> pow(_A1 __x, _A2 __y) _NOEXCEPT {

      |                                                    ^

/home/jenkins/agent/workspace/CCQ_TRIQS_triqs_unstable@tmp/build/deps/nda_src/c++/nda/././mapped_functions.hpp:84:8: note: candidate function [with A = int, S = int]

   84 |   auto pow(A &&a, S p) {

      |        ^

/home/jenkins/agent/workspace/CCQ_TRIQS_triqs_unstable@tmp/build/deps/cppdlr_src/c++/cppdlr/utils.cpp:42:37: error: call to 'pow' is ambiguous

   42 |       w(j) = pow(-1, j) * sqrt((1 - pow(x(j), 2)) * wgl(j)); // Barycentric weights

      |                                     ^~~

/usr/lib/llvm-21/bin/../include/c++/v1/__math/exponential_functions.h:161:52: note: candidate function [with _A1 = double, _A2 = int, $2 = 0]

  161 | inline _LIBCPP_HIDE_FROM_ABI __promote_t<_A1, _A2> pow(_A1 __x, _A2 __y) _NOEXCEPT {

      |                                                    ^

/home/jenkins/agent/workspace/CCQ_TRIQS_triqs_unstable@tmp/build/deps/nda_src/c++/nda/././mapped_functions.hpp:84:8: note: candidate function [with A = double &, S = int]

   84 |   auto pow(A &&a, S p) {

      |        ^
      
This PR solves the issue of ambiguity by explicitly using std:: versions of math functions. 

@emrys53 emrys53 closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant