File: test14.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-- 349 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
/***************************************************
 ** specialization for pointer to member function **
 ***************************************************/
 
struct Y {
  void foo() {}
  void bar() {}
};

template < void (Y::*T)() >
struct X {
  X() { Y y; (y.*T)(); }
};

template <>
struct X< &Y::foo > {
};

X< &Y::foo > x1;
X< &Y::bar > x2;