Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TNL
tnl-dev
Commits
4403b2dc
Commit
4403b2dc
authored
Mar 27, 2022
by
Jakub Klinkovský
Browse files
Fixed data corruption error in the Array move-constructor
parent
2c51cea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/TNL/Containers/Array.hpp
View file @
4403b2dc
...
...
@@ -24,6 +24,7 @@ template< typename Value, typename Device, typename Index, typename Allocator >
Array
<
Value
,
Device
,
Index
,
Allocator
>::
Array
(
Array
&&
array
)
noexcept
:
data
(
std
::
move
(
array
.
data
)
),
size
(
std
::
move
(
array
.
size
)
),
allocator
(
std
::
move
(
array
.
allocator
)
)
{
array
.
size
=
0
;
array
.
data
=
nullptr
;
}
...
...
@@ -411,7 +412,6 @@ template< typename Value, typename Device, typename Index, typename Allocator >
Array
<
Value
,
Device
,
Index
,
Allocator
>&
Array
<
Value
,
Device
,
Index
,
Allocator
>::
operator
=
(
const
Array
<
Value
,
Device
,
Index
,
Allocator
>&
array
)
{
// TNL_ASSERT_EQ( array.getSize(), this->getSize(), "Array sizes must be the same." );
if
(
this
->
getSize
()
!=
array
.
getSize
()
)
this
->
setLike
(
array
);
if
(
this
->
getSize
()
>
0
)
...
...
Write
Preview
Supports
Markdown
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