mrts / algorithm-utils-cpp Goto Github PK
View Code? Open in Web Editor NEWHigh-level utility wrappers around standard algorithms and Boost to make functional programming in C++ easier.
License: MIT License
High-level utility wrappers around standard algorithms and Boost to make functional programming in C++ easier.
License: MIT License
template <typename T>
void remove_mutable_items_if(std::vector<T>& items,
boost::function<bool(T&)> criteria) // T is mutable, i.e. non-const
{
items.erase(
std::remove_if(items.begin(), items.end(), boost::bind(criteria, _1)),
items.end());
}
Consider using
template <typename T, typename T2>
bool item_exists(const std::vector<T>& items,
boost::function<bool(const T2&)> criteria)
instead of
template <typename T>
bool item_exists(const std::vector<T>& items,
boost::function<bool(const T&)> criteria)
The latter causes template parameter 'T' is ambiguous
error without explicit template parameter.
However, the former should be really checked with something like std::assignable_from
which does not exist in C++03 and Boost AFAIK, so this needs a bit more thought.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.