summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/ptrmem22.C
blob: 762f377f5b79186dddd2b4af4427683d74e74c19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// PR c++/44778

enum Healpix_Ordering_Scheme { RING, NEST };

class Healpix_Base
  {
  protected:
    Healpix_Ordering_Scheme scheme_;
    int nest2ring (int pix) const;
    int ring2nest (int pix) const;

    typedef int (Healpix_Base::*swapfunc)(int pix) const;
  };

template<typename T> class Healpix_Map: public Healpix_Base
  {
  public:
    void Import_nograde (const Healpix_Map<T> &orig)
      {
        swapfunc swapper = (scheme_ == NEST) ?
          &Healpix_Map::ring2nest : &Healpix_Map::nest2ring;
      }
  };

int main()
  {
  Healpix_Map<double> a,b;
  a.Import_nograde(b);
  }