Failure of recursive template instantiation
I've been working on a basic typelist lately, however, I am facing some trouble with my is_sorted() implementation. Here is an excerpt from my code: https://code.sololearn.com/cmrHf83vpeK6/?ref=app My idea was to continuously compare the second and first element while removing the head, until either the comparison returns true or the typelist is empty. Since that doesn't work for a typelist with a single element, I included a check via std::conditional meant to jump directly to the base case if only one element remains, since such a typelist would be sorted automatically. However, it seems that the instantiation nonetheless arrives at a point where cs::front is instantiated for an empty typelist, resulting in the error one can see when uncommenting one of the print statements in main(). I can't seem to make out where/ why this happens, so if someone could explain that to me, I would appreciate it a lot. Of course, if there is a better approach to the problem, I would like to hear about it as well.