Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add std:: to "inner_product" and "accumulate" #561

Merged
merged 1 commit into from
Sep 14, 2018
Merged

add std:: to "inner_product" and "accumulate" #561

merged 1 commit into from
Sep 14, 2018

Conversation

g3bk47
Copy link
Contributor

@g3bk47 g3bk47 commented Sep 14, 2018

This only works because the "dot" function is always called with std::vector::iterator as input so that "argument dependent lookup" introduces the std namespace to the function. If the dot function is called like this "dot(v.data(), v.data()+v.size(), v.data())", where "v" is a std::vector and the input are plain pointers, the compiler will not find "inner_product". The same is true for the use of "accumulate".

This only works because the "dot" function is always called with std::vector<T>::iterator as input so that "argument dependent lookup" introduces the std namespace to the function. If the dot function is called like this "dot(v.data(), v.data()+v.size(), v.data())", where "v" is a std::vector and the input are plain pointers, the compiler will not find "inner_product". The same is true for the use of "accumulate".
@speth speth merged commit 1166c74 into Cantera:master Sep 14, 2018
@g3bk47 g3bk47 deleted the patch-4 branch September 14, 2018 18:50
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.

2 participants