File:  [Research Unix] / researchv10no / cmd / cfront / ooptcfront / demo / field-nested.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#include "check.h"
// Test nested instantiations, when the instantiations are fields within the
// the class
					   
template <class p1, class p2> class b {
public:
  p1 x ;
  p2 y ;
  void foo() ;
} ;

template <class pd1, class pd2> class d {
public:
  pd1 *i ;
  void foo() ;
  b<pd1, pd2> bv ;
} ;


typedef char *pc ;
typedef int *pi ;


main () {
  start_test(__FILE__) ;
  d<int, pc> v1 ;
  int i ; char c ; int error = 0 ;

  v1.i = & i ;
  v1.bv.x = i ;
  v1.bv.y = & c ;
  check(v1.i == & i) ;
  check(v1.bv.x == i) ;
  check(v1.bv.y == & c) ;

  end_test() ;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.