dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
genetic.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Add copy constructors. Make example working.
[genetic.git]
/
src
/
gene.h
1
#ifndef __GENE_H
2
#define __GENE_H
3
4
namespace genetic {
5
6
template < typename Type >
7
class Gene {
8
protected:
9
Type value;
10
public:
11
Gene() {}
12
13
Gene(Type value) {
14
this->value = value;
15
}
16
17
/** Copy constructor */
18
Gene(const Gene& gene) : value(gene.get()) {}
19
20
Gene& operator=(const Gene&){
21
return *this;
22
}
23
24
Type get() const {
25
return value;
26
}
27
};
28
}
29
30
#endif /* __GENE_H */