Skip to content

Instantly share code, notes, and snippets.

@BitPuffin
Created December 5, 2013 13:06
Show Gist options
  • Save BitPuffin/7804860 to your computer and use it in GitHub Desktop.
Save BitPuffin/7804860 to your computer and use it in GitHub Desktop.
template identity(m: typedesc[TMatrix]): expr =
when m.R != m.C:
{.fatal: "Identity is only defined for square matrices".}
result = identity[m.T, m.R]()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment