Created
February 6, 2020 19:51
-
-
Save dsyme/1567b963da03463ac4edc3e594ff9f62 to your computer and use it in GitHub Desktop.
This file contains 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
module Blittable | |
type System.SByte with | |
static member IsBlittableMarker = () | |
type System.Byte with | |
static member IsBlittableMarker = () | |
type System.Int16 with | |
static member IsBlittableMarker = () | |
type System.UInt16 with | |
static member IsBlittableMarker = () | |
type System.Int32 with | |
static member IsBlittableMarker = () | |
type System.UInt32 with | |
static member IsBlittableMarker = () | |
type System.Int64 with | |
static member IsBlittableMarker = () | |
type System.UInt64 with | |
static member IsBlittableMarker = () | |
type System.IntPtr with | |
static member IsBlittableMarker = () | |
type System.UIntPtr with | |
static member IsBlittableMarker = () | |
type System.Single with | |
static member IsBlittableMarker = () | |
let inline isBlittable< ^T when ^T : (static member IsBlittableMarker : unit) >() = (^T : (static member IsBlittableMarker : unit) ()) | |
let inline blit (x: ^T) = | |
isBlittable< ^T >() | |
"blit" | |
let table = | |
blit 1y | |
blit 2s | |
blit 1uy | |
blit 2us |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment