OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.hp/] [gdb.objdbg/] [objdbg04/] [x.h] - Blame information for rev 24

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
template <class T>
2
class Adder {
3
public:
4
  void set(T);
5
  T get();
6
  T add(T);
7
 
8
private:
9
  T val;
10
};
11
 
12
template <class T>
13
void Adder<T>::set(T new_val)
14
{
15
  val = new_val;
16
}
17
 
18
template <class T>
19
T Adder<T>::get()
20
{
21
  return val;
22
}
23
 
24
template <class T>
25
T Adder<T>::add(T new_val)
26
{
27
  val += new_val;
28
  return val;
29
}
30
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.