Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter method for C++ data structures

What is the best way to filter out all elements in a data structure that don't obey a certain predicate? i.e. a method similar to the "filter" methods in functional programming languages.

like image 978
jhourback Avatar asked Dec 02 '10 22:12

jhourback


People also ask

What is the filtering method?

Filtration, the technique used to separate solids from liquids, is the act of pouring a mixture onto a membrane (filter paper) that allows the passage of liquid (the filtrate) and results in the collection of the solid.

What is filtering in C?

A "filter" program is simply a program which reads from the standard input stream ( stdin ) and writes to the standard output stream ( stdout ).

What is the purpose of the filter () function?

The FILTER function allows you to filter a range of data based on criteria you define.

What are types of filter?

The four primary types of filters include the low-pass filter, the high-pass filter, the band-pass filter, and the notch filter (or the band-reject or band-stop filter).


1 Answers

STL has remove_if and remove_copy_if algorithms.

like image 103
Cat Plus Plus Avatar answered Oct 03 '22 17:10

Cat Plus Plus