All pastes #795712 Raw Edit

Anonymous

public text v1 · immutable
#795712 ·published 2007-11-24 10:53 UTC
rendered paste body
template<class T>
class list
{
  public:
    void add(T& v);
    void del(int i);
    void find(T& v);
    template<class U>
    void find_if(U functor);
};

template<class T>
class list_proxy
{
    list<T>& list_;
  public:
    list_proxy(list<T>& l): list_(l) {};

    void add(T& v){throw std::string("resticted");}
    void del(int i){throw std::string("resticted");}
    const T find(T& v){return list_.find(v);}
    template<class U>
    const T& find_if(U functor){return list_.find_if(functor); }
};