// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>

using namespace std;

template <typename T>
class Test
{
    private:
        T v;
    public:
        Test(T v) { this->v = v; };
        T testing (int i);
};

template <typename T>
T Test<T>::testing(int i)
{
    return i*v;
}

int main ()
{
    Test<int> t1(123);
    cout << t1.testing(2) << endl;;
    Test<double> t2(123.456);
    cout << t2.testing(2) << endl;;
    return 0;
}
