This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Runtime.CompilerServices; | |
| namespace System.Runtime.CompilerServices | |
| { | |
| class CallerMemberNameAttribute : Attribute | |
| { } | |
| } | |
| namespace ConsoleApplication1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Diagnostics; | |
| using System.Threading.Tasks; | |
| class Program | |
| { | |
| private static void Main() | |
| { | |
| MainAsync().Wait(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| any_of(list.begin(), list.end(), [](SomeType x){ return predicate(x); }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using TimeUnits; | |
| public static class Program | |
| { | |
| public void Main() | |
| { | |
| Console.WriteLine(70.5 * s); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .assembly ActionTest {} | |
| .assembly extern mscorlib | |
| { | |
| .ver 4:0:0:0 | |
| .publickeytoken = (B7 7A 5C 56 19 34 E0 89) | |
| } | |
| .namespace Test | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| static class Program | |
| { | |
| private static void Main() | |
| { | |
| Intermediary<C>(); | |
| Console.WriteLine(); | |
| Intermediary<S>(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Globalization; | |
| static class Program | |
| { | |
| private static void Main() | |
| { | |
| double d = 3.14; | |
| IFormattable s = $"{d}"; | |
| Console.WriteLine(s.ToString(null, CultureInfo.GetCultureInfo("cs-cz"))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var cdict = new ConcurrentDictionary<int, int>(); | |
| var t = Task.Run(() => { | |
| for (int i = 0; i < 100000; i++) | |
| cdict[i] = i; | |
| }); | |
| IEnumerable<KeyValuePair<int, int>> kvps = new ReadOnlyDictionary<int, int>(cdict); | |
| ((ICollection<KeyValuePair<int, int>>)kvps).IsReadOnly.Dump(); // true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using System.Reflection.Emit; | |
| namespace ConsoleApplication1 | |
| { | |
| class Program | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Threading.Tasks; | |
| class Program | |
| { | |
| static void M(Func<Task<int>> f, int i) | |
| { } | |
| static void M(Func<int> f, int i) | |
| { } |