Experimental C++ template based type safe matching