Monkey
Store
Community
Apps
Contact
Login or Signup

Suggestion: generic functions

Monkey Programming Forums/Monkey Programming/Suggestion: generic functions

NoOdle(Posted 1+ years ago) 
this appears to work:
Class Generic< T >

	'/ Static Function
	Function RandomiseArray:Void( _arr:T[], nToSwap:Int = -1 )
	End Function

End Class

Function Main()

	Local this : Float[] = [ 0.0, 1.0, 2.0 ]
	Generic< Float >.RandomiseArray( this )

End Function