fn test(c: usize){
println!("test");
}
fn test1(c:usize){
println!("test1");
}
let a = (test, test1);
a.0(1); //=> test
a.1(2); //=> test1
below code compile error, how to write it?
fn test<T>(c: T)->bool{
println!("test");
true
}
fn test1<T>(c:T)->i32{
println!("test1");
2_i32
}
let a =(test, test1); // compile error
for above, I think maybe I should create a common trait for those functions so that put them together into array,
//of course below code compile error,
//whether we can have such code for a list of functions having them togther in a arrary ?
//whether we can impl trait for a function ?
trait FuncTrait {}
impl Functrait for test{}
impl Functrait for test1{}
let a: (dyn Functrait) = (test, test1);