mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
Made all template declarations consistent using 'class' rather than 'typename'
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
template <class Type> class List {
|
||||
template<class Type> class List {
|
||||
public:
|
||||
List(int s=0);
|
||||
~List();
|
||||
@ -30,7 +30,7 @@ template <class Type> class List {
|
||||
};
|
||||
|
||||
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
List<Type>::List(int s){
|
||||
num=0;
|
||||
array_size = 0;
|
||||
@ -40,12 +40,12 @@ List<Type>::List(int s){
|
||||
}
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
List<Type>::~List(){
|
||||
delete element;
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
void List<Type>::allocate(int s){
|
||||
assert(s>0);
|
||||
assert(s>=num);
|
||||
@ -58,18 +58,18 @@ void List<Type>::allocate(int s){
|
||||
}
|
||||
if(old) delete old;
|
||||
}
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
void List<Type>::SetSize(int s){
|
||||
if(s==0) { if(element) delete element;}
|
||||
else { allocate(s); }
|
||||
num=s;
|
||||
}
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
void List<Type>::Pack(){
|
||||
allocate(num);
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
void List<Type>::Add(Type t){
|
||||
assert(num<=array_size);
|
||||
if(num==array_size) {
|
||||
@ -83,7 +83,7 @@ void List<Type>::Add(Type t){
|
||||
element[num++] = t;
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
int List<Type>::Contains(Type t){
|
||||
int i;
|
||||
int count=0;
|
||||
@ -93,13 +93,13 @@ int List<Type>::Contains(Type t){
|
||||
return count;
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
void List<Type>::AddUnique(Type t){
|
||||
if(!Contains(t)) Add(t);
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
void List<Type>::DelIndex(int i){
|
||||
assert(i<num);
|
||||
num--;
|
||||
@ -109,7 +109,7 @@ void List<Type>::DelIndex(int i){
|
||||
}
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
template<class Type>
|
||||
void List<Type>::Remove(Type t){
|
||||
int i;
|
||||
for(i=0;i<num;i++) {
|
||||
|
||||
Reference in New Issue
Block a user