Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace System;
- using namespace System::Collections::Generic;
- using namespace System::Linq;
- public ref class Abiturient
- {
- public:
- property String^ LastName;
- property String^ Address;
- property Double AverageGrade;
- Abiturient(String^ ln, String^ a, Double ag)
- {
- LastName = ln;
- Address = a;
- AverageGrade = ag;
- }
- ~Abiturient()
- {
- }
- };
- ref class Filter
- {
- private: double _value;
- public:
- Filter(double value): _value(value) {}
- bool Predicate(Abiturient ^a)
- {
- return a->AverageGrade > _value;
- }
- };
- int main(array<System::String ^> ^args)
- {
- auto abiturients = gcnew List<Abiturient^>();
- auto filter = gcnew Filter(2.0);
- auto filtered = Enumerable::Where(abiturients, gcnew Func<Abiturient^, bool>(filter->Predicate));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement