File: test7.cc

package info (click to toggle)
aspectc%2B%2B 1%3A2.3%2Bgit20241211-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 18,148 kB
  • sloc: cpp: 110,334; ansic: 7,644; sh: 2,262; makefile: 1,344; pascal: 634; python: 402; xml: 349
file content (20 lines) | stat: -rw-r--r-- 449 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*********************************************
 ** partial class template specialization   **
 ** and argument deduction against partial  **
 ** class template specialization arguments **
 *********************************************/
 
template <int I>
struct Y {
};

template <class T>
struct X {
};

template <int I>
struct X< Y<I> > {     // <= I has to be deduced to 0
  typedef Y<I> TYPE;   // <= Y<0> has to be instantiated
};

X< Y<0> > x;