File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ class DLL_API Abstract
5151template  <typename  T>
5252class  TemplateClass 
5353{
54+ public: 
55+     T getField () const ;
56+     void  setField (const  T& value);
57+ private: 
5458    union 
5559    {
5660        int  i;
@@ -59,6 +63,18 @@ class TemplateClass
5963    T t;
6064};
6165
66+ template  <typename  T>
67+ T TemplateClass<T>::getField() const 
68+ {
69+     return  t;
70+ }
71+ 
72+ template  <typename  T>
73+ void  TemplateClass<T>::setField(const  T& value)
74+ {
75+     t = value;
76+ }
77+ 
6278template  <typename  T>
6379class  DLL_API  TemplateWithIndependentFields
6480{
@@ -84,3 +100,6 @@ class DLL_API SecondaryBase
84100    ~SecondaryBase ();
85101    void  function ();
86102};
103+ 
104+ //  force the symbols for the template instantiations because we do not have the auto-compilation for the generated C++ source
105+ template  class  DLL_API  TemplateClass<int >;
Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ public void TestNonRenamedMethod()
1818            var  parent  =  derived . Parent ; 
1919            derived . parent ( 0 ) ; 
2020        } 
21+         using  ( var  derived2  =  new  Derived2 ( ) ) 
22+         { 
23+             var  template  =  derived2 . Template ; 
24+             template . Field  =  5 ; 
25+             Assert . That ( template . Field ,  Is . EqualTo ( 5 ) ) ; 
26+         } 
2127    } 
2228
2329    [ Test ] 
Original file line number Diff line number Diff line change @@ -33,6 +33,14 @@ void Derived::setNestedNSComponent(OverlappingNamespace::InBaseLib c)
3333    nestedNSComponent = c;
3434}
3535
36+ Derived2::Derived2 ()
37+ {
38+ }
39+ 
40+ Derived2::~Derived2 ()
41+ {
42+ }
43+ 
3644Base3 Derived2::getBase ()
3745{
3846    return  baseComponent;
@@ -57,6 +65,11 @@ void Derived2::defaultEnumValueFromDependency(OverlappingNamespace::ColorsEnum c
5765{
5866}
5967
68+ TemplateClass<int > Derived2::getTemplate ()
69+ {
70+     return  t;
71+ }
72+ 
6073Abstract* Derived2::getAbstract ()
6174{
6275    return  0 ;
Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ class Base3
4444
4545template  <typename  T> class  TemplateClass ;
4646
47- class  Derived2  : public  Base3 
47+ class  DLL_API   Derived2 : public Base3
4848{
4949public: 
50+     Derived2 ();
51+     ~Derived2 ();
5052    Base3 baseComponent;
5153    Base3 getBase ();
5254    void  setBase (Base3);
@@ -56,6 +58,7 @@ class Derived2 : public Base3
5658    void  setNestedNSComponent (OverlappingNamespace::InDerivedLib);
5759    void  defaultEnumValueFromDependency (OverlappingNamespace::ColorsEnum c = OverlappingNamespace::ColorsEnum::black);
5860
61+     TemplateClass<int > getTemplate ();
5962    Abstract* getAbstract ();
6063private: 
6164    TemplateClass<int > t;
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments