X-Git-Url: https://git.dlugolecki.net.pl/?p=genetic.git;a=blobdiff_plain;f=include%2Fchromosome.h;h=bad2bdd410efb1805e72b6a4b3715a4888cf7750;hp=08d24c92c5b422290c0c3198ebf0be700b418963;hb=1e175fb658e55f4cc8b894fff288be22998e78af;hpb=2a8fc81203107eb3495a50fb2666803fda3e0517 diff --git a/include/chromosome.h b/include/chromosome.h index 08d24c9..bad2bdd 100644 --- a/include/chromosome.h +++ b/include/chromosome.h @@ -5,8 +5,6 @@ #include "gene.h" -using namespace std; - namespace genetic { /** * Chromosome of given Genes. @@ -22,7 +20,7 @@ namespace genetic { /** * Genes of the chromosome */ - vector<_Gene> genes; + std::vector<_Gene> genes; template friend class Chromosome; public: @@ -36,7 +34,7 @@ namespace genetic { * * @param genes vector containing Genes to use in Chromosome */ - Chromosome(vector<_Gene> genes) { + Chromosome(const std::vector<_Gene>& genes) { this->genes = genes; } @@ -70,7 +68,7 @@ namespace genetic { * * @return i-th Gene in the current Chromosome */ - _Gene& operator[](unsigned int i) { + _Gene& operator[](const unsigned int i) { return this->genes[i]; } };