fork(4) download
  1. using System;
  2.  
  3. class Peedar
  4. {
  5. public string String { get; private set; }
  6.  
  7. public static implicit operator Peedar(String str)
  8. {
  9. return new Peedar { String = str };
  10. }
  11.  
  12. public static implicit operator bool(Peedar peedar)
  13. {
  14. return true;
  15. }
  16. }
  17.  
  18. public class Test
  19. {
  20. public static void Main()
  21. {
  22. var p = new Peedar();
  23.  
  24. if (p = "Паспорт РФ")
  25. {
  26. Console.WriteLine(p.String);
  27. }
  28. }
  29. }
Success #stdin #stdout 0s 29664KB
stdin
Standard input is empty
stdout
Паспорт РФ