Skip to content

Switch to C++14#144

Open
greenwald wants to merge 4 commits intoyap:masterfrom
greenwald:cpp14
Open

Switch to C++14#144
greenwald wants to merge 4 commits intoyap:masterfrom
greenwald:cpp14

Conversation

@greenwald
Copy link
Contributor

No description provided.

{
return std::all_of(first_needle, last_needle, [&](const typename std::iterator_traits<InputIt2>::value_type& b)
return std::all_of(first_needle, last_needle, [&](const auto& b)
{return std::any_of(first_haystack, last_haystack, std::bind(p, std::placeholders::_1, b)); });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The std::bind can be replaced by a lambda:

{ return std::any_of(first_haystack, last_haystack, [&](const auto& a) { return p(a, b); }); });


// check no daughters is empty
if (std::any_of(Daughters_.begin(), Daughters_.end(), [](std::shared_ptr<Particle> d) {return !d;})) {
if (std::any_of(Daughters_.begin(), Daughters_.end(), [](auto d) {return !d;})) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying a shared_ptr is expensive, I'd pass it by const reference.

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