C++ and LINQ (round 1)

LINQ.jpg

I've never used a straight-edged razor for shaving, although I've seen one in use and I've played with one and sharpened one to the point that I know I don't WANT to use one (for shaving).

I have, indeed, used that thing called a "safety" razor where you screw in a double-sided razor blade into a carriage with a handle.  The contraption exposes only enough of the razor to keep you from total exsanguination but still provides a close shave.  You can always just unscrew the thing and get directly to as much of the razor as you want and, of course, when you change the blade, it's fully exposed.

I once had a really nice electric shaver, but for some reason, I never could get that thing to shave closely enough.  Funny though: once I damaged one of the curcular guards, it would only just draw blood (instead of shaving).

Now, I've become accustomed to shaving with a disposable razor that comes out of a bag of razors.  When the current one gets dull, I toss it and grab a new one . The new ones are REALLY, REALLY sharp for the first couple of shaves.
I can get a bag-full with single-edged blades, double-edged, triple-edged and even the Quattro(R)!

Code, Hines, code!

The big problem with the new C++ is that it looks like a safety-razor-blade "kit", while C# is the new "disposable" and, of course, Assembly being the straight-edged razor.
Yeah, yeah, VB is the electric shaver.

I've been trying to find a good reason to investigate LINQ with C++.
I can make an example of "how", but I'm still working on the "why".

With that said, here is an example in both C# and C++ using a "one-step-up-from-the-bottom" LINQ query.
It takes a Dictionary<string, string> and converts the VALUES in it to a unique list of strings where the length of the string is greater than two.  Listing one is in C# (C Sharp) showing the <quote> Easy </quote> way of doing this.  Listing 2 is the C++ (cpp) method and Listing 3 shows the project settings (Dot Net 3.5 and a reference to System.Core).

 Listing 1 in C-Sharp
Listing 1.

Listing 2 in C-Plus-Plus
Listing 2.

 

Settings
Listing 3.

posted @ Friday, April 24, 2009 7:23 AM
Print

Comments on this entry:

# re: C++ and LINQ (round 1)

Left by amin bahssou at 9/10/2012 12:06 PM
Gravatar
i want to studing the data processing soe plz help me
ok

Your comment:



(not displayed)

 
 
 
 

Live Comment Preview: