C++ typedef with nested templates is not a class, struct, or union type -


I'm not sure why the following code is compiled with g ++:

  TPPP: Delib & Lt; Double & gt; ????: t.cpp: 28: 56: Instant 'Separator' and 'Lieutenant; Delivery & lieutenant; Solutions & lt; Double & gt; & Gt; & Gt; Line TCPP: 35: 48: TPPP started from here 16: 45: Error: A double class, structure, or union type TPPP 18: 43: No: is a double ???? A class, structure, or union type   

I was expecting to be able to promote the AtomType type in nested templates ?? |

  #include & lt; Iostream & gt; # Include & lt; Vector & gt; Template & lt; Typename T & gt; Class Solutions {Public: Type-FTP Automation; }; Template & lt; Typename SOLT & gt; Class distribution {public: typed type name SOLT :: AtomType AtomType; Typefacefed Study :: Vector & lt; Attempex & gt; Matrix; Matrix matrix; }; Template & lt; Typename dt & gt; Class sampler {public: typipeef typewriter DT :: atmatotype attempepe; Typefif typename distributor & lt; AtomType & gt; :: Matrix Matrix; Matrix matrix; }; Int main () {sample & lt; Distrib & LT; Resolve & lt; Double & gt; & Gt; & Gt; Sample; } <   

In your sampler category, you have: < / P>

  typingfile typename distrib & lt; AtomType & gt; :: Matrix Matrix;   

Here, is autotype is double , so it is

  typedef typename Distrib & lt; Double & gt; :: Matrix Matrix;   

and then in your distribution category, line

  typedef typename SOLT :: AtomType AtomType;   

extension

  typedef typed double :: AtomType AtomType;   

So error message I think you want to be in the sampler class:

  type typed typename DT: : Matrix Matrix;    

Comments