Is every C# feature available in C++/Managed ?
-
I am looking at some MSDN documentation and the "C++" code example are empty with the message "No code example is currently available or this language may not be supported." Is it because the feature is not available in C++ or that is is just not "documented with code examples" The thing I am looking at is
Enumerable::ToDictionary
see the MSDN documentation : [Enumerable.ToDictionary(TSource, TKey) Method (IEnumerable(TSource), Func(TSource, TKey)) (System.Linq)](https://msdn.microsoft.com/en-us/library/bb549277.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2) There is not C++ example. Is it possible to convert that code to C++ ? Thanks.I'd rather be phishing!
-
I am looking at some MSDN documentation and the "C++" code example are empty with the message "No code example is currently available or this language may not be supported." Is it because the feature is not available in C++ or that is is just not "documented with code examples" The thing I am looking at is
Enumerable::ToDictionary
see the MSDN documentation : [Enumerable.ToDictionary(TSource, TKey) Method (IEnumerable(TSource), Func(TSource, TKey)) (System.Linq)](https://msdn.microsoft.com/en-us/library/bb549277.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2) There is not C++ example. Is it possible to convert that code to C++ ? Thanks.I'd rather be phishing!
-
I am looking at some MSDN documentation and the "C++" code example are empty with the message "No code example is currently available or this language may not be supported." Is it because the feature is not available in C++ or that is is just not "documented with code examples" The thing I am looking at is
Enumerable::ToDictionary
see the MSDN documentation : [Enumerable.ToDictionary(TSource, TKey) Method (IEnumerable(TSource), Func(TSource, TKey)) (System.Linq)](https://msdn.microsoft.com/en-us/library/bb549277.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2) There is not C++ example. Is it possible to convert that code to C++ ? Thanks.I'd rather be phishing!
Since Linq was designed as a C# language feature, many uses of it don't include a C++/CLI example in my experience. I have used it from C++/CLI however but it takes a bit of tinkering. Here's one example from a simple utility I had where I used ToList() which is probably similar to ToDictionary().
List^ files = Linq::Enumerable::ToList(Directory::EnumerateFiles(dataDir, "*.dat"));
int count = Linq::Enumerable::Count(files);I've not yet encountered something managed which just could not be done from C++/CLI. But, the C# syntax is often more direct.