Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Core Modules
dune-common
Commits
12bcf28c
Commit
12bcf28c
authored
7 months ago
by
Simon Praetorius
Browse files
Options
Downloads
Patches
Plain Diff
Update the documentation
parent
907dda71
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1436
Draft: Add a replacement for std::vector
Pipeline
#73631
waiting for manual action
Stage: .pre
Stage: test
Stage: code_quality
Stage: downstream
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/common/vector.hh
+8
-14
8 additions, 14 deletions
dune/common/vector.hh
with
8 additions
and
14 deletions
dune/common/vector.hh
+
8
−
14
View file @
12bcf28c
...
...
@@ -5,11 +5,8 @@
#ifndef DUNE_COMMON_VECTOR_HH
#define DUNE_COMMON_VECTOR_HH
#include
<cstddef>
#include
<initializer_list>
#include
<memory>
#include
<stdexcept>
#include
<type_traits>
#include
<vector>
#include
<dune/common/ftraits.hh>
...
...
@@ -20,15 +17,13 @@ namespace Dune {
/**
* \brief Vector is a sequence container that encapsulates dynamic size arrays.
*
* This sequence container data structure is similar to the `std::vector` container
* without the inremental size-changing operations, like `push_back`. The motivation
* for developing our own data container is the unfortunate specialization of the
* `std::vector<bool>` with proxy reference types. This leads to lots of codes where
* boolean values are to be represented as `char` or `int`.
*
* This container is a more restrictive than the `std::vector` implementation. We
* do not allow incremental size changes. The `resize()` function creates a new
* storage even if the size is reduced.
* This sequence container derives from `std::vector`, except for the element type
* `bool`. There, a `bool`-wrapper type is used as element type to workaround the
* `std::vector<bool>` specialization issue. Note, in general you should prefer
* the `std::vector` container directly. Only if you are aware of the `bool`
* issue and it matters in your application, this derived type `Dune::Vector`
* could be a replacement. It is mainly used as internal data structure in other
* Dune containers.
*
* \tparam Element The type of the elements stored in the container.
* \tparam An allocator that is used to acquire/release memory and to construct/destroy
...
...
@@ -288,8 +283,7 @@ public:
using
BaseType
::
resize
;
/// \brief Changes the number of elements stored and set the value of all elements to `value`.
/// If `count != size` allocate new storage with the given initial value.
/// \brief Changes the number of elements stored
constexpr
void
resize
(
size_type
count
,
const
value_type
&
value
)
{
BaseType
::
resize
(
count
,
Impl
::
BoolType
{
value
});
...
...
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