-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodo.cpp
More file actions
41 lines (27 loc) · 722 Bytes
/
Nodo.cpp
File metadata and controls
41 lines (27 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "Nodo.h"
#include <utility>
#define VACIO ""
Nodo::Nodo(const std::string& _clave, const std::list<std::size_t>& _valor) :
clave(_clave), valor(_valor) {}
Nodo& Nodo::operator=(Nodo&& otro) {
if (this == &otro) return *this;
this->clave = std::move(otro.clave);
this->valor = std::move(otro.valor);
otro.clave = VACIO;
otro.valor.clear();
return *this;
}
Nodo::Nodo(Nodo&& otro) {
if (this == &otro) return;
this->clave = std::move(otro.clave);
this->valor = std::move(otro.valor);
otro.clave = VACIO;
otro.valor.clear();
}
void Nodo::agregarValor(const std::size_t _valor) {
this->valor.push_back(_valor);
}
Lista Nodo::obtenerValor() const {
return this->valor;
}
Nodo::~Nodo() {}