Was bedeutet Template ?C++

Programme in C++. Entwicklerforum
Anonymous
 Was bedeutet Template ?

Post by Anonymous »

Ich habe dieses prähistorische Metaprogam -Beispiel gelesen, um festzustellen, ob eine Klasse unterstützt. (oder ein anderes Mitglied). < /p>

Code: Select all

template
class DetectFind
{
struct Fallback { int find; };
struct Derived : T, Fallback { };

template struct Check;

typedef char Yes[1];
typedef char No[2];

template
static No& func(Check*);

template
static Yes& func(...);

public:
typedef DetectFind type;
enum { value = sizeof(func(0)) == sizeof(Yes) };
};

int main()
{
std::cout

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post