Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public static fields | List of all members
Loyc.Traits< T > Class Template Reference

Provides efficient access to non-numeric information about a type. For numeric traits, use Loyc.Math.Maths{T}.Traits in the Loyc.Math package. More...


Source file:

Remarks

Provides efficient access to non-numeric information about a type. For numeric traits, use Loyc.Math.Maths{T}.Traits in the Loyc.Math package.

Public static fields

static readonly Type Type = typeof(T)
 
static readonly bool IsValueType = Type.IsValueType
 True if T is a value type (struct or primitive). More...
 
static readonly bool IsPrimitive = Type.IsPrimitive
 True if T is bool, char, byte, sbyte, short, ushort, int, uint, long, ulong, nint, nuint, IntPtr, float or double. Note that decimal and string are not considered primitive. More...
 
static readonly bool IsInterface = Type.IsInterface
 True if T is an interface type (not a class or struct). More...
 
static readonly bool IsByRef = Type.IsByRef
 True if T is a ref type (e.g. ref int). More...
 
static readonly bool IsEnum = Type.IsEnum
 True if T is a numeric enum type. More...
 
static IReadOnlyList< Type > Interfaces => _interfaces # Type.GetInterfacesSortedTopologically()
 Gets a list of the interfaces that T implements, sorted topologically so that the highest-level interfaces are listed first. More...
 

Member Data Documentation

IReadOnlyList<Type> Loyc.Traits< T >.Interfaces => _interfaces # Type.GetInterfacesSortedTopologically()
static

Gets a list of the interfaces that T implements, sorted topologically so that the highest-level interfaces are listed first.

readonly bool Loyc.Traits< T >.IsByRef = Type.IsByRef
static

True if T is a ref type (e.g. ref int).

readonly bool Loyc.Traits< T >.IsEnum = Type.IsEnum
static

True if T is a numeric enum type.

readonly bool Loyc.Traits< T >.IsInterface = Type.IsInterface
static

True if T is an interface type (not a class or struct).

readonly bool Loyc.Traits< T >.IsPrimitive = Type.IsPrimitive
static

True if T is bool, char, byte, sbyte, short, ushort, int, uint, long, ulong, nint, nuint, IntPtr, float or double. Note that decimal and string are not considered primitive.

readonly bool Loyc.Traits< T >.IsValueType = Type.IsValueType
static

True if T is a value type (struct or primitive).