Ideally, I would like to write

func{N::Int}(::Type{Val{N}) = N

and get no-method errors if N is a float, symbol, etc... Has there been 
previous discussion on this topic?

On Wednesday, May 20, 2015 at 5:28:26 PM UTC-4, Josh Langsfeld wrote:
>
> I want to implement some functionality in multiple methods and have the 
> dispatch controlled by an Int variable "N". The trick is I want one method 
> to be called if N == 0 and another one to be called for all other values of 
> N. Is there a way I can do this with "Val{N}" without making the method 
> applicable to everything? That is, can I write a generic method 
> "func(::Val{N}) and constrain N to be an Int only?
>

Reply via email to