Annotation of researchv10no/cmd/cfront/ooptcfront/demo/field-nested.c, revision 1.1.1.1

1.1       root        1: #include "check.h"
                      2: // Test nested instantiations, when the instantiations are fields within the
                      3: // the class
                      4:                                           
                      5: template <class p1, class p2> class b {
                      6: public:
                      7:   p1 x ;
                      8:   p2 y ;
                      9:   void foo() ;
                     10: } ;
                     11: 
                     12: template <class pd1, class pd2> class d {
                     13: public:
                     14:   pd1 *i ;
                     15:   void foo() ;
                     16:   b<pd1, pd2> bv ;
                     17: } ;
                     18: 
                     19: 
                     20: typedef char *pc ;
                     21: typedef int *pi ;
                     22: 
                     23: 
                     24: main () {
                     25:   start_test(__FILE__) ;
                     26:   d<int, pc> v1 ;
                     27:   int i ; char c ; int error = 0 ;
                     28: 
                     29:   v1.i = & i ;
                     30:   v1.bv.x = i ;
                     31:   v1.bv.y = & c ;
                     32:   check(v1.i == & i) ;
                     33:   check(v1.bv.x == i) ;
                     34:   check(v1.bv.y == & c) ;
                     35: 
                     36:   end_test() ;
                     37: }

unix.superglobalmegacorp.com

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