I am trying to implement static cast. I need to check if the types T and U are implicitly convertible, if not check if one inherites from another. I can write a class to check each on of them, but I cant understand how to check implicit convert and if it doesnt compile check the inheritance.
all the checking need to on at compile time
                        
You could use
type_traitsand in particularstd::is_convertiblein combination withstd::is_base_of:Live Demo