dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
735 stars 1.57k forks source link

Not valid C++ #10276

Open yoelhalb-hitech opened 2 months ago

yoelhalb-hitech commented 2 months ago

Type of issue

Code doesn't work

Description

Code provided for C++ is not valid C++

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.func-2?view=netframework-4.5.2

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System/Func`2.xml

Document Version Independent Id

91a46b70-fa07-92b0-497c-16a833c0b3cb

Article author

@dotnet-bot

dotnet-issue-labeler[bot] commented 2 months ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

dotnet-issue-labeler[bot] commented 2 months ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

rzikm commented 2 months ago

@joelmartinez do we test-compile all snippets? The code example in question (https://github.com/dotnet/dotnet-api-docs/blob/main/snippets/cpp/VS_Snippets_CLR_System/system.Func~2/cpp/Example.cpp) fails to compile for a fresh C++/CLI project because the compiler can't resolve the System::Linq namespace.

image