// primary template template struct Replace; // in this case there is general definition that makes sense // so just leave it undefined // Case: empty tuple (this is what needed to be added) template struct Replace, A, B> { typedef tuple<> Result; } // Case: type not found template struct Replace, A, B> : public Append, typename Replace, A, B>::Result> { }; // Case: type found! template struct Replace, A, B> { typedef tuple Result; };