I wasn't aware that C++ could do this. It's come on a long way since I last looked at it! How far can it take these dependent types?
Can you specify a function in the type signature that is called by the compiler that can determine the type of the parameter?
Something like :
stringOrInt:: Bool -> Type
stringOrInt True = String
stringOrInt False = Int
doSomething:: x: Bool -> StringOrInt x -> String
doSomething can then be called like : doSomething True "Ook"
doSomething False 4