Remove expr/stmt (#5857)
This commit is contained in:
parent
52ff244d5d
commit
000b8afd26
168 changed files with 497 additions and 529 deletions
|
|
@ -9,7 +9,6 @@ proc `[]=`*(M: var Matrix; m, n: int; v: M.T) =
|
|||
M.data[m * M.N + n] = v
|
||||
|
||||
# Adapt the Matrix type to the concept's requirements
|
||||
template Rows*(M: type Matrix): expr = M.M
|
||||
template Cols*(M: type Matrix): expr = M.N
|
||||
template Rows*(M: type Matrix): untyped = M.M
|
||||
template Cols*(M: type Matrix): untyped = M.N
|
||||
template ValueType*(M: type Matrix): typedesc = M.T
|
||||
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ t
|
|||
'''
|
||||
"""
|
||||
|
||||
template accept(e: expr) =
|
||||
template accept(e) =
|
||||
static: assert compiles(e)
|
||||
|
||||
template reject(e: expr) =
|
||||
template reject(e) =
|
||||
static: assert(not compiles(e))
|
||||
|
||||
type
|
||||
|
|
@ -40,4 +40,3 @@ takesContainer(@[4, 5, 6])
|
|||
takesContainer(@["a", "b"])
|
||||
takesContainer "test"
|
||||
reject takesContainer(10)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ IMPLICIT VALUE TYPE NAME INT INT
|
|||
|
||||
import typetraits, strutils
|
||||
|
||||
template reject(e: expr) =
|
||||
template reject(e) =
|
||||
static: assert(not compiles(e))
|
||||
|
||||
type
|
||||
|
|
@ -60,4 +60,3 @@ reject s.genericAlgorithm "x"
|
|||
reject s.genericAlgorithm 1.0
|
||||
reject "str".implicitGeneric
|
||||
reject implicitGeneric(10)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue