int MyMinFunc(int a, int b)
{
    return a < b ? a : b;
}
int MyMaxFunc(int a, int b)
{
    return a > b ? a : b;
}

template<typename T>
class RefList
{
    struct Node
    {
        T &t;
        Node *n;
        Node() = delete;
        Node(T &t) : t(t), n(0) {}
        Node(const Node &) = delete;
        Node &operator=(const Node &) = delete;
        ~Node(){}
    } *h;
public:
    RefList() : h(0) {}
    RefList(const RefList &) = delete;
    RefList &operator=(const RefList &) = delete;
    void AddLast(T &t)
    {
        if(!h) h = new Node(t);
        else
        {
            Node *n = h;
            while(n->n) n = n->n;
            n->n = new Node(t);
        }
    }
    T &operator[](unsigned i)
    {
        if(!i) return h->t;
        Node *n = h;
        while(i--) n = n->n;
        return n->t;
    }
    ~RefList()
    {
        while(h)
        {
            Node *n = h;
            h = h->n;
            delete n;
        }
    }
};

#include <iostream>

int main()
{
    RefList<int (int, int)> MyArray;
    MyArray.AddLast(MyMinFunc);
    MyArray.AddLast(MyMaxFunc);
    std::cout << MyArray[0](4, 7) << std::endl;
    std::cout << MyArray[1](4, 7) << std::endl;
}