marc-kdab / aastl Goto Github PK
View Code? Open in Web Editor NEWThe AASTL is a collection of STL-style algorithms. It does not intend to be a range library, but will likely adopt whatever range concept Standard C++ comes up with in the future.
The AASTL is a collection of STL-style algorithms. It does not intend to be a range library, but will likely adopt whatever range concept Standard C++ comes up with in the future.
remove_every_nth(first, last, skip)
removes every nth element, keep_every_nth
removes all but every nth element.
Question: First element to remove should be *first
or *(first+N-1)
?
Pseudo-code:
keep_if(It first, It last, Pred p) { return remove_if(first, last, std:.not1(p)); }
(by saving the previous value in an automatic variable instead of holding on to the corresponding iterator).
See e.g. https://api.kde.org/4.14-api/kdepim-apidocs/libkleo/html/stl__util_8h_source.html#l00243
_while
stops processing when a predicate changes from true
to false
. Likewise _until
stops processing when a predicate changes from false
to true
.
Source: Boost (copy_while
), Marshall Clow's ACCU'16 talk: https://www.youtube.com/watch?v=3nXLxMYXgWs
if possible, it should even be faster than subsequently calling std::sort and then unique+erase
Example use:
iota_n(std::ostream_iterator<std::string>(std::cout, "\n"), 10, std::string("Hello"), ", World");
would print
Hello
Hello, World
Hello, World, World
Hello, World, World, World
....
As in kdepim's copy of the KDTools version: https://api.kde.org/4.14-api/kdepim-apidocs/libkleo/html/stl__util_8h_source.html#l00243
Marshall Clow also used adjacent_pair
in his slides for ACCU 2016: https://www.youtube.com/watch?v=3nXLxMYXgWs
So maybe the _pair
name has already established itself?
Source: Marshall Clow @ ACCU'16: https://www.youtube.com/watch?v=3nXLxMYXgWs
Make these types Regular, but don't provide op<
, as there's no natural order for them.
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.