I have two functions

MultiplyVerison1(T x, T y); // in class A
MultiplyVersion1(T x, T y); // in class B

Above functions have been in separate non-template classes.

Now, included in refactoring I am trying to produce a base class of A and B and developing a pure virtual MultiplyVersion1 but a templte function can't be marked virtual.

So, exactly how should we attain the same goes with template functions?

You cannot. There is no method to call a function template inside a derived class via a pointer-to-base, that is what "function templates can't be virtual" means.

You are able to think about this to be since it is the phone call that creates the instantiation from the function template having a particular type T -- should you refer to it as with int, however the dynamic kind of the item you are calling it on is not known until runtime (maybe it's a or B or something like that else), plus there is not a way for that compiler to understand that it must instantiate A::MultiplyVersion1<int> or B::MultiplyVersion1<int> or something like that else. Really there's more into it than that, however i think that's enough.

You are able to bodge around particular cases, however, you will not obtain the full effect of the virtual function. Something similar to:

struct Base {
    template <typename T>
    void MultiplyVersion1(const T &x, const T &y) {
        A *athis = dynamic_cast<A*>(this);
        if (athis) {
            athis->MultiplyVersion1(x,y);
        } else {
            B *bthis = dynamic_cast<B*>(this);
            if (bthis) {
                bthis->MultiplyVersion1(x,y);
            } else {
                throw std::logic_error();
            }
        }
    }
    virtual ~Base() {}
};

Now whenever you call MultiplyVersion1<int> using a pointer-to-base, both A::MultiplyVersion1<int> and B::MutiplyVersion1<int> are instantiated. However you cannot easily add new derived classes, the industry serious restriction.

You might re-consider whether you actually need dynamic polymorphism whatsoever, but that is dependent positioned on how you are likely to use that base class. You appear to possess done OK without them to date.

If all that's necessary in the base class is code re-use for many other functions, then you do not need dynamic polymorphism. Leave MultiplyVersion1 from the base class entirely (and perhaps don't inherit openly in the Base, rather inherit independently and produce within the functions you need to re-use with using claims). When the functions you need to define for re-use call MultiplyVersion1, then consider simulated dynamic binding via CRTP:

#include <iostream>

template <typename Derived>
struct Base {
    template <typename T>
    void MultiplyVersion2(const T &x, const T &y) {
        static_cast<Derived&>(*this).MultiplyVersion1(x + 1, y + 1);
    }
};

struct A : private Base<A> {
    friend class Base;
    template <typename T> void MultiplyVersion1(T x, T y) {
        std::cout << x*y << "\n"; 
    }
    using Base::MultiplyVersion2;
};

struct B : private Base<B> {
    friend class Base;
    template <typename T> void MultiplyVersion1(T x, T y) {
        std::cout << x << " * " << y << " = " << x*y << "\n"; 
    }
    using Base::MultiplyVersion2;
};

int main() {
    A a;
    a.MultiplyVersion2(1,2);
    B b;
    b.MultiplyVersion2(1,2);
}