src/work/alpar/named-param-test3.cc
changeset 1365 c280de819a73
parent 1364 ee5959aa4410
child 1366 d00b85f8be45
     1.1 --- a/src/work/alpar/named-param-test3.cc	Sun Apr 17 18:57:22 2005 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,54 +0,0 @@
     1.4 -struct TR 
     1.5 -{
     1.6 -  int a;
     1.7 -  int b;
     1.8 -  int c;
     1.9 -};
    1.10 -
    1.11 -template<class T> struct D : public T
    1.12 -{
    1.13 -  
    1.14 -  D(const T &tt) : T(tt) {};
    1.15 -  
    1.16 -  template<class X> struct TA : public T {
    1.17 -    X a;
    1.18 -    TA(const T &t,const X& x) : T(t), a(x) {};
    1.19 -  };
    1.20 -  
    1.21 -  template<class X> D<TA<X> > setA(const X &x) {
    1.22 -    return D<TA<X> >(TA<X>(*this,x));
    1.23 -  }
    1.24 -
    1.25 -  template<class X> struct TB : public T {
    1.26 -    X b;
    1.27 -    TB(const T &t,const X& x) : T(t), b(x) {};
    1.28 -  };
    1.29 -
    1.30 -  template<class X> D<TB<X> > setB(const X &x) {
    1.31 -    return D<TB<X> >(TB<X>(*this,x));
    1.32 -  }
    1.33 -
    1.34 -  template<class X> struct TC : public T {
    1.35 -    X c;
    1.36 -    TC(const T &t,const X& x) : T(t), c(x) {};
    1.37 -  };
    1.38 -
    1.39 -  template<class X> D<TC<X> > setC(const X &x) {
    1.40 -    return D<TC<X> >(TC<X>(*this,x));
    1.41 -  }
    1.42 -  ~D()
    1.43 -  {
    1.44 -    //Itt csinalunk valamit
    1.45 -  }
    1.46 -};
    1.47 -
    1.48 -D<TR> d() 
    1.49 -{
    1.50 -  return D<TR>(TR());
    1.51 -}
    1.52 -
    1.53 -int main() 
    1.54 -{
    1.55 -  d();
    1.56 -  d().setA(5.5).setB(10).setC(1.5e12);
    1.57 -}