Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace use of C-style array by std::array. #5205

Merged
merged 1 commit into from
Jul 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 4 additions & 13 deletions include/aspect/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace dealii
template <int dim>
struct VectorDoFTuple
{
types::global_dof_index dof_indices[dim];
std::array<types::global_dof_index,dim> dof_indices;

VectorDoFTuple()
{
Expand All @@ -64,28 +64,19 @@ namespace dealii
bool
operator<(const VectorDoFTuple<dim> &other) const
{
for (unsigned int i = 0; i < dim; ++i)
if (dof_indices[i] < other.dof_indices[i])
return true;
else if (dof_indices[i] > other.dof_indices[i])
return false;
return false;
return (dof_indices < other.dof_indices);
}

bool
operator==(const VectorDoFTuple<dim> &other) const
{
for (unsigned int i = 0; i < dim; ++i)
if (dof_indices[i] != other.dof_indices[i])
return false;

return true;
return (dof_indices == other.dof_indices);
}

bool
operator!=(const VectorDoFTuple<dim> &other) const
{
return !(*this == other);
return (dof_indices != other.dof_indices);
}
};

Expand Down