---------------
Christof.Meerwald@ freec++.prog

home
> prog
>> freecpp
>>> partial template specialization

translate to German (by SYSTRAN)

Partial Template Specialization

> partial_template_specialization.cpp:

template<class T1, class T2>
struct A
{
  int f()
  { return 1; }
};

template<class T1>
struct A<T1, int>
{
  int f()
  { return 0; }
};


int main(int argc, char *argv[])
{
  A<int, int> a;

  return a.f();
}
---------------

This Web page is licensed under the Creative Commons Attribution - NonCommercial - Share Alike License. Any use is subject to the Privacy Policy.

Revision: 1.2, cmeerw.org/prog/freecpp/partial_template_specialization.html
Last modified: Mon Sep 03 18:20:50 2018
Christof Meerwald <cmeerw@cmeerw.org>
XMPP: cmeerw@cmeerw.org