Wednesday, February 12, 2020

Sharpify your c++ code with LINQ!

As a software developer who loves to write in both C# and C++,  I would like to move some of .Net benefits to c++ world.
Sharpify is an open source library I wrote to enable using some built-in C# features while writing a C++ code, This will make the developer's life much easier, and more important is to keep the same performance of the original LINQ in mind.

Here are some examples of what you can do with Sharpify:

#include "sharpify.h"

using namespace std;

int main()
{
      vector<int> numbers = vector<int>{ 1,2,3,4,5,6 };

cout << "'Where' example:" << endl;
numbers.where([](int num) {return num > 3; })
   .forEach([](int num) {cout << num << endl; });

        string s = string("shhadi");
bool end = s.endsWith("di");

}


You are welcome to use it and contribute at https://github.com/Shhadi/Sharpify/
To share new ideas: shhadi.masarwa@gmail.com

No comments:

Post a Comment