Book a Demo

Author Topic: C# generics  (Read 2273 times)

deboeck

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
C# generics
« on: February 19, 2006, 06:51:40 am »
Hi,

 Is it possible to define constraints on C# generics with EA ? For instance,

public class A<T> where T:struct

Thanks,
Bart

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C# generics
« Reply #1 on: February 19, 2006, 01:22:07 pm »
http://www.sparxsystems.com/EAUserGuide/index.html?csharp_conventions.htm says to use a tagged value "genericConstraints".  Just put the entire constraint ("where T:struct") into the value.  

deboeck

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: C# generics
« Reply #2 on: February 19, 2006, 03:55:16 pm »
Thanks !!  :D
Quote
http://www.sparxsystems.com/EAUserGuide/index.html?csharp_conventions.htm says to use a tagged value "genericConstraints".  Just put the entire constraint ("where T:struct") into the value.