URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// PRMS Id: 11596
|
// PRMS Id: 11596
|
|
|
#include
|
#include
|
extern "C" int printf (const char *, ...);
|
extern "C" int printf (const char *, ...);
|
|
|
class Chicken
|
class Chicken
|
{
|
{
|
public:
|
public:
|
int eggs_per_day;
|
int eggs_per_day;
|
};
|
};
|
|
|
template
|
template
|
class Flock
|
class Flock
|
{
|
{
|
public:
|
public:
|
Bird * flock_head;
|
Bird * flock_head;
|
int head_count;
|
int head_count;
|
void print_self() {
|
void print_self() {
|
printf ("A flock of %d %ss\n", head_count, typeid (Bird).name ());
|
printf ("A flock of %d %ss\n", head_count, typeid (Bird).name ());
|
printf ("A flock of %d %ss\n", head_count, typeid (*flock_head).name ());
|
printf ("A flock of %d %ss\n", head_count, typeid (*flock_head).name ());
|
}
|
}
|
};
|
};
|
|
|
int main()
|
int main()
|
{
|
{
|
Flock x;
|
Flock x;
|
printf ("%s\n", typeid(x).name());
|
printf ("%s\n", typeid(x).name());
|
x.head_count = 42;
|
x.head_count = 42;
|
x.print_self();
|
x.print_self();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.