Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Why can't the as operator perform user-defined conversions?

Why can't the as operator perform user-defined conversions?

Scheduled Pinned Locked Moved C#
csharphtmlcomhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Patric_J
    wrote on last edited by
    #1

    Why can't the as operator perform user-defined conversions? Is it a C# problem or with MSIL? I can't see any reasons why the compiler should'nt be able to use a user-defined conversion operator. Anyone knows the answer? MSDN my c# blog: C# Coach

    L 1 Reply Last reply
    0
    • P Patric_J

      Why can't the as operator perform user-defined conversions? Is it a C# problem or with MSIL? I can't see any reasons why the compiler should'nt be able to use a user-defined conversion operator. Anyone knows the answer? MSDN my c# blog: C# Coach

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      I am confused... you never need to do that. Perhaps you are looking for explicit casting, but that will only work as reference type. Btw, have u looked at the output of an as expression in MSIL? That will show you the what actually happens when it is used. top secret
      Download xacc-ide 0.0.3 now!
      See some screenshots

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups