Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
6bd41c51
Commit
6bd41c51
authored
16 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
missing assignment operator
parent
45bfb91a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
+7
-2
7 additions, 2 deletions
src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
+24
-1
24 additions, 1 deletion
src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
with
31 additions
and
3 deletions
src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
+
7
−
2
View file @
6bd41c51
...
...
@@ -182,9 +182,14 @@ public:
//- Assignment of all addressed entries to the given value
inline
void
operator
=
(
const
T
&
);
//- Assignment from List<T>. Also handles assignment from DynamicList.
inline
void
operator
=
(
const
UList
<
T
>&
);
//- Assignment from DynamicList
inline
void
operator
=
(
const
DynamicList
<
T
,
SizeInc
,
SizeMult
,
SizeDiv
>&
);
//- Assignment from List<T>.
inline
void
operator
=
(
const
UList
<
T
>&
);
// IOstream operators
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
+
24
−
1
View file @
6bd41c51
...
...
@@ -334,13 +334,36 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
(
const
UList
<
T
>&
lst
)
{
if
(
capacity_
>=
lst
.
size
())
{
// can copy w/o reallocating, match initial size to avoid reallocation
List
<
T
>::
size
(
lst
.
size
());
List
<
T
>::
operator
=
(
lst
);
}
else
{
// make everything available for the copy operation
List
<
T
>::
size
(
capacity_
);
List
<
T
>::
operator
=
(
lst
);
capacity_
=
List
<
T
>::
size
();
}
}
template
<
class
T
,
unsigned
SizeInc
,
unsigned
SizeMult
,
unsigned
SizeDiv
>
inline
void
Foam
::
DynamicList
<
T
,
SizeInc
,
SizeMult
,
SizeDiv
>::
operator
=
(
const
DynamicList
<
T
,
SizeInc
,
SizeMult
,
SizeDiv
>&
lst
)
{
if
(
this
==
&
lst
)
{
FatalErrorIn
(
"DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator="
"(const
UList<T
>&)"
"(const
DynamicList<T, SizeInc, SizeMult, SizeDiv
>&)"
)
<<
"attempted assignment to self"
<<
abort
(
FatalError
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment