Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Prog2
/
eloadas_peldak
/
ea_08
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
139b0939
authored
May 05, 2022
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iter const fix
parent
982bdb7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
generikus_lista_iter/generikus_lista_iter.hpp
+4
-3
No files found.
generikus_lista_iter/generikus_lista_iter.hpp
View file @
139b0939
...
@@ -58,11 +58,11 @@ public:
...
@@ -58,11 +58,11 @@ public:
bool
operator
!=
(
const
iterator
&
i
)
const
{
// összehasonlít
bool
operator
!=
(
const
iterator
&
i
)
const
{
// összehasonlít
return
(
akt
!=
i
.
akt
);
return
(
akt
!=
i
.
akt
);
}
}
T
&
operator
*
()
{
// indirekció
T
&
operator
*
()
const
{
// indirekció
if
(
akt
!=
NULL
)
return
(
akt
->
adat
);
if
(
akt
!=
NULL
)
return
(
akt
->
adat
);
else
throw
std
::
out_of_range
(
"Hibás"
);
else
throw
std
::
out_of_range
(
"Hibás"
);
}
}
T
*
operator
->
()
{
// indirekció
T
*
operator
->
()
const
{
// indirekció
if
(
akt
!=
NULL
)
return
(
&
akt
->
adat
);
if
(
akt
!=
NULL
)
return
(
&
akt
->
adat
);
else
throw
std
::
out_of_range
(
"Hibás"
);
else
throw
std
::
out_of_range
(
"Hibás"
);
}
}
...
@@ -82,7 +82,8 @@ Lista<T>::~Lista() {
...
@@ -82,7 +82,8 @@ Lista<T>::~Lista() {
template
<
class
T
>
// tagfüggvénysablon
template
<
class
T
>
// tagfüggvénysablon
void
Lista
<
T
>::
beszur
(
const
T
&
dat
)
{
void
Lista
<
T
>::
beszur
(
const
T
&
dat
)
{
ListaElem
*
p
;
// futó pointer
ListaElem
*
p
;
// futó pointer
for
(
p
=
elso
;
p
->
kov
!=
NULL
&&
hasonlit
(
p
->
adat
,
dat
);
p
=
p
->
kov
);
for
(
p
=
elso
;
p
->
kov
!=
NULL
&&
hasonlit
(
p
->
adat
,
dat
);
p
=
p
->
kov
)
;
ListaElem
*
uj
=
new
ListaElem
(
*
p
);
//régit másol
ListaElem
*
uj
=
new
ListaElem
(
*
p
);
//régit másol
p
->
adat
=
dat
;
p
->
kov
=
uj
;
// adat beírása
p
->
adat
=
dat
;
p
->
kov
=
uj
;
// adat beírása
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment