From 6f771f424bfac7a0da4cf3574ee17a4bde8a9dea Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 27 Jun 2018 15:13:01 +0200 Subject: [PATCH] Replace typedef by using in include --- include/deal.II/base/aligned_vector.h | 16 +- include/deal.II/base/array_view.h | 12 +- include/deal.II/base/complex_overloads.h | 8 +- include/deal.II/base/data_out_base.h | 8 +- include/deal.II/base/exceptions.h | 2 +- include/deal.II/base/function_parser.h | 4 +- include/deal.II/base/index_set.h | 32 +-- include/deal.II/base/iterator_range.h | 16 +- include/deal.II/base/linear_index_iterator.h | 31 +-- include/deal.II/base/mg_level_object.h | 2 +- include/deal.II/base/mpi.h | 6 +- include/deal.II/base/numbers.h | 8 +- include/deal.II/base/parallel.h | 25 ++- include/deal.II/base/parsed_function.h | 2 +- include/deal.II/base/path_search.h | 2 +- include/deal.II/base/patterns.h | 16 +- include/deal.II/base/qprojector.h | 4 +- include/deal.II/base/quadrature.h | 4 +- include/deal.II/base/quadrature_point_data.h | 6 +- include/deal.II/base/subscriptor.h | 4 +- include/deal.II/base/symmetric_tensor.h | 87 ++++---- .../deal.II/base/symmetric_tensor.templates.h | 7 +- include/deal.II/base/table.h | 108 +++++----- include/deal.II/base/table_handler.h | 5 +- include/deal.II/base/template_constraints.h | 48 ++--- include/deal.II/base/tensor.h | 26 ++- include/deal.II/base/tensor_accessors.h | 75 ++++--- include/deal.II/base/tensor_function.h | 6 +- include/deal.II/base/thread_management.h | 20 +- include/deal.II/base/timer.h | 26 +-- include/deal.II/base/types.h | 22 +- include/deal.II/base/vectorization.h | 2 +- include/deal.II/base/work_stream.h | 24 +-- .../differentiation/ad/ad_number_traits.h | 31 ++- .../differentiation/ad/adolc_number_types.h | 16 +- .../differentiation/ad/adolc_product_types.h | 68 +++---- .../differentiation/ad/sacado_number_types.h | 100 +++++---- .../differentiation/ad/sacado_product_types.h | 69 +++---- include/deal.II/distributed/p4est_wrappers.h | 68 +++---- include/deal.II/distributed/shared_tria.h | 9 +- include/deal.II/distributed/tria.h | 30 ++- .../deal.II/dofs/deprecated_function_map.h | 61 +++--- include/deal.II/dofs/dof_accessor.h | 55 +++-- include/deal.II/dofs/dof_handler.h | 66 +++--- include/deal.II/dofs/dof_iterator_selector.h | 156 +++++++-------- .../fe/fe_tools_extrapolate.templates.h | 2 +- include/deal.II/fe/fe_update_flags.h | 8 +- include/deal.II/fe/fe_values.h | 189 ++++++++---------- include/deal.II/grid/cell_id.h | 2 +- include/deal.II/grid/filtered_iterator.h | 20 +- include/deal.II/grid/grid_generator.h | 6 +- include/deal.II/grid/grid_tools.h | 22 +- include/deal.II/grid/intergrid_map.h | 2 +- include/deal.II/grid/manifold.h | 4 +- include/deal.II/grid/tria.h | 93 +++++---- include/deal.II/grid/tria_accessor.h | 26 +-- include/deal.II/grid/tria_iterator.h | 42 ++-- include/deal.II/grid/tria_iterator_selector.h | 142 ++++++------- include/deal.II/hp/dof_handler.h | 52 +++-- include/deal.II/hp/dof_level.h | 6 +- include/deal.II/hp/fe_collection.h | 2 +- include/deal.II/lac/affine_constraints.h | 16 +- .../lac/affine_constraints.templates.h | 20 +- include/deal.II/lac/arpack_solver.h | 2 +- include/deal.II/lac/block_indices.h | 2 +- include/deal.II/lac/block_linear_operator.h | 29 ++- include/deal.II/lac/block_matrix_array.h | 11 +- include/deal.II/lac/block_matrix_base.h | 44 ++-- include/deal.II/lac/block_sparse_matrix.h | 24 +-- include/deal.II/lac/block_sparse_matrix_ez.h | 2 +- include/deal.II/lac/block_sparsity_pattern.h | 4 +- include/deal.II/lac/block_vector.h | 26 +-- include/deal.II/lac/block_vector_base.h | 66 +++--- include/deal.II/lac/chunk_sparse_matrix.h | 31 ++- .../lac/chunk_sparse_matrix.templates.h | 2 +- include/deal.II/lac/chunk_sparsity_pattern.h | 11 +- include/deal.II/lac/cuda_sparse_matrix.h | 6 +- include/deal.II/lac/cuda_vector.h | 6 +- include/deal.II/lac/diagonal_matrix.h | 4 +- .../deal.II/lac/dynamic_sparsity_pattern.h | 8 +- include/deal.II/lac/eigen.h | 4 +- include/deal.II/lac/filtered_matrix.h | 8 +- include/deal.II/lac/full_matrix.h | 10 +- include/deal.II/lac/generic_linear_algebra.h | 74 +++---- include/deal.II/lac/householder.h | 2 +- include/deal.II/lac/identity_matrix.h | 2 +- .../deal.II/lac/la_parallel_block_vector.h | 26 +-- include/deal.II/lac/la_parallel_vector.h | 18 +- include/deal.II/lac/la_vector.h | 4 +- include/deal.II/lac/la_vector.templates.h | 18 +- include/deal.II/lac/lapack_full_matrix.h | 2 +- include/deal.II/lac/lapack_support.h | 4 +- include/deal.II/lac/linear_operator.h | 2 +- include/deal.II/lac/matrix_block.h | 14 +- include/deal.II/lac/matrix_iterator.h | 4 +- include/deal.II/lac/matrix_lib.h | 2 +- include/deal.II/lac/matrix_out.h | 4 +- include/deal.II/lac/packaged_operation.h | 2 +- include/deal.II/lac/parpack_solver.h | 2 +- include/deal.II/lac/petsc_full_matrix.h | 2 +- include/deal.II/lac/petsc_matrix_base.h | 14 +- .../lac/petsc_parallel_block_sparse_matrix.h | 24 +-- .../deal.II/lac/petsc_parallel_block_vector.h | 24 +-- .../lac/petsc_parallel_sparse_matrix.h | 2 +- include/deal.II/lac/petsc_parallel_vector.h | 2 +- include/deal.II/lac/petsc_vector_base.h | 12 +- include/deal.II/lac/pointer_matrix.h | 2 +- include/deal.II/lac/precondition.h | 38 ++-- include/deal.II/lac/precondition_block.h | 18 +- include/deal.II/lac/precondition_block_base.h | 2 +- include/deal.II/lac/precondition_selector.h | 2 +- include/deal.II/lac/read_write_vector.h | 18 +- include/deal.II/lac/relaxation_block.h | 12 +- include/deal.II/lac/scalapack.h | 2 +- include/deal.II/lac/solver.h | 6 +- include/deal.II/lac/solver_cg.h | 2 +- include/deal.II/lac/solver_minres.h | 8 +- include/deal.II/lac/solver_selector.h | 4 +- include/deal.II/lac/sparse_decomposition.h | 2 +- include/deal.II/lac/sparse_direct.h | 2 +- include/deal.II/lac/sparse_ilu.h | 4 +- include/deal.II/lac/sparse_matrix.h | 33 ++- include/deal.II/lac/sparse_matrix.templates.h | 2 +- include/deal.II/lac/sparse_matrix_ez.h | 6 +- include/deal.II/lac/sparse_mic.h | 4 +- include/deal.II/lac/sparse_vanka.h | 4 +- include/deal.II/lac/sparse_vanka.templates.h | 32 ++- include/deal.II/lac/sparsity_pattern.h | 19 +- include/deal.II/lac/tridiagonal_matrix.h | 2 +- .../lac/trilinos_block_sparse_matrix.h | 26 +-- .../deal.II/lac/trilinos_linear_operator.h | 52 +++-- .../lac/trilinos_parallel_block_vector.h | 24 +-- include/deal.II/lac/trilinos_precondition.h | 2 +- include/deal.II/lac/trilinos_sparse_matrix.h | 30 +-- .../deal.II/lac/trilinos_sparsity_pattern.h | 10 +- include/deal.II/lac/trilinos_vector.h | 16 +- include/deal.II/lac/vector.h | 20 +- include/deal.II/lac/vector_memory.h | 4 +- .../deal.II/lac/vector_operations_internal.h | 2 +- include/deal.II/lac/vector_space_vector.h | 6 +- include/deal.II/lac/vector_view.h | 2 +- .../deal.II/matrix_free/cuda_fe_evaluation.h | 12 +- .../deal.II/matrix_free/cuda_matrix_free.h | 4 +- .../matrix_free/cuda_matrix_free.templates.h | 9 +- .../deal.II/matrix_free/evaluation_kernels.h | 54 +++-- include/deal.II/matrix_free/fe_evaluation.h | 78 ++++---- .../matrix_free/mapping_info.templates.h | 6 +- include/deal.II/matrix_free/matrix_free.h | 50 ++--- include/deal.II/matrix_free/operators.h | 50 ++--- include/deal.II/matrix_free/task_info.h | 3 +- include/deal.II/meshworker/assembler.h | 9 +- include/deal.II/meshworker/integration_info.h | 2 +- .../deal.II/multigrid/mg_constrained_dofs.h | 2 +- include/deal.II/multigrid/mg_transfer.h | 24 +-- .../deal.II/multigrid/mg_transfer.templates.h | 30 +-- .../multigrid/mg_transfer_block.templates.h | 2 +- .../mg_transfer_component.templates.h | 8 +- include/deal.II/multigrid/multigrid.h | 4 +- include/deal.II/numerics/data_out.h | 9 +- include/deal.II/numerics/data_out_dof_data.h | 12 +- .../numerics/data_out_dof_data.templates.h | 8 +- include/deal.II/numerics/data_out_faces.h | 11 +- include/deal.II/numerics/data_out_rotation.h | 4 +- .../numerics/derivative_approximation.h | 2 +- include/deal.II/numerics/fe_field_function.h | 5 +- .../numerics/fe_field_function.templates.h | 2 +- include/deal.II/numerics/kdtree.h | 11 +- .../numerics/matrix_creator.templates.h | 8 +- include/deal.II/numerics/time_dependent.h | 12 +- .../deal.II/numerics/vector_tools.templates.h | 76 ++++--- .../deal.II/optimization/rol/vector_adaptor.h | 6 +- include/deal.II/particles/particle.h | 8 +- include/deal.II/particles/particle_handler.h | 4 +- include/deal.II/particles/particle_iterator.h | 12 +- include/deal.II/particles/property_pool.h | 2 +- include/deal.II/sundials/arkode.h | 4 +- include/deal.II/sundials/ida.h | 4 +- 177 files changed, 1741 insertions(+), 1831 deletions(-) diff --git a/include/deal.II/base/aligned_vector.h b/include/deal.II/base/aligned_vector.h index fc9583a558..78184caec6 100644 --- a/include/deal.II/base/aligned_vector.h +++ b/include/deal.II/base/aligned_vector.h @@ -65,14 +65,14 @@ public: * Declare standard types used in all containers. These types parallel those * in the C++ standard libraries vector<...> class. */ - typedef T value_type; - typedef value_type * pointer; - typedef const value_type *const_pointer; - typedef value_type * iterator; - typedef const value_type *const_iterator; - typedef value_type & reference; - typedef const value_type &const_reference; - typedef std::size_t size_type; + using value_type = T; + using pointer = value_type *; + using const_pointer = const value_type *; + using iterator = value_type *; + using const_iterator = const value_type *; + using reference = value_type &; + using const_reference = const value_type &; + using size_type = std::size_t; /** * Empty constructor. Sets the vector size to zero. diff --git a/include/deal.II/base/array_view.h b/include/deal.II/base/array_view.h index b50ee7854e..4a0494c82b 100644 --- a/include/deal.II/base/array_view.h +++ b/include/deal.II/base/array_view.h @@ -80,20 +80,20 @@ class ArrayView { public: /** - * A typedef that denotes the "value_type" of this container-like class, + * An alias that denotes the "value_type" of this container-like class, * i.e., the type of the element it "stores" or points to. */ - typedef ElementType value_type; + using value_type = ElementType; /** - * A typedef for iterators pointing into the array. + * An alias for iterators pointing into the array. */ - typedef value_type *iterator; + using iterator = value_type *; /** - * A typedef for const iterators pointing into the array. + * An alias for const iterators pointing into the array. */ - typedef const ElementType *const_iterator; + using const_iterator = const ElementType *; /** * Constructor. diff --git a/include/deal.II/base/complex_overloads.h b/include/deal.II/base/complex_overloads.h index e648613cb6..e95bed9a95 100644 --- a/include/deal.II/base/complex_overloads.h +++ b/include/deal.II/base/complex_overloads.h @@ -40,8 +40,8 @@ template typename ProductType, std::complex>::type inline operator*(const std::complex &left, const std::complex &right) { - typedef - typename ProductType, std::complex>::type result_type; + using result_type = + typename ProductType, std::complex>::type; return static_cast(left) * static_cast(right); } @@ -59,7 +59,7 @@ typename ProductType, typename EnableIfScalar::type>::type inline operator*(const std::complex &left, const U &right) { - typedef typename ProductType, U>::type result_type; + using result_type = typename ProductType, U>::type; return static_cast(left) * static_cast(right); } @@ -77,7 +77,7 @@ typename ProductType::type, std::complex>::type inline operator*(const T &left, const std::complex &right) { - typedef typename ProductType, U>::type result_type; + using result_type = typename ProductType, U>::type; return static_cast(left) * static_cast(right); } #endif /* DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS */ diff --git a/include/deal.II/base/data_out_base.h b/include/deal.II/base/data_out_base.h index 6db6b620be..43e7c88453 100644 --- a/include/deal.II/base/data_out_base.h +++ b/include/deal.II/base/data_out_base.h @@ -942,9 +942,9 @@ namespace DataOutBase * Besides the actual value by which the color is to be computed, min and * max values of the data to be colorized are given as well. */ - typedef RgbValues (*ColorFunction)(const double value, - const double min_value, - const double max_value); + using ColorFunction = RgbValues (*)(const double value, + const double min_value, + const double max_value); /** * This is a pointer to the function which is used to colorize the cells. @@ -1447,7 +1447,7 @@ namespace DataOutBase } }; - typedef std::multimap, unsigned int, Point3Comp> Map3DPoint; + using Map3DPoint = std::multimap, unsigned int, Point3Comp>; /** * Flags used to specify filtering behavior. diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index 88d73270a9..6ff4068d00 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -1391,7 +1391,7 @@ namespace internal template struct argument_type { - typedef U type; + using type = U; }; } // namespace internal diff --git a/include/deal.II/base/function_parser.h b/include/deal.II/base/function_parser.h index 49c8f2e260..7efdedf006 100644 --- a/include/deal.II/base/function_parser.h +++ b/include/deal.II/base/function_parser.h @@ -220,12 +220,12 @@ public: /** * Type for the constant map. Used by the initialize() method. */ - typedef std::map ConstMap; + using ConstMap = std::map; /** * Iterator for the constants map. Used by the initialize() method. */ - typedef ConstMap::iterator ConstMapIterator; + using ConstMapIterator = ConstMap::iterator; /** * Initialize the function. This methods accepts the following parameters: diff --git a/include/deal.II/base/index_set.h b/include/deal.II/base/index_set.h index 42dd03323e..7246e0bfa2 100644 --- a/include/deal.II/base/index_set.h +++ b/include/deal.II/base/index_set.h @@ -36,7 +36,7 @@ #if defined(DEAL_II_WITH_MPI) || defined(DEAL_II_WITH_PETSC) # include #else -typedef int MPI_Comm; +using MPI_Comm = int; # ifndef MPI_COMM_WORLD # define MPI_COMM_WORLD 0 # endif @@ -79,14 +79,14 @@ public: * @p size_type is the type used for storing the size and the individual * entries in the IndexSet. */ - typedef types::global_dof_index size_type; + using size_type = types::global_dof_index; /** * One can see an IndexSet as a container of size size(), where the elements * of the containers are bool values that are either false or true, * depending on whether a particular index is an element of the IndexSet or * not. In other words, an IndexSet is a bit like a vector in which the - * elements we store are booleans. In this view, the correct local typedef + * elements we store are booleans. In this view, the correct local alias * indicating the type of the elements of the vector would then be @p bool. * * On the other hand, @p bool has the disadvantage that it is not a @@ -98,7 +98,7 @@ public: * other words, declaring the type of the elements of the vector as a signed * integer is only a small lie, but it is a useful one. */ - typedef signed int value_type; + using value_type = signed int; /** @@ -650,15 +650,15 @@ public: operator-(const IntervalIterator &p) const; /** - * Mark the class as forward iterator and declare some typedefs which are + * Mark the class as forward iterator and declare some alias which are * standard for iterators and are used by algorithms to enquire about the * specifics of the iterators they work on. */ - typedef std::forward_iterator_tag iterator_category; - typedef IntervalAccessor value_type; - typedef std::ptrdiff_t difference_type; - typedef IntervalAccessor * pointer; - typedef IntervalAccessor & reference; + using iterator_category = std::forward_iterator_tag; + using value_type = IntervalAccessor; + using difference_type = std::ptrdiff_t; + using pointer = IntervalAccessor *; + using reference = IntervalAccessor &; private: /** @@ -741,15 +741,15 @@ public: operator-(const ElementIterator &p) const; /** - * Mark the class as forward iterator and declare some typedefs which are + * Mark the class as forward iterator and declare some alias which are * standard for iterators and are used by algorithms to enquire about the * specifics of the iterators they work on. */ - typedef std::forward_iterator_tag iterator_category; - typedef size_type value_type; - typedef std::ptrdiff_t difference_type; - typedef size_type * pointer; - typedef size_type & reference; + using iterator_category = std::forward_iterator_tag; + using value_type = size_type; + using difference_type = std::ptrdiff_t; + using pointer = size_type *; + using reference = size_type &; private: /** diff --git a/include/deal.II/base/iterator_range.h b/include/deal.II/base/iterator_range.h index eb45a2f8ee..cf09a4f6e7 100644 --- a/include/deal.II/base/iterator_range.h +++ b/include/deal.II/base/iterator_range.h @@ -128,7 +128,7 @@ public: * Typedef the elements of the collection to give them a name that is more * distinct. */ - typedef Iterator BaseIterator; + using BaseIterator = Iterator; /** * Constructor. Initialize this iterator-over-iterator in such a way that @@ -175,15 +175,15 @@ public: operator!=(const IteratorOverIterators &i_o_i); /** - * Mark the class as forward iterator and declare some typedefs which are + * Mark the class as forward iterator and declare some alias which are * standard for iterators and are used by algorithms to enquire about the * specifics of the iterators they work on. */ - typedef std::forward_iterator_tag iterator_category; - typedef Iterator value_type; - typedef typename Iterator::difference_type difference_type; - typedef Iterator * pointer; - typedef Iterator & reference; + using iterator_category = std::forward_iterator_tag; + using value_type = Iterator; + using difference_type = typename Iterator::difference_type; + using pointer = Iterator *; + using reference = Iterator &; private: /** @@ -196,7 +196,7 @@ public: /** * Typedef for the iterator type represent by this class. */ - typedef Iterator iterator; + using iterator = Iterator; /** * Default constructor. Create a range represented by two default diff --git a/include/deal.II/base/linear_index_iterator.h b/include/deal.II/base/linear_index_iterator.h index de4047b15a..f7be30427b 100644 --- a/include/deal.II/base/linear_index_iterator.h +++ b/include/deal.II/base/linear_index_iterator.h @@ -56,12 +56,13 @@ DEAL_II_NAMESPACE_OPEN * { * public: * // const iterators store a const pointer - * typedef typename std::conditional*, - * Container*>::type - * container_pointer_type; + * using container_pointer_type + * = typename std::conditional*, + * Container*>::type; * - * // This typedef is assumed to exist. - * typedef std::size_t size_type; + * // This alias is assumed to exist. + * using size_type = std::size_t; * * // constructor. * Accessor(const container_pointer_type container, @@ -94,9 +95,9 @@ DEAL_II_NAMESPACE_OPEN * }; * * public: - * typedef std::size_t size_type; - * typedef Iterator const_iterator; - * typedef Iterator iterator; + * using size_type = std::size_t; + * using const_iterator = Iterator; + * using iterator = Iterator; * * iterator begin (); * iterator end (); @@ -143,33 +144,33 @@ public: /** * Iterator category. */ - typedef std::random_access_iterator_tag iterator_category; + using iterator_category = std::random_access_iterator_tag; /** - * A typedef for the type you get when you dereference an iterator of the + * An alias for the type you get when you dereference an iterator of the * current kind. */ - typedef AccessorType value_type; + using value_type = AccessorType; /** * Difference type. */ - typedef std::ptrdiff_t difference_type; + using difference_type = std::ptrdiff_t; /** * Reference type. */ - typedef const value_type &reference; + using reference = const value_type &; /** * Pointer type. */ - typedef const value_type *pointer; + using pointer = const value_type *; /** * Size type used by the underlying container. */ - typedef typename value_type::size_type size_type; + using size_type = typename value_type::size_type; /** * Copy operator. diff --git a/include/deal.II/base/mg_level_object.h b/include/deal.II/base/mg_level_object.h index 3aaa2adf88..dfe65a39c0 100644 --- a/include/deal.II/base/mg_level_object.h +++ b/include/deal.II/base/mg_level_object.h @@ -286,7 +286,7 @@ std::size_t MGLevelObject::memory_consumption() const { std::size_t result = sizeof(*this); - typedef typename std::vector>::const_iterator Iter; + using Iter = typename std::vector>::const_iterator; const Iter end = objects.end(); for (Iter o = objects.begin(); o != end; ++o) result += (*o)->memory_consumption(); diff --git a/include/deal.II/base/mpi.h b/include/deal.II/base/mpi.h index d9fb558b1c..a86996fe08 100644 --- a/include/deal.II/base/mpi.h +++ b/include/deal.II/base/mpi.h @@ -27,9 +27,9 @@ // without MPI, we would still like to use // some constructs with MPI data // types. Therefore, create some dummies -typedef int MPI_Comm; -typedef int MPI_Datatype; -typedef int MPI_Op; +using MPI_Comm = int; +using MPI_Datatype = int; +using MPI_Op = int; # ifndef MPI_COMM_WORLD # define MPI_COMM_WORLD 0 # endif diff --git a/include/deal.II/base/numbers.h b/include/deal.II/base/numbers.h index b29833536b..db7c151643 100644 --- a/include/deal.II/base/numbers.h +++ b/include/deal.II/base/numbers.h @@ -336,12 +336,12 @@ namespace numbers static const bool is_complex = false; /** - * For this data type, typedef the corresponding real type. Since the + * For this data type, alias the corresponding real type. Since the * general template is selected for all data types that are not * specializations of std::complex, the underlying type must be real- * values, so the real_type is equal to the underlying type. */ - typedef number real_type; + using real_type = number; /** * Return the complex-conjugate of the given number. Since the general @@ -386,12 +386,12 @@ namespace numbers static const bool is_complex = true; /** - * For this data type, typedef the corresponding real type. Since this + * For this data type, alias the corresponding real type. Since this * specialization of the template is selected for number types * std::complex, the real type is equal to the type used to store the * two components of the complex number. */ - typedef number real_type; + using real_type = number; /** * Return the complex-conjugate of the given number. diff --git a/include/deal.II/base/parallel.h b/include/deal.II/base/parallel.h index d0ffb55744..9f82c11750 100644 --- a/include/deal.II/base/parallel.h +++ b/include/deal.II/base/parallel.h @@ -184,9 +184,9 @@ namespace parallel for (OutputIterator in = begin_in; in != end_in;) *out++ = predicate(*in++); #else - typedef std::tuple Iterators; - typedef SynchronousIterators SyncIterators; - Iterators x_begin(begin_in, out); + using Iterators = std::tuple; + using SyncIterators = SynchronousIterators; + Iterators x_begin(begin_in, out); Iterators x_end(end_in, OutputIterator()); tbb::parallel_for(tbb::blocked_range(x_begin, x_end, @@ -241,10 +241,10 @@ namespace parallel for (OutputIterator in1 = begin_in1; in1 != end_in1;) *out++ = predicate(*in1++, *in2++); #else - typedef std::tuple - Iterators; - typedef SynchronousIterators SyncIterators; - Iterators x_begin(begin_in1, in2, out); + using Iterators = + std::tuple; + using SyncIterators = SynchronousIterators; + Iterators x_begin(begin_in1, in2, out); Iterators x_end(end_in1, InputIterator2(), OutputIterator()); tbb::parallel_for(tbb::blocked_range(x_begin, x_end, @@ -301,12 +301,11 @@ namespace parallel for (OutputIterator in1 = begin_in1; in1 != end_in1;) *out++ = predicate(*in1++, *in2++, *in3++); #else - typedef std:: - tuple - Iterators; - typedef SynchronousIterators SyncIterators; - Iterators x_begin(begin_in1, in2, in3, out); - Iterators x_end(end_in1, + using Iterators = std:: + tuple; + using SyncIterators = SynchronousIterators; + Iterators x_begin(begin_in1, in2, in3, out); + Iterators x_end(end_in1, InputIterator2(), InputIterator3(), OutputIterator()); diff --git a/include/deal.II/base/parsed_function.h b/include/deal.II/base/parsed_function.h index 8a2b497a0a..8c8420c95d 100644 --- a/include/deal.II/base/parsed_function.h +++ b/include/deal.II/base/parsed_function.h @@ -144,7 +144,7 @@ namespace Functions * * @code * - * set Function expression = cos(pi*x) ; cos(pi*y) + * set Function expression = cos(pi*x); cos(pi*y) * * @endcode * diff --git a/include/deal.II/base/path_search.h b/include/deal.II/base/path_search.h index b1d89298af..c0451162cd 100644 --- a/include/deal.II/base/path_search.h +++ b/include/deal.II/base/path_search.h @@ -197,7 +197,7 @@ private: /** * Type of values in the class maps. */ - typedef std::map>::value_type map_type; + using map_type = std::map>::value_type; /** * Initialize the static list objects for further use. diff --git a/include/deal.II/base/patterns.h b/include/deal.II/base/patterns.h index 4346f16eff..a0fc097039 100644 --- a/include/deal.II/base/patterns.h +++ b/include/deal.II/base/patterns.h @@ -732,7 +732,7 @@ namespace Patterns * or, if you want to exploit ParameterHandler::add_parameter(): * * @code - * typedef std::tuple, unsigned int> T; + * using T = std::tuple, unsigned int>; * * T a = Patterns::Tools::Convert::to_value("Ciao : 1.0, 2.0, 3.0 : 33"); * @@ -1203,7 +1203,7 @@ namespace Patterns * A typical usage of these tools is in the following example: * * @code - * typedef std::vector T; + * using T = std::vector; * * T vec(3); * vec[0] = 1; @@ -1884,7 +1884,7 @@ namespace Patterns template struct Convert> { - typedef Tensor T; + using T = Tensor; static std::unique_ptr to_pattern() { @@ -1951,7 +1951,7 @@ namespace Patterns template struct Convert> { - typedef Point T; + using T = Point; static std::unique_ptr to_pattern() @@ -1981,7 +1981,7 @@ namespace Patterns template struct Convert> { - typedef std::complex T; + using T = std::complex; static std::unique_ptr to_pattern() @@ -2045,7 +2045,7 @@ namespace Patterns template <> struct Convert { - typedef std::string T; + using T = std::string; static std::unique_ptr to_pattern() @@ -2076,7 +2076,7 @@ namespace Patterns template struct Convert> { - typedef std::pair T; + using T = std::pair; static std::unique_ptr to_pattern() @@ -2121,7 +2121,7 @@ namespace Patterns template struct Convert> { - typedef std::tuple T; + using T = std::tuple; static std::unique_ptr to_pattern() diff --git a/include/deal.II/base/qprojector.h b/include/deal.II/base/qprojector.h index a13ba572cc..d767b4faa6 100644 --- a/include/deal.II/base/qprojector.h +++ b/include/deal.II/base/qprojector.h @@ -77,10 +77,10 @@ class QProjector { public: /** - * Define a typedef for a quadrature that acts on an object of one dimension + * Define an alias for a quadrature that acts on an object of one dimension * less. For cells, this would then be a face quadrature. */ - typedef Quadrature SubQuadrature; + using SubQuadrature = Quadrature; /** * Compute the quadrature points on the cell if the given quadrature formula diff --git a/include/deal.II/base/quadrature.h b/include/deal.II/base/quadrature.h index 56d08aa484..25a919674f 100644 --- a/include/deal.II/base/quadrature.h +++ b/include/deal.II/base/quadrature.h @@ -86,10 +86,10 @@ class Quadrature : public Subscriptor { public: /** - * Define a typedef for a quadrature that acts on an object of one dimension + * Define an alias for a quadrature that acts on an object of one dimension * less. For cells, this would then be a face quadrature. */ - typedef Quadrature SubQuadrature; + using SubQuadrature = Quadrature; /** * Constructor. diff --git a/include/deal.II/base/quadrature_point_data.h b/include/deal.II/base/quadrature_point_data.h index 1c1c3cfdda..2f1a2e2c16 100644 --- a/include/deal.II/base/quadrature_point_data.h +++ b/include/deal.II/base/quadrature_point_data.h @@ -351,10 +351,10 @@ namespace parallel "User's DataType class should be derived from TransferableQuadraturePointData"); /** - * A typedef for a cell. + * An alias for a cell. */ - typedef typename parallel::distributed::Triangulation::cell_iterator - CellIteratorType; + using CellIteratorType = + typename parallel::distributed::Triangulation::cell_iterator; /** * Constructor which takes the FiniteElement @p projection_fe , the quadrature diff --git a/include/deal.II/base/subscriptor.h b/include/deal.II/base/subscriptor.h index d0fc3640f0..4a14c9ec4d 100644 --- a/include/deal.II/base/subscriptor.h +++ b/include/deal.II/base/subscriptor.h @@ -187,12 +187,12 @@ private: /** * The data type used in #counter_map. */ - typedef std::map::value_type map_value_type; + using map_value_type = std::map::value_type; /** * The iterator type used in #counter_map. */ - typedef std::map::iterator map_iterator; + using map_iterator = std::map::iterator; /** * Store the number of objects which subscribed to this object. Initially, diff --git a/include/deal.II/base/symmetric_tensor.h b/include/deal.II/base/symmetric_tensor.h index acf4714ed7..df45f4d3c4 100644 --- a/include/deal.II/base/symmetric_tensor.h +++ b/include/deal.II/base/symmetric_tensor.h @@ -164,9 +164,9 @@ namespace internal typename OtherNumber = Number> struct double_contraction_result { - typedef typename ProductType::type value_type; - typedef ::dealii::SymmetricTensor - type; + using value_type = typename ProductType::type; + using type = + ::dealii::SymmetricTensor; }; @@ -181,13 +181,13 @@ namespace internal template struct double_contraction_result<2, 2, dim, Number, OtherNumber> { - typedef typename ProductType::type type; + using type = typename ProductType::type; }; /** - * Declaration of typedefs for the type of data structures which are used + * Declaration of alias for the type of data structures which are used * to store symmetric tensors. For example, for rank-2 symmetric tensors, * we use a flat vector to store all the elements. On the other hand, * symmetric rank-4 tensors are mappings from symmetric rank-2 tensors @@ -217,7 +217,7 @@ namespace internal /** * Declare the type in which we actually store the data. */ - typedef Tensor<1, n_independent_components, Number> base_tensor_type; + using base_tensor_type = Tensor<1, n_independent_components, Number>; }; @@ -248,7 +248,7 @@ namespace internal * can represent the data as a matrix if we represent the rank-2 tensors * as vectors. */ - typedef Tensor<2, n_rank2_components, Number> base_tensor_type; + using base_tensor_type = Tensor<2, n_rank2_components, Number>; }; @@ -269,9 +269,9 @@ namespace internal template struct AccessorTypes { - typedef const ::dealii::SymmetricTensor tensor_type; + using tensor_type = const ::dealii::SymmetricTensor; - typedef Number reference; + using reference = Number; }; /** @@ -283,9 +283,9 @@ namespace internal template struct AccessorTypes { - typedef ::dealii::SymmetricTensor tensor_type; + using tensor_type = ::dealii::SymmetricTensor; - typedef Number &reference; + using reference = Number &; }; @@ -328,12 +328,12 @@ namespace internal { public: /** - * Import two typedefs from the switch class above. + * Import two alias from the switch class above. */ - typedef typename AccessorTypes::reference - reference; - typedef typename AccessorTypes::tensor_type - tensor_type; + using reference = + typename AccessorTypes::reference; + using tensor_type = + typename AccessorTypes::tensor_type; private: /** @@ -411,12 +411,12 @@ namespace internal { public: /** - * Import two typedefs from the switch class above. + * Import two alias from the switch class above. */ - typedef typename AccessorTypes::reference - reference; - typedef typename AccessorTypes::tensor_type - tensor_type; + using reference = + typename AccessorTypes::reference; + using tensor_type = + typename AccessorTypes::tensor_type; private: /** @@ -883,13 +883,13 @@ private: /** * A structure that describes properties of the base tensor. */ - typedef internal::SymmetricTensorAccessors::StorageType - base_tensor_descriptor; + using base_tensor_descriptor = + internal::SymmetricTensorAccessors::StorageType; /** * Data storage type for a symmetric tensor. */ - typedef typename base_tensor_descriptor::base_tensor_type base_tensor_type; + using base_tensor_type = typename base_tensor_descriptor::base_tensor_type; /** * The place where we store the data of the tensor. @@ -1575,9 +1575,8 @@ namespace internal const typename SymmetricTensorAccessors:: StorageType<2, dim, OtherNumber>::base_tensor_type &sdata) { - typedef typename SymmetricTensorAccessors:: - double_contraction_result<2, 2, dim, Number, OtherNumber>::type - result_type; + using result_type = typename SymmetricTensorAccessors:: + double_contraction_result<2, 2, dim, Number, OtherNumber>::type; switch (dim) { @@ -1610,12 +1609,10 @@ namespace internal const typename SymmetricTensorAccessors:: StorageType<2, dim, OtherNumber>::base_tensor_type &sdata) { - typedef typename SymmetricTensorAccessors:: - double_contraction_result<4, 2, dim, Number, OtherNumber>::type - result_type; - typedef typename SymmetricTensorAccessors:: - double_contraction_result<4, 2, dim, Number, OtherNumber>::value_type - value_type; + using result_type = typename SymmetricTensorAccessors:: + double_contraction_result<4, 2, dim, Number, OtherNumber>::type; + using value_type = typename SymmetricTensorAccessors:: + double_contraction_result<4, 2, dim, Number, OtherNumber>::value_type; const unsigned int data_dim = SymmetricTensorAccessors:: StorageType<2, dim, value_type>::n_independent_components; @@ -1641,11 +1638,10 @@ namespace internal const typename SymmetricTensorAccessors:: StorageType<4, dim, OtherNumber>::base_tensor_type &sdata) { - typedef typename SymmetricTensorAccessors:: - double_contraction_result<2, 4, dim, Number, OtherNumber>::value_type - value_type; - typedef typename SymmetricTensorAccessors::StorageType<2, dim, value_type>:: - base_tensor_type base_tensor_type; + using value_type = typename SymmetricTensorAccessors:: + double_contraction_result<2, 4, dim, Number, OtherNumber>::value_type; + using base_tensor_type = typename SymmetricTensorAccessors:: + StorageType<2, dim, value_type>::base_tensor_type; base_tensor_type tmp; for (unsigned int i = 0; i < tmp.dimension; ++i) @@ -1679,11 +1675,10 @@ namespace internal const typename SymmetricTensorAccessors:: StorageType<4, dim, OtherNumber>::base_tensor_type &sdata) { - typedef typename SymmetricTensorAccessors:: - double_contraction_result<4, 4, dim, Number, OtherNumber>::value_type - value_type; - typedef typename SymmetricTensorAccessors::StorageType<4, dim, value_type>:: - base_tensor_type base_tensor_type; + using value_type = typename SymmetricTensorAccessors:: + double_contraction_result<4, 4, dim, Number, OtherNumber>::value_type; + using base_tensor_type = typename SymmetricTensorAccessors:: + StorageType<4, dim, value_type>::base_tensor_type; const unsigned int data_dim = SymmetricTensorAccessors:: StorageType<2, dim, value_type>::n_independent_components; @@ -3091,7 +3086,7 @@ namespace internal template struct SortEigenValuesVectors { - typedef std::pair> EigValsVecs; + using EigValsVecs = std::pair>; bool operator()(const EigValsVecs &lhs, const EigValsVecs &rhs) { @@ -3605,8 +3600,8 @@ operator*(const SymmetricTensor &t, // standard committee saw it fit to not define an // operator*(float,std::complex) // (as well as with switched arguments and double<->float). - typedef typename ProductType::type product_type; - SymmetricTensor tt(t); + using product_type = typename ProductType::type; + SymmetricTensor tt(t); // we used to shorten the following by 'tt *= product_type(factor);' // which requires that a converting constructor // 'product_type::product_type(const OtherNumber) is defined. diff --git a/include/deal.II/base/symmetric_tensor.templates.h b/include/deal.II/base/symmetric_tensor.templates.h index a714d2ead5..0ae1530fe5 100644 --- a/include/deal.II/base/symmetric_tensor.templates.h +++ b/include/deal.II/base/symmetric_tensor.templates.h @@ -98,7 +98,7 @@ eigenvalues(const SymmetricTensor<2, 3, Number> &T) // and p = (tr((T - q.I)^{2})/6)^{1/2} . Then solve the equation // 0 = det(\lambda*I - B) = \lambda^{3} - 3*\lambda - det(B) // which has the solution - // \lambda = 2*cos(1/3 * acos(det(B)/2) +2/3*pi*k ) ; k = 0,1,2 + // \lambda = 2*cos(1/3 * acos(det(B)/2) +2/3*pi*k ); k = 0,1,2 // when substituting \lambda = 2.cos(theta) and using trig identities. const Number tr_T = trace(T); const Number q = tr_T / 3.0; @@ -918,9 +918,8 @@ eigenvectors(const SymmetricTensor<2, dim, Number> &T, AssertThrow(false, ExcNotImplemented()); } - typedef - typename Differentiation::AD::ADNumberTraits::scalar_type - scalar_type; + using scalar_type = + typename Differentiation::AD::ADNumberTraits::scalar_type; const double delta = sf * std::numeric_limits::epsilon(); const double rotation_angle = delta * numbers::PI / 180.0; diff --git a/include/deal.II/base/table.h b/include/deal.II/base/table.h index b614862d24..8e07b8eb27 100644 --- a/include/deal.II/base/table.h +++ b/include/deal.II/base/table.h @@ -73,7 +73,7 @@ namespace internal namespace TableBaseAccessors { /** - * @internal Have a class which declares some nested typedefs, depending + * @internal Have a class which declares some nested alias, depending * on its template parameters. The general template declares nothing, but * there are more useful specializations regarding the last parameter * indicating constness of the table for which accessor objects are to be @@ -84,39 +84,39 @@ namespace internal {}; /** - * @internal Have a class which declares some nested typedefs, depending + * @internal Have a class which declares some nested alias, depending * on its template parameters. Specialization for accessors to constant * objects. */ template struct Types { - typedef const T value_type; - typedef const TableBase TableType; + using value_type = const T; + using TableType = const TableBase; - typedef typename AlignedVector::const_iterator iterator; - typedef typename AlignedVector::const_iterator const_iterator; + using iterator = typename AlignedVector::const_iterator; + using const_iterator = typename AlignedVector::const_iterator; - typedef typename AlignedVector::const_reference reference; - typedef typename AlignedVector::const_reference const_reference; + using reference = typename AlignedVector::const_reference; + using const_reference = typename AlignedVector::const_reference; }; /** - * @internal Have a class which declares some nested typedefs, depending + * @internal Have a class which declares some nested alias, depending * on its template parameters. Specialization for accessors to non- * constant objects. */ template struct Types { - typedef T value_type; - typedef TableBase TableType; + using value_type = T; + using TableType = TableBase; - typedef typename AlignedVector::iterator iterator; - typedef typename AlignedVector::const_iterator const_iterator; + using iterator = typename AlignedVector::iterator; + using const_iterator = typename AlignedVector::const_iterator; - typedef typename AlignedVector::reference reference; - typedef typename AlignedVector::const_reference const_reference; + using reference = typename AlignedVector::reference; + using const_reference = typename AlignedVector::const_reference; }; @@ -162,13 +162,13 @@ namespace internal class Accessor { public: - typedef typename Types::TableType TableType; + using TableType = typename Types::TableType; - typedef typename Types::iterator iterator; - typedef typename Types::const_iterator const_iterator; + using iterator = typename Types::iterator; + using const_iterator = typename Types::const_iterator; - typedef size_t size_type; - typedef ptrdiff_t difference_type; + using size_type = size_t; + using difference_type = ptrdiff_t; private: /** @@ -253,21 +253,21 @@ namespace internal * this row, as well as all the other types usually required for the * standard library algorithms. */ - typedef typename Types::value_type value_type; + using value_type = typename Types::value_type; - typedef typename Types::iterator iterator; - typedef typename Types::const_iterator const_iterator; + using iterator = typename Types::iterator; + using const_iterator = typename Types::const_iterator; - typedef typename Types::reference reference; - typedef typename Types::const_reference const_reference; + using reference = typename Types::reference; + using const_reference = typename Types::const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; + using size_type = size_t; + using difference_type = ptrdiff_t; /** - * Import a typedef from the switch class above. + * Import an alias from the switch class above. */ - typedef typename Types::TableType TableType; + using TableType = typename Types::TableType; private: /** @@ -421,12 +421,12 @@ template class TableBase : public Subscriptor { public: - typedef T value_type; + using value_type = T; /** * Integer type used to count the number of elements in this container. */ - typedef typename AlignedVector::size_type size_type; + using size_type = typename AlignedVector::size_type; /** @@ -730,7 +730,7 @@ public: /** * Integer type used to count the number of elements in this container. */ - typedef typename TableBase<1, T>::size_type size_type; + using size_type = typename TableBase<1, T>::size_type; /** * Default constructor. Set all dimensions to zero. @@ -848,7 +848,7 @@ public: /** * Integer type used to count the number of elements in this container. */ - typedef typename TableBase<2, T>::size_type size_type; + using size_type = typename TableBase<2, T>::size_type; /** * Default constructor. Set all dimensions to zero. @@ -1033,7 +1033,7 @@ public: /** * Integer type used to count the number of elements in this container. */ - typedef typename TableBase<3, T>::size_type size_type; + using size_type = typename TableBase<3, T>::size_type; /** * Default constructor. Set all dimensions to zero. @@ -1165,7 +1165,7 @@ public: /** * Integer type used to count the number of elements in this container. */ - typedef typename TableBase<4, T>::size_type size_type; + using size_type = typename TableBase<4, T>::size_type; /** * Default constructor. Set all dimensions to zero. @@ -1259,7 +1259,7 @@ public: /** * Integer type used to count the number of elements in this container. */ - typedef typename TableBase<5, T>::size_type size_type; + using size_type = typename TableBase<5, T>::size_type; /** @@ -1356,7 +1356,7 @@ public: /** * Integer type used to count the number of elements in this container. */ - typedef typename TableBase<6, T>::size_type size_type; + using size_type = typename TableBase<6, T>::size_type; /** * Default constructor. Set all dimensions to zero. @@ -1454,7 +1454,7 @@ public: /** * Integer type used to count the number of elements in this container. */ - typedef typename TableBase<7, T>::size_type size_type; + using size_type = typename TableBase<7, T>::size_type; /** * Default constructor. Set all dimensions to zero. @@ -1567,10 +1567,10 @@ namespace TransposeTableIterators /** * Type of the stored pointer to the TransposeTable. */ - typedef typename std::conditional *, - TransposeTable *>::type - container_pointer_type; + using container_pointer_type = + typename std::conditional *, + TransposeTable *>::type; /** * Default constructor. @@ -1604,7 +1604,7 @@ namespace TransposeTableIterators /** * Numerical type of the row and column indices of the TransposeTable. */ - typedef typename TransposeTable::size_type size_type; + using size_type = typename TransposeTable::size_type; /** * Access the row of the current entry. @@ -1706,15 +1706,15 @@ namespace TransposeTableIterators /** * Size type used by TransposeTable. */ - typedef typename TransposeTable::size_type size_type; + using size_type = typename TransposeTable::size_type; /** * Type of the stored pointer to the TransposeTable. */ - typedef typename std::conditional *, - TransposeTable *>::type - container_pointer_type; + using container_pointer_type = + typename std::conditional *, + TransposeTable *>::type; /** * Constructor from an accessor. @@ -1767,33 +1767,33 @@ public: /** * Integer type used to count the number of elements in this container. */ - typedef typename TableBase<2, T>::size_type size_type; + using size_type = typename TableBase<2, T>::size_type; /** * Typedef for the values in the table. */ - typedef typename AlignedVector::value_type value_type; + using value_type = typename AlignedVector::value_type; /** * Typedef for the references in the table. */ - typedef typename AlignedVector::reference reference; + using reference = typename AlignedVector::reference; /** * Typedef for the constant references in the table. */ - typedef typename AlignedVector::const_reference const_reference; + using const_reference = typename AlignedVector::const_reference; /** * Typedef for a constant iterator that traverses the table in column-major * order. */ - typedef TransposeTableIterators::Iterator const_iterator; + using const_iterator = TransposeTableIterators::Iterator; /** * Typedef for an iterator that traverses the table in column-major order. */ - typedef TransposeTableIterators::Iterator iterator; + using iterator = TransposeTableIterators::Iterator; /** * Default constructor. Set all dimensions to zero. diff --git a/include/deal.II/base/table_handler.h b/include/deal.II/base/table_handler.h index 7a9170c180..2b59adef94 100644 --- a/include/deal.II/base/table_handler.h +++ b/include/deal.II/base/table_handler.h @@ -130,9 +130,8 @@ namespace internal /** * Abbreviation for the data type stored by this object. */ - typedef boost:: - variant - value_type; + using value_type = boost:: + variant; /** * Stored value. diff --git a/include/deal.II/base/template_constraints.h b/include/deal.II/base/template_constraints.h index 8f52da6edf..bf2d314c90 100644 --- a/include/deal.II/base/template_constraints.h +++ b/include/deal.II/base/template_constraints.h @@ -97,7 +97,7 @@ struct constraint_and_return_value; /** * This specialization of the general template for the case of a true - * first template argument declares a local typedef type to the + * first template argument declares a local alias type to the * second template argument. It is used in order to construct constraints on * template arguments in template (and member template) functions. The * negative specialization is missing. @@ -124,7 +124,7 @@ struct constraint_and_return_value; * @code * template struct constraint_and_return_value; * template struct constraint_and_return_value { - * typedef T type; + * using type = T; * }; * @endcode * constraint_and_return_value is not defined. Given something like @@ -155,14 +155,14 @@ struct constraint_and_return_value; template struct DEAL_II_DEPRECATED constraint_and_return_value { - typedef T type; + using type = T; }; /** * A template class that simply exports its template argument as a local - * typedef. This class, while at first appearing useless, makes sense in the + * alias. This class, while at first appearing useless, makes sense in the * following context: if you have a function template as follows: * @code * template void f(T, T); @@ -214,7 +214,7 @@ struct DEAL_II_DEPRECATED constraint_and_return_value template struct identity { - typedef T type; + using type = T; }; @@ -390,7 +390,7 @@ namespace internal template struct ProductTypeImpl { - typedef decltype(std::declval() * std::declval()) type; + using type = decltype(std::declval() * std::declval()); }; } // namespace internal @@ -398,7 +398,7 @@ namespace internal /** - * A class with a local typedef that represents the type that results from the + * A class with a local alias that represents the type that results from the * product of two variables of type @p T and @p U. In other words, we would * like to infer the type of the product variable in code like * this: @@ -407,7 +407,7 @@ namespace internal * U u; * auto product = t*u; * @endcode - * The local typedef of this structure represents the type the variable + * The local alias of this structure represents the type the variable * product would have. * * @@ -448,9 +448,9 @@ namespace internal template struct ProductType { - typedef + using type = typename internal::ProductTypeImpl::type, - typename std::decay::type>::type type; + typename std::decay::type>::type; }; namespace internal @@ -463,37 +463,37 @@ namespace internal template struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; template struct ProductTypeImpl, std::complex> { - typedef std::complex::type> type; + using type = std::complex::type>; }; template struct ProductTypeImpl> { - typedef std::complex::type> type; + using type = std::complex::type>; }; template struct ProductTypeImpl, double> { - typedef std::complex::type> type; + using type = std::complex::type>; }; template struct ProductTypeImpl> { - typedef std::complex::type> type; + using type = std::complex::type>; }; template struct ProductTypeImpl, float> { - typedef std::complex::type> type; + using type = std::complex::type>; }; } // namespace internal @@ -501,12 +501,12 @@ namespace internal /** - * This class provides a local typedef @p type that is equal to the template + * This class provides a local alias @p type that is equal to the template * argument but only if the template argument corresponds to a scalar type * (i.e., one of the floating point types, signed or unsigned integer, or a * complex number). If the template type @p T is not a scalar, then no class * EnableIfScalar@ is declared and, consequently, no local - * typedef is available. + * alias is available. * * The purpose of the class is to disable certain template functions if one of * the arguments is not a scalar number. By way of (nonsensical) example, @@ -558,37 +558,37 @@ struct EnableIfScalar; template <> struct EnableIfScalar { - typedef double type; + using type = double; }; template <> struct EnableIfScalar { - typedef float type; + using type = float; }; template <> struct EnableIfScalar { - typedef long double type; + using type = long double; }; template <> struct EnableIfScalar { - typedef int type; + using type = int; }; template <> struct EnableIfScalar { - typedef unsigned int type; + using type = unsigned int; }; template struct EnableIfScalar> { - typedef std::complex type; + using type = std::complex; }; diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index cd9eb8a02f..1b3b06a06e 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -120,22 +120,22 @@ public: * corresponds to type number, and it is equal to Number for all other * cases. See also the respective field in Vector. * - * This typedef is used to represent the return type of norms. + * This alias is used to represent the return type of norms. */ - typedef typename numbers::NumberTraits::real_type real_type; + using real_type = typename numbers::NumberTraits::real_type; /** * Type of objects encapsulated by this container and returned by * operator[](). This is a scalar number type for a rank 0 tensor. */ - typedef Number value_type; + using value_type = Number; /** * Declare an array type which can be used to initialize an object of this * type statically. In case of a tensor of rank 0 this is just the scalar * number type Number. */ - typedef Number array_type; + using array_type = Number; /** * Constructor. Set to zero. @@ -327,7 +327,7 @@ public: * Internal type declaration that is used to specialize the return type of * operator[]() for Tensor<1,dim,Number> */ - typedef Number tensor_type; + using tensor_type = Number; private: /** @@ -424,16 +424,14 @@ public: * operator[](). This is a tensor of lower rank for a general tensor, and a * scalar number type for Tensor<1,dim,Number>. */ - typedef typename Tensor::tensor_type value_type; + using value_type = typename Tensor::tensor_type; /** * Declare an array type which can be used to initialize an object of this - * type statically. + * type statically. For `dim == 0`, its size is 1. Otherwise, it is `dim`. */ - typedef typename Tensor::array_type - array_type[(dim != 0) ? dim : 1]; - // ... avoid a compiler warning in case of dim == 0 and ensure that the - // array always has positive size. + using array_type = + typename Tensor::array_type[(dim != 0) ? dim : 1]; /** * Constructor. Initialize all entries to zero. @@ -664,7 +662,7 @@ public: * Internal type declaration that is used to specialize the return type of * operator[]() for Tensor<1,dim,Number> */ - typedef Tensor tensor_type; + using tensor_type = Tensor; private: /** @@ -1962,8 +1960,8 @@ contract3(const TensorT1 & left, const TensorT2 &middle, const TensorT3 & right) { - typedef typename ProductType::type>::type - return_type; + using return_type = + typename ProductType::type>::type; return TensorAccessors::contract3(left, middle, right); diff --git a/include/deal.II/base/tensor_accessors.h b/include/deal.II/base/tensor_accessors.h index e07cc04c83..f8efb0e1f2 100644 --- a/include/deal.II/base/tensor_accessors.h +++ b/include/deal.II/base/tensor_accessors.h @@ -49,14 +49,14 @@ DEAL_II_NAMESPACE_OPEN * The methods and algorithms implemented in this namespace, however, are * fully generic. More precisely, it can operate on nested c-style arrays, or * on class types T with a minimal interface that provides a - * local typedef value_type and an index operator + * local alias value_type and an index operator * operator[](unsigned int) that returns a (const or non-const) * reference of value_type: * @code * template <...> * class T * { - * typedef ... value_type; + * using value_type = ...; * value_type & operator[](unsigned int); * const value_type & operator[](unsigned int) const; * }; @@ -86,16 +86,16 @@ namespace TensorAccessors /** - * This class provides a local typedef @p value_type denoting the resulting + * This class provides a local alias @p value_type denoting the resulting * type of an access with operator[](unsigned int). More precisely, @p * value_type will be - * - T::value_type if T is a tensorial class providing a - * typedef value_type and does not have a const qualifier. + * - T::value_type if T is a tensorial class providing an + * alias value_type and does not have a const qualifier. * - const T::value_type if T is a tensorial class - * providing a typedef value_type and does have a const + * providing an alias value_type and does have a const * qualifier. * - const T::value_type if T is a tensorial class - * providing a typedef value_type and does have a const + * providing an alias value_type and does have a const * qualifier. * - A if T is of array type A[...] * - const A if T is of array type A[...] and @@ -104,31 +104,31 @@ namespace TensorAccessors template struct ValueType { - typedef typename T::value_type value_type; + using value_type = typename T::value_type; }; template struct ValueType { - typedef const typename T::value_type value_type; + using value_type = const typename T::value_type; }; template struct ValueType { - typedef T value_type; + using value_type = T; }; template struct ValueType { - typedef const T value_type; + using value_type = const T; }; /** - * This class provides a local typedef @p value_type that is equal to the - * typedef value_type after @p deref_steps recursive + * This class provides a local alias @p value_type that is equal to the + * alias value_type after @p deref_steps recursive * dereferences via ```operator[](unsigned int)```. Further, constness is * preserved via the ValueType type trait, i.e., if T is const, * ReturnType::value_type will also be const. @@ -136,15 +136,15 @@ namespace TensorAccessors template struct ReturnType { - typedef typename ReturnType::value_type>::value_type - value_type; + using value_type = + typename ReturnType::value_type>::value_type; }; template struct ReturnType<0, T> { - typedef T value_type; + using value_type = T; }; @@ -174,14 +174,14 @@ namespace TensorAccessors * tensors. * * @note This function returns an internal class object consisting of an - * array subscript operator operator[](unsigned int) and a - * typedef value_type describing its return value. + * array subscript operator operator[](unsigned int) and an + * alias value_type describing its return value. * * @tparam index The index to be shifted to the end. Indices are counted * from 0, thus the valid range is $0\le\text{index}<\text{rank}$. * @tparam rank Rank of the tensorial object @p t * @tparam T A tensorial object of rank @p rank. @p T must provide a local - * typedef value_type and an index operator + * alias value_type and an index operator * operator[]() that returns a (const or non-const) reference * of value_type. * @@ -209,7 +209,7 @@ namespace TensorAccessors * This is equivalent to tensor[0][1][2][3][4] = 42.. * * @tparam T A tensorial object of rank @p rank. @p T must provide a local - * typedef value_type and an index operator + * alias value_type and an index operator * operator[]() that returns a (const or non-const) reference * of value_type. Further, its tensorial rank must be equal or * greater than @p rank. @@ -361,19 +361,19 @@ namespace TensorAccessors template struct ReferenceType { - typedef T &type; + using type = T &; }; template struct ReferenceType> { - typedef StoreIndex type; + using type = StoreIndex; }; template struct ReferenceType> { - typedef ReorderedIndexView type; + using type = ReorderedIndexView; }; @@ -413,10 +413,9 @@ namespace TensorAccessors : t_(t) {} - typedef ReorderedIndexView::value_type> - value_type; + using value_type = ReorderedIndexView::value_type>; // Recurse by applying index j directly: inline DEAL_II_ALWAYS_INLINE value_type operator[](unsigned int j) const @@ -447,7 +446,7 @@ namespace TensorAccessors : t_(t) {} - typedef StoreIndex> value_type; + using value_type = StoreIndex>; inline DEAL_II_ALWAYS_INLINE value_type operator[](unsigned int j) const { @@ -469,8 +468,8 @@ namespace TensorAccessors : t_(t) {} - typedef typename ReferenceType::value_type>::type - value_type; + using value_type = + typename ReferenceType::value_type>::type; inline DEAL_II_ALWAYS_INLINE value_type operator[](unsigned int j) const { @@ -494,7 +493,7 @@ namespace TensorAccessors : t_(t) {} - typedef typename ValueType::value_type return_type; + using return_type = typename ValueType::value_type; inline DEAL_II_ALWAYS_INLINE typename ReferenceType::type apply(unsigned int j) const @@ -523,15 +522,15 @@ namespace TensorAccessors , i_(i) {} - typedef StoreIndex> value_type; + using value_type = StoreIndex>; inline DEAL_II_ALWAYS_INLINE value_type operator[](unsigned int j) const { return value_type(*this, j); } - typedef - typename ValueType::value_type return_type; + using return_type = + typename ValueType::value_type; inline typename ReferenceType::type apply(unsigned int j) const @@ -557,9 +556,9 @@ namespace TensorAccessors , i_(i) {} - typedef - typename ValueType::value_type return_type; - typedef return_type value_type; + using return_type = + typename ValueType::value_type; + using value_type = return_type; inline DEAL_II_ALWAYS_INLINE return_type &operator[](unsigned int j) const { diff --git a/include/deal.II/base/tensor_function.h b/include/deal.II/base/tensor_function.h index 9133f4b3fa..8b80dae6ca 100644 --- a/include/deal.II/base/tensor_function.h +++ b/include/deal.II/base/tensor_function.h @@ -58,11 +58,11 @@ class TensorFunction : public FunctionTime, public Subscriptor { public: /** - * Define typedefs for the return types of the value functions. + * Define alias for the return types of the value functions. */ - typedef Tensor value_type; + using value_type = Tensor; - typedef Tensor gradient_type; + using gradient_type = Tensor; /** * Constructor. May take an initial value for the time variable, which diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index 7b4171499f..21cb8cd747 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -474,7 +474,7 @@ namespace Threads * If using POSIX functions, then alias the POSIX wrapper classes to the * names we use throughout the library. */ - typedef PosixThreadBarrier Barrier; + using Barrier = PosixThreadBarrier; # else /** @@ -482,21 +482,21 @@ namespace Threads * aliased to dummy classes that actually do nothing, in particular not lock * objects. Likewise for the barrier class. */ - typedef DummyThreadMutex Mutex; + using Mutex = DummyThreadMutex; /** * In non-multithread mode, the mutex and thread management classes are * aliased to dummy classes that actually do nothing, in particular not lock * objects. Likewise for the barrier class. */ - typedef DummyThreadCondition ConditionVariable; + using ConditionVariable = DummyThreadCondition; /** * In non-multithread mode, the mutex and thread management classes are * aliased to dummy classes that actually do nothing, in particular not lock * objects. Likewise for the barrier class. */ - typedef DummyBarrier Barrier; + using Barrier = DummyBarrier; # endif } // namespace Threads @@ -661,7 +661,7 @@ namespace Threads const ForwardIterator &end, const unsigned int n_intervals) { - typedef std::pair IteratorPair; + using IteratorPair = std::pair; // in non-multithreaded mode, we often have the case that this // function is called with n_intervals==1, so have a shortcut here @@ -724,7 +724,7 @@ namespace Threads RT value; public: - typedef RT &reference_type; + using reference_type = RT &; inline return_value() : value() @@ -760,7 +760,7 @@ namespace Threads RT *value; public: - typedef RT &reference_type; + using reference_type = RT &; inline return_value() : value(nullptr) @@ -791,7 +791,7 @@ namespace Threads template <> struct return_value { - typedef void reference_type; + using reference_type = void; static inline void get() @@ -1280,7 +1280,7 @@ namespace Threads new_thread(FunctionObjectType function_object) -> Thread { - typedef decltype(function_object()) return_type; + using return_type = decltype(function_object()); return Thread(std::function(function_object)); } @@ -1953,7 +1953,7 @@ namespace Threads new_task(FunctionObjectType function_object) -> Task { - typedef decltype(function_object()) return_type; + using return_type = decltype(function_object()); dealii::MultithreadInfo::initialize_multithreading(); return Task(std::function(function_object)); } diff --git a/include/deal.II/base/timer.h b/include/deal.II/base/timer.h index 27e23900f1..7c9e17be94 100644 --- a/include/deal.II/base/timer.h +++ b/include/deal.II/base/timer.h @@ -42,22 +42,22 @@ struct CPUClock * 1/64th of a second and POSIX uses microseconds, so go with microseconds * for uniformity. */ - typedef std::chrono::microseconds duration; + using duration = std::chrono::microseconds; /** * Signed integral type used to store the value returned by count(). */ - typedef duration::rep rep; + using rep = duration::rep; /** * Ratio representing the length of a period (in seconds). */ - typedef duration::period period; + using period = duration::period; /** * Time point type. */ - typedef std::chrono::time_point time_point; + using time_point = std::chrono::time_point; /** * Boolean indicating that the clock monotonically increases. @@ -313,8 +313,8 @@ private: * * @tparam clock_type_ The type of the clock whose measurements are being * stored. This class should conform to the usual clock interface expected - * by std::chrono (i.e., the correct typedefs and - * a static now() method). + * by std::chrono (i.e., the correct alias and a static + * now() method). */ template struct ClockMeasurements @@ -322,17 +322,17 @@ private: /** * Store the clock type. */ - typedef clock_type_ clock_type; + using clock_type = clock_type_; /** * The time point type of the provided clock. */ - typedef typename clock_type::time_point time_point_type; + using time_point_type = typename clock_type::time_point; /** * The duration type of the provided clock. */ - typedef typename clock_type::duration duration_type; + using duration_type = typename clock_type::duration; /** * The time point corresponding to the start of the current lap. This is @@ -365,14 +365,14 @@ private: }; /** - * typedef for the wall clock. + * Alias for the wall clock. */ - typedef std::chrono::steady_clock wall_clock_type; + using wall_clock_type = std::chrono::steady_clock; /** - * typedef for the CPU clock. + * Alias for the CPU clock. */ - typedef CPUClock cpu_clock_type; + using cpu_clock_type = CPUClock; /** * Collection of wall time measurements. diff --git a/include/deal.II/base/types.h b/include/deal.II/base/types.h index 49ee6dc49d..f925945292 100644 --- a/include/deal.II/base/types.h +++ b/include/deal.II/base/types.h @@ -25,7 +25,7 @@ DEAL_II_NAMESPACE_OPEN /** - * A namespace in which we declare typedefs for types used in deal.II, as well + * A namespace in which we declare alias for types used in deal.II, as well * as special values for these types. */ namespace types @@ -40,12 +40,12 @@ namespace types * There is a special value, numbers::invalid_subdomain_id that is used to * indicate an invalid value of this type. */ - typedef unsigned int subdomain_id; + using subdomain_id = unsigned int; /** * The type used for global indices of vertices. */ - typedef unsigned long long int global_vertex_index; + using global_vertex_index = unsigned long long int; /** * An identifier that denotes the MPI type associated with @@ -69,7 +69,7 @@ namespace types */ // TODO: we should check that unsigned long long int // has the same size as uint64_t - typedef unsigned long long int global_dof_index; + using global_dof_index = unsigned long long int; /** * An identifier that denotes the MPI type associated with @@ -86,7 +86,7 @@ namespace types * * The data type always indicates an unsigned integer type. */ - typedef unsigned int global_dof_index; + using global_dof_index = unsigned int; /** * An identifier that denotes the MPI type associated with @@ -108,7 +108,7 @@ namespace types * @see * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ - typedef unsigned int boundary_id; + using boundary_id = unsigned int; /** * The type used to denote manifold indicators associated with every object @@ -120,7 +120,7 @@ namespace types * @see * @ref GlossManifoldIndicator "Glossary entry on manifold indicators" */ - typedef unsigned int manifold_id; + using manifold_id = unsigned int; /** * The type used to denote material indicators associated with every cell. @@ -131,13 +131,13 @@ namespace types * @see * @ref GlossMaterialId "Glossary entry on material indicators" */ - typedef unsigned int material_id; + using material_id = unsigned int; } // namespace types /** * Declare type used in Epetra. */ -typedef double TrilinosScalar; +using TrilinosScalar = double; namespace TrilinosWrappers @@ -148,12 +148,12 @@ namespace TrilinosWrappers /** * Declare type of integer used in the Epetra package of Trilinos. */ - typedef long long int_type; + using int_type = long long; #else /** * Declare type of integer used in the Epetra package of Trilinos. */ - typedef int int_type; + using int_type = int; #endif } // namespace types } // namespace TrilinosWrappers diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index eadadd8896..94aa7e9aa5 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -100,7 +100,7 @@ namespace internal template struct EnableIfScalar> { - typedef VectorizedArray::type> type; + using type = VectorizedArray::type>; }; diff --git a/include/deal.II/base/work_stream.h b/include/deal.II/base/work_stream.h index faa296e2ef..b09c2d1fdf 100644 --- a/include/deal.II/base/work_stream.h +++ b/include/deal.II/base/work_stream.h @@ -227,7 +227,7 @@ namespace WorkStream * Typedef to a list of scratch data objects. The rationale for this * list is provided in the variables that use these lists. */ - typedef std::list ScratchDataList; + using ScratchDataList = std::list; /** * A list of iterators that need to be worked on. Only the first @@ -490,10 +490,10 @@ namespace WorkStream operator()(void *item) override { // first unpack the current item - typedef + using ItemType = typename IteratorRangeToItemStream::ItemType ItemType; + CopyData>::ItemType; ItemType *current_item = static_cast(item); @@ -635,10 +635,10 @@ namespace WorkStream operator()(void *item) override { // first unpack the current item - typedef + using ItemType = typename IteratorRangeToItemStream::ItemType ItemType; + CopyData>::ItemType; ItemType *current_item = static_cast(item); @@ -854,15 +854,14 @@ namespace WorkStream } private: - typedef typename Implementation3:: - ScratchAndCopyDataObjects - ScratchAndCopyDataObjects; + using ScratchAndCopyDataObjects = typename Implementation3:: + ScratchAndCopyDataObjects; /** * Typedef to a list of scratch data objects. The rationale for this * list is provided in the variables that use these lists. */ - typedef std::list ScratchAndCopyDataList; + using ScratchAndCopyDataList = std::list; Threads::ThreadLocalStorage data; @@ -1145,11 +1144,10 @@ namespace WorkStream for (unsigned int color = 0; color < colored_iterators.size(); ++color) if (colored_iterators[color].size() > 0) { - typedef internal::Implementation3:: - WorkerAndCopier - WorkerAndCopier; + using WorkerAndCopier = internal::Implementation3:: + WorkerAndCopier; - typedef typename std::vector::const_iterator RangeType; + using RangeType = typename std::vector::const_iterator; WorkerAndCopier worker_and_copier(worker, copier, diff --git a/include/deal.II/differentiation/ad/ad_number_traits.h b/include/deal.II/differentiation/ad/ad_number_traits.h index 769bbc580a..a85529cc5a 100644 --- a/include/deal.II/differentiation/ad/ad_number_traits.h +++ b/include/deal.II/differentiation/ad/ad_number_traits.h @@ -97,9 +97,9 @@ namespace Differentiation * // State whether the auto-differentiable number uses taping or not. * static const bool is_taped; * // The real-type for the auto-differentiable number - * typedef real_type; + * using real_type = ; * // The type of number returned when taking the first derivative of the @p real_type. - * typedef derivative_type; + * using derivative_type = ; * // The number of derivative levels computable from the @p real_type. * static const unsigned int n_supported_derivative_levels; * @@ -513,7 +513,7 @@ namespace Differentiation template struct RemoveComplexWrapper { - typedef Number type; + using type = Number; }; @@ -525,7 +525,7 @@ namespace Differentiation template struct RemoveComplexWrapper> { - typedef typename RemoveComplexWrapper::type type; + using type = typename RemoveComplexWrapper::type; }; @@ -735,10 +735,10 @@ namespace Differentiation * internal::ADNumberInfoFromEnum is to be defined, from which we require * the following basic information determine all of the required information * and type traits for our helper classes: - * - A typedef called @p scalar_type, which defines the scalar or + * - An alias called @p scalar_type, which defines the scalar or * floating-point valued counterpart to the auto-differentiable number * type. This can be real or complex valued. - * - A typedef called @p derivative_type, which defines the + * - An alias called @p derivative_type, which defines the * number type for directional derivatives. * - A boolean called @p is_taped, which defines whether the auto-differentiable * number is a taped number or not. @@ -855,41 +855,40 @@ namespace Differentiation * Underlying floating point value type. * This could real-valued or complex-valued. */ - typedef ScalarType scalar_type; + using scalar_type = ScalarType; /** * Type for real numbers */ - typedef typename internal::ADNumberInfoFromEnum< + using real_type = typename internal::ADNumberInfoFromEnum< typename internal::RemoveComplexWrapper::type, - ADNumberTypeCode>::real_type real_type; + ADNumberTypeCode>::real_type; /** * Type for complex numbers */ - typedef std::complex complex_type; + using complex_type = std::complex; /** * The actual auto-differentiable number type */ - typedef - typename std::conditional::type - ad_type; + using ad_type = typename std:: + conditional::type; /** * The actual auto-differentiable number directional derivative type */ - typedef typename std::conditional< + using derivative_type = typename std::conditional< is_real_valued, typename internal::ADNumberInfoFromEnum< typename internal::RemoveComplexWrapper::type, ADNumberTypeCode>::derivative_type, std::complex::type, - ADNumberTypeCode>::derivative_type>>::type derivative_type; + ADNumberTypeCode>::derivative_type>>::type; /** @@ -1038,7 +1037,7 @@ namespace Differentiation * Underlying floating point value type. * This could real-valued or complex-valued. */ - typedef ScalarType scalar_type; + using scalar_type = ScalarType; static ScalarType get_directional_derivative(const ScalarType & /*x*/, diff --git a/include/deal.II/differentiation/ad/adolc_number_types.h b/include/deal.II/differentiation/ad/adolc_number_types.h index 8b9aa3f919..87e3169697 100644 --- a/include/deal.II/differentiation/ad/adolc_number_types.h +++ b/include/deal.II/differentiation/ad/adolc_number_types.h @@ -120,9 +120,9 @@ namespace Differentiation typename std::enable_if< std::is_floating_point::value>::type> { - static const bool is_taped = true; - typedef adouble real_type; - typedef double derivative_type; + static const bool is_taped = true; + using real_type = adouble; + using derivative_type = double; static const unsigned int n_supported_derivative_levels = std::numeric_limits::max(); }; @@ -139,9 +139,9 @@ namespace Differentiation typename std::enable_if< std::is_floating_point::value>::type> { - static const bool is_taped = false; - typedef adtl::adouble real_type; - typedef double derivative_type; + static const bool is_taped = false; + using real_type = adtl::adouble; + using derivative_type = double; static const unsigned int n_supported_derivative_levels = 1; }; @@ -153,7 +153,7 @@ namespace Differentiation ADNumberTraits::type_code == NumberTypes::adolc_taped && ADNumberTraits::is_real_valued>::type> { - typedef typename ADNumberTraits::scalar_type scalar_type; + using scalar_type = typename ADNumberTraits::scalar_type; /* * Initialize the state of an independent variable. @@ -191,7 +191,7 @@ namespace Differentiation NumberTypes::adolc_tapeless && ADNumberTraits::is_real_valued>::type> { - typedef typename ADNumberTraits::scalar_type scalar_type; + using scalar_type = typename ADNumberTraits::scalar_type; /* * Initialize the state of an independent variable. diff --git a/include/deal.II/differentiation/ad/adolc_product_types.h b/include/deal.II/differentiation/ad/adolc_product_types.h index c259f542ec..2c727f1ca2 100644 --- a/include/deal.II/differentiation/ad/adolc_product_types.h +++ b/include/deal.II/differentiation/ad/adolc_product_types.h @@ -36,7 +36,7 @@ namespace internal template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; // Typedefs for "adub"s are all that's necessary to ensure that no temporary @@ -46,13 +46,13 @@ namespace internal template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; /* --- Double --- */ @@ -60,25 +60,25 @@ namespace internal template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; /* --- Float --- */ @@ -86,25 +86,25 @@ namespace internal template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; template <> struct ProductTypeImpl { - typedef adouble type; + using type = adouble; }; /* --- Complex double --- */ @@ -112,31 +112,31 @@ namespace internal template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; /* --- Complex float --- */ @@ -144,13 +144,13 @@ namespace internal template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; } // namespace internal @@ -158,27 +158,27 @@ namespace internal template <> struct EnableIfScalar { - typedef adouble type; + using type = adouble; }; template <> struct EnableIfScalar> { - typedef std::complex type; + using type = std::complex; }; template <> struct EnableIfScalar { - typedef adouble type; + using type = adouble; }; template <> struct EnableIfScalar> { - typedef std::complex type; + using type = std::complex; }; @@ -192,19 +192,19 @@ namespace internal template <> struct ProductTypeImpl { - typedef adtl::adouble type; + using type = adtl::adouble; }; template <> struct ProductTypeImpl { - typedef adtl::adouble type; + using type = adtl::adouble; }; template <> struct ProductTypeImpl { - typedef adtl::adouble type; + using type = adtl::adouble; }; /* --- Float --- */ @@ -212,13 +212,13 @@ namespace internal template <> struct ProductTypeImpl { - typedef adtl::adouble type; + using type = adtl::adouble; }; template <> struct ProductTypeImpl { - typedef adtl::adouble type; + using type = adtl::adouble; }; /* --- Complex double --- */ @@ -226,20 +226,20 @@ namespace internal template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; /* --- Complex float --- */ @@ -247,13 +247,13 @@ namespace internal template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; template <> struct ProductTypeImpl, std::complex> { - typedef std::complex type; + using type = std::complex; }; } // namespace internal @@ -262,14 +262,14 @@ namespace internal template <> struct EnableIfScalar { - typedef adtl::adouble type; + using type = adtl::adouble; }; template <> struct EnableIfScalar> { - typedef std::complex type; + using type = std::complex; }; diff --git a/include/deal.II/differentiation/ad/sacado_number_types.h b/include/deal.II/differentiation/ad/sacado_number_types.h index efc52a18ce..5139fce830 100644 --- a/include/deal.II/differentiation/ad/sacado_number_types.h +++ b/include/deal.II/differentiation/ad/sacado_number_types.h @@ -160,10 +160,10 @@ namespace Differentiation SacadoNumber, Sacado::Fad::DFad>::value>::type> { - typedef SacadoNumber ad_type; - typedef typename ad_type::scalar_type scalar_type; - typedef typename ad_type::value_type value_type; - typedef typename ad_type::value_type derivative_type; + using ad_type = SacadoNumber; + using scalar_type = typename ad_type::scalar_type; + using value_type = typename ad_type::value_type; + using derivative_type = typename ad_type::value_type; static const unsigned int n_supported_derivative_levels = 1 + SacadoNumberInfo::n_supported_derivative_levels; @@ -180,10 +180,10 @@ namespace Differentiation SacadoNumber, Sacado::Rad::ADvar>::value>::type> { - typedef SacadoNumber ad_type; - typedef typename ad_type::ADVari::scalar_type scalar_type; - typedef typename ad_type::ADVari::value_type value_type; - typedef typename ad_type::ADVari::value_type derivative_type; + using ad_type = SacadoNumber; + using scalar_type = typename ad_type::ADVari::scalar_type; + using value_type = typename ad_type::ADVari::value_type; + using derivative_type = typename ad_type::ADVari::value_type; static const unsigned int n_supported_derivative_levels = 1 + SacadoNumberInfo::n_supported_derivative_levels; @@ -217,10 +217,10 @@ namespace Differentiation typename std::enable_if< std::is_floating_point::value>::type> { - static const bool is_taped = false; - typedef Sacado::Fad::DFad real_type; - typedef - typename SacadoNumberInfo::derivative_type derivative_type; + static const bool is_taped = false; + using real_type = Sacado::Fad::DFad; + using derivative_type = + typename SacadoNumberInfo::derivative_type; static const unsigned int n_supported_derivative_levels = SacadoNumberInfo::n_supported_derivative_levels; }; @@ -238,9 +238,9 @@ namespace Differentiation std::is_floating_point::value>::type> { static const bool is_taped = false; - typedef Sacado::Fad::DFad> real_type; - typedef - typename SacadoNumberInfo::derivative_type derivative_type; + using real_type = Sacado::Fad::DFad>; + using derivative_type = + typename SacadoNumberInfo::derivative_type; static const unsigned int n_supported_derivative_levels = SacadoNumberInfo::n_supported_derivative_levels; }; @@ -257,10 +257,10 @@ namespace Differentiation typename std::enable_if< std::is_floating_point::value>::type> { - static const bool is_taped = false; - typedef Sacado::Rad::ADvar real_type; - typedef - typename SacadoNumberInfo::derivative_type derivative_type; + static const bool is_taped = false; + using real_type = Sacado::Rad::ADvar; + using derivative_type = + typename SacadoNumberInfo::derivative_type; static const unsigned int n_supported_derivative_levels = SacadoNumberInfo::n_supported_derivative_levels; }; @@ -278,9 +278,9 @@ namespace Differentiation std::is_floating_point::value>::type> { static const bool is_taped = false; - typedef Sacado::Rad::ADvar> real_type; - typedef - typename SacadoNumberInfo::derivative_type derivative_type; + using real_type = Sacado::Rad::ADvar>; + using derivative_type = + typename SacadoNumberInfo::derivative_type; static const unsigned int n_supported_derivative_levels = SacadoNumberInfo::n_supported_derivative_levels; }; @@ -293,14 +293,12 @@ namespace Differentiation template struct Marking> { - typedef - typename SacadoNumberInfo>::ad_type - ad_type; - typedef typename SacadoNumberInfo< - Sacado::Fad::DFad>::derivative_type derivative_type; - typedef - typename SacadoNumberInfo>::scalar_type - scalar_type; + using ad_type = + typename SacadoNumberInfo>::ad_type; + using derivative_type = typename SacadoNumberInfo< + Sacado::Fad::DFad>::derivative_type; + using scalar_type = + typename SacadoNumberInfo>::scalar_type; /* * Initialize the state of an independent variable. @@ -338,14 +336,12 @@ namespace Differentiation template struct Marking> { - typedef - typename SacadoNumberInfo>::ad_type - ad_type; - typedef typename SacadoNumberInfo< - Sacado::Rad::ADvar>::derivative_type derivative_type; - typedef - typename SacadoNumberInfo>::scalar_type - scalar_type; + using ad_type = + typename SacadoNumberInfo>::ad_type; + using derivative_type = typename SacadoNumberInfo< + Sacado::Rad::ADvar>::derivative_type; + using scalar_type = typename SacadoNumberInfo< + Sacado::Rad::ADvar>::scalar_type; /* * Initialize the state of an independent variable. @@ -391,14 +387,12 @@ namespace Differentiation template struct ExtractData> { - typedef typename SacadoNumberInfo< - Sacado::Fad::DFad>::derivative_type derivative_type; - typedef - typename SacadoNumberInfo>::scalar_type - scalar_type; - typedef - typename SacadoNumberInfo>::value_type - value_type; + using derivative_type = typename SacadoNumberInfo< + Sacado::Fad::DFad>::derivative_type; + using scalar_type = + typename SacadoNumberInfo>::scalar_type; + using value_type = + typename SacadoNumberInfo>::value_type; /** * Extract the real scalar value. @@ -445,14 +439,12 @@ namespace Differentiation template struct ExtractData> { - typedef typename SacadoNumberInfo< - Sacado::Rad::ADvar>::derivative_type derivative_type; - typedef - typename SacadoNumberInfo>::scalar_type - scalar_type; - typedef - typename SacadoNumberInfo>::value_type - value_type; + using derivative_type = typename SacadoNumberInfo< + Sacado::Rad::ADvar>::derivative_type; + using scalar_type = typename SacadoNumberInfo< + Sacado::Rad::ADvar>::scalar_type; + using value_type = + typename SacadoNumberInfo>::value_type; /** * Extract the real scalar value. diff --git a/include/deal.II/differentiation/ad/sacado_product_types.h b/include/deal.II/differentiation/ad/sacado_product_types.h index b07f3536aa..e4faee3510 100644 --- a/include/deal.II/differentiation/ad/sacado_product_types.h +++ b/include/deal.II/differentiation/ad/sacado_product_types.h @@ -44,43 +44,43 @@ namespace internal template struct ProductTypeImpl, float> { - typedef Sacado::Fad::DFad type; + using type = Sacado::Fad::DFad; }; template struct ProductTypeImpl> { - typedef Sacado::Fad::DFad type; + using type = Sacado::Fad::DFad; }; template struct ProductTypeImpl, double> { - typedef Sacado::Fad::DFad type; + using type = Sacado::Fad::DFad; }; template struct ProductTypeImpl> { - typedef Sacado::Fad::DFad type; + using type = Sacado::Fad::DFad; }; template struct ProductTypeImpl, int> { - typedef Sacado::Fad::DFad type; + using type = Sacado::Fad::DFad; }; template struct ProductTypeImpl> { - typedef Sacado::Fad::DFad type; + using type = Sacado::Fad::DFad; }; template struct ProductTypeImpl, Sacado::Fad::DFad> { - typedef Sacado::Fad::DFad::type> type; + using type = Sacado::Fad::DFad::type>; }; @@ -93,26 +93,23 @@ namespace internal template struct ProductTypeImpl, U> { - typedef - typename ProductType::value_type, U>::type - type; + using type = + typename ProductType::value_type, U>::type; }; template struct ProductTypeImpl> { - typedef - typename ProductType::value_type>::type - type; + using type = + typename ProductType::value_type>::type; }; template struct ProductTypeImpl, Sacado::Fad::Expr> { - typedef + using type = typename ProductType::value_type, - typename Sacado::Fad::Expr::value_type>::type - type; + typename Sacado::Fad::Expr::value_type>::type; }; } // namespace internal @@ -121,13 +118,13 @@ namespace internal template struct EnableIfScalar> { - typedef Sacado::Fad::DFad type; + using type = Sacado::Fad::DFad; }; template struct EnableIfScalar> { - typedef typename Sacado::Fad::Expr::value_type type; + using type = typename Sacado::Fad::Expr::value_type; }; @@ -141,43 +138,43 @@ namespace internal template struct ProductTypeImpl, float> { - typedef Sacado::Rad::ADvar type; + using type = Sacado::Rad::ADvar; }; template struct ProductTypeImpl> { - typedef Sacado::Rad::ADvar type; + using type = Sacado::Rad::ADvar; }; template struct ProductTypeImpl, double> { - typedef Sacado::Rad::ADvar type; + using type = Sacado::Rad::ADvar; }; template struct ProductTypeImpl> { - typedef Sacado::Rad::ADvar type; + using type = Sacado::Rad::ADvar; }; template struct ProductTypeImpl, int> { - typedef Sacado::Rad::ADvar type; + using type = Sacado::Rad::ADvar; }; template struct ProductTypeImpl> { - typedef Sacado::Rad::ADvar type; + using type = Sacado::Rad::ADvar; }; template struct ProductTypeImpl, Sacado::Rad::ADvar> { - typedef Sacado::Rad::ADvar::type> type; + using type = Sacado::Rad::ADvar::type>; }; /* --- Sacado::Rad::ADvar: Temporary type --- */ @@ -185,43 +182,43 @@ namespace internal template struct ProductTypeImpl, float> { - typedef Sacado::Rad::ADvari type; + using type = Sacado::Rad::ADvari; }; template struct ProductTypeImpl> { - typedef Sacado::Rad::ADvari type; + using type = Sacado::Rad::ADvari; }; template struct ProductTypeImpl, double> { - typedef Sacado::Rad::ADvari type; + using type = Sacado::Rad::ADvari; }; template struct ProductTypeImpl> { - typedef Sacado::Rad::ADvari type; + using type = Sacado::Rad::ADvari; }; template struct ProductTypeImpl, int> { - typedef Sacado::Rad::ADvari type; + using type = Sacado::Rad::ADvari; }; template struct ProductTypeImpl> { - typedef Sacado::Rad::ADvari type; + using type = Sacado::Rad::ADvari; }; template struct ProductTypeImpl, Sacado::Rad::ADvari> { - typedef Sacado::Rad::ADvari::type> type; + using type = Sacado::Rad::ADvari::type>; }; /* --- Sacado::Rad::ADvar: Main and temporary type --- */ @@ -229,13 +226,13 @@ namespace internal template struct ProductTypeImpl, Sacado::Rad::ADvari> { - typedef Sacado::Rad::ADvar::type> type; + using type = Sacado::Rad::ADvar::type>; }; template struct ProductTypeImpl, Sacado::Rad::ADvar> { - typedef Sacado::Rad::ADvar::type> type; + using type = Sacado::Rad::ADvar::type>; }; } // namespace internal @@ -244,14 +241,14 @@ namespace internal template struct EnableIfScalar> { - typedef Sacado::Rad::ADvar type; + using type = Sacado::Rad::ADvar; }; template struct EnableIfScalar> { - typedef Sacado::Rad::ADvari type; + using type = Sacado::Rad::ADvari; }; diff --git a/include/deal.II/distributed/p4est_wrappers.h b/include/deal.II/distributed/p4est_wrappers.h index 5278add952..9c23519cc6 100644 --- a/include/deal.II/distributed/p4est_wrappers.h +++ b/include/deal.II/distributed/p4est_wrappers.h @@ -53,7 +53,7 @@ namespace internal namespace p4est { /** - * A structure whose explicit specializations contain typedefs to the + * A structure whose explicit specializations contain alias to the * relevant p4est_* and p8est_* types. Using this structure, for example * by saying types::connectivity we can write code in a * dimension independent way, either referring to p4est_connectivity_t or @@ -65,35 +65,35 @@ namespace internal template <> struct types<2> { - typedef p4est_connectivity_t connectivity; - typedef p4est_t forest; - typedef p4est_tree_t tree; - typedef p4est_quadrant_t quadrant; - typedef p4est_topidx_t topidx; - typedef p4est_locidx_t locidx; + using connectivity = p4est_connectivity_t; + using forest = p4est_t; + using tree = p4est_tree_t; + using quadrant = p4est_quadrant_t; + using topidx = p4est_topidx_t; + using locidx = p4est_locidx_t; # if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3) - typedef p4est_connect_type_t balance_type; + using balance_type = p4est_connect_type_t; # else - typedef p4est_balance_type_t balance_type; + using balance_type = p4est_balance_type_t; # endif - typedef p4est_ghost_t ghost; + using ghost = p4est_ghost_t; }; template <> struct types<3> { - typedef p8est_connectivity_t connectivity; - typedef p8est_t forest; - typedef p8est_tree_t tree; - typedef p8est_quadrant_t quadrant; - typedef p4est_topidx_t topidx; - typedef p4est_locidx_t locidx; + using connectivity = p8est_connectivity_t; + using forest = p8est_t; + using tree = p8est_tree_t; + using quadrant = p8est_quadrant_t; + using topidx = p4est_topidx_t; + using locidx = p4est_locidx_t; # if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3) - typedef p8est_connect_type_t balance_type; + using balance_type = p8est_connect_type_t; # else - typedef p8est_balance_type_t balance_type; + using balance_type = p8est_balance_type_t; # endif - typedef p8est_ghost_t ghost; + using ghost = p8est_ghost_t; }; @@ -430,26 +430,26 @@ namespace internal template <> struct iter<2> { - typedef p4est_iter_corner_info_t corner_info; - typedef p4est_iter_corner_side_t corner_side; - typedef p4est_iter_corner_t corner_iter; - typedef p4est_iter_face_info_t face_info; - typedef p4est_iter_face_side_t face_side; - typedef p4est_iter_face_t face_iter; + using corner_info = p4est_iter_corner_info_t; + using corner_side = p4est_iter_corner_side_t; + using corner_iter = p4est_iter_corner_t; + using face_info = p4est_iter_face_info_t; + using face_side = p4est_iter_face_side_t; + using face_iter = p4est_iter_face_t; }; template <> struct iter<3> { - typedef p8est_iter_corner_info_t corner_info; - typedef p8est_iter_corner_side_t corner_side; - typedef p8est_iter_corner_t corner_iter; - typedef p8est_iter_edge_info_t edge_info; - typedef p8est_iter_edge_side_t edge_side; - typedef p8est_iter_edge_t edge_iter; - typedef p8est_iter_face_info_t face_info; - typedef p8est_iter_face_side_t face_side; - typedef p8est_iter_face_t face_iter; + using corner_info = p8est_iter_corner_info_t; + using corner_side = p8est_iter_corner_side_t; + using corner_iter = p8est_iter_corner_t; + using edge_info = p8est_iter_edge_info_t; + using edge_side = p8est_iter_edge_side_t; + using edge_iter = p8est_iter_edge_t; + using face_info = p8est_iter_face_info_t; + using face_side = p8est_iter_face_side_t; + using face_iter = p8est_iter_face_t; }; diff --git a/include/deal.II/distributed/shared_tria.h b/include/deal.II/distributed/shared_tria.h index fc6a1e3d40..88e99b4432 100644 --- a/include/deal.II/distributed/shared_tria.h +++ b/include/deal.II/distributed/shared_tria.h @@ -102,11 +102,10 @@ namespace parallel class Triangulation : public dealii::parallel::Triangulation { public: - typedef - typename dealii::Triangulation::active_cell_iterator - active_cell_iterator; - typedef typename dealii::Triangulation::cell_iterator - cell_iterator; + using active_cell_iterator = + typename dealii::Triangulation::active_cell_iterator; + using cell_iterator = + typename dealii::Triangulation::cell_iterator; /** * Configuration flags for distributed Triangulations to be set in the diff --git a/include/deal.II/distributed/tria.h b/include/deal.II/distributed/tria.h index b6aa5ef89a..0c20b18eef 100644 --- a/include/deal.II/distributed/tria.h +++ b/include/deal.II/distributed/tria.h @@ -252,12 +252,12 @@ namespace parallel { public: /** - * A typedef that is used to identify cell iterators. The concept of + * An alias that is used to identify cell iterators. The concept of * iterators is discussed at length in the * @ref Iterators "iterators documentation module". * - * The current typedef identifies cells in a triangulation. You can find - * the exact type it refers to in the base class's own typedef, but it + * The current alias identifies cells in a triangulation. You can find + * the exact type it refers to in the base class's own alias, but it * should be TriaIterator >. The TriaIterator * class works like a pointer that when you dereference it yields an * object of type CellAccessor. CellAccessor is a class that identifies @@ -268,17 +268,17 @@ namespace parallel * * @ingroup Iterators */ - typedef typename dealii::Triangulation::cell_iterator - cell_iterator; + using cell_iterator = + typename dealii::Triangulation::cell_iterator; /** - * A typedef that is used to identify + * An alias that is used to identify * @ref GlossActive "active cell iterators". * The concept of iterators is discussed at length in the * @ref Iterators "iterators documentation module". * - * The current typedef identifies active cells in a triangulation. You - * can find the exact type it refers to in the base class's own typedef, + * The current alias identifies active cells in a triangulation. You + * can find the exact type it refers to in the base class's own alias, * but it should be TriaActiveIterator >. The * TriaActiveIterator class works like a pointer to active objects that * when you dereference it yields an object of type CellAccessor. @@ -289,12 +289,11 @@ namespace parallel * * @ingroup Iterators */ - typedef - typename dealii::Triangulation::active_cell_iterator - active_cell_iterator; + using active_cell_iterator = + typename dealii::Triangulation::active_cell_iterator; - typedef - typename dealii::Triangulation::CellStatus CellStatus; + using CellStatus = + typename dealii::Triangulation::CellStatus; /** * Configuration flags for distributed Triangulations to be set in the @@ -917,11 +916,10 @@ namespace parallel * description of the latter, see the documentation for the member * function register_data_attach. */ - typedef typename std::tuple< + using quadrant_cell_relation_t = typename std::tuple< typename dealii::internal::p4est::types::quadrant *, CellStatus, - cell_iterator> - quadrant_cell_relation_t; + cell_iterator>; /** * Vector of tuples, which each contain a p4est quadrant, a deal.II cell diff --git a/include/deal.II/dofs/deprecated_function_map.h b/include/deal.II/dofs/deprecated_function_map.h index 045a72fb59..a9fb00eb35 100644 --- a/include/deal.II/dofs/deprecated_function_map.h +++ b/include/deal.II/dofs/deprecated_function_map.h @@ -28,46 +28,41 @@ class Function; /** - * This class declares a local typedef that denotes a mapping between a - * boundary indicator (see - * @ref GlossBoundaryIndicator) - * that is used to describe what kind of boundary condition holds on a - * particular piece of the boundary, and the function describing the actual - * function that provides the boundary values on this part of the boundary. - * This type is required in many functions in the library where, for example, - * we need to know about the functions $h_i(\mathbf x)$ used in boundary - * conditions + * This class declares a local alias that denotes a mapping between a boundary + * indicator (see @ref GlossBoundaryIndicator) that is used to describe what + * kind of boundary condition holds on a particular piece of the boundary, and + * the function describing the actual function that provides the boundary values + * on this part of the boundary. This type is required in many functions in the + * library where, for example, we need to know about the functions + * $h_i(\mathbf x)$ used in boundary conditions * @f{align*}{ * \mathbf n \cdot \nabla u = h_i \qquad \qquad * \text{on}\ \Gamma_i\subset\partial\Omega. * @f} - * An example is the function KellyErrorEstimator::estimate() that allows us - * to provide a set of functions $h_i$ for all those boundary indicators $i$ - * for which the boundary condition is supposed to be of Neumann type. Of - * course, the same kind of principle can be applied to cases where we care - * about Dirichlet values, where one needs to provide a map from boundary - * indicator $i$ to Dirichlet function $h_i$ if the boundary conditions are - * given as + * An example is the function KellyErrorEstimator::estimate() that allows us to + * provide a set of functions $h_i$ for all those boundary indicators $i$ for + * which the boundary condition is supposed to be of Neumann type. Of course, + * the same kind of principle can be applied to cases where we care about + * Dirichlet values, where one needs to provide a map from boundary indicator + * $i$ to Dirichlet function $h_i$ if the boundary conditions are given as * @f{align*}{ * u = h_i \qquad \qquad \text{on}\ \Gamma_i\subset\partial\Omega. * @f} - * This is, for example, the case for the VectorTools::interpolate() - * functions. + * This is, for example, the case for the VectorTools::interpolate() functions. * * Tutorial programs step-6, step-7 and step-8 show examples of how to use - * function arguments of this type in situations where we actually have an - * empty map (i.e., we want to describe that no part of the boundary is - * a Neumann boundary). step-16 actually uses it in a case where one of the - * parts of the boundary uses a boundary indicator for which we want to use a - * function object. + * function arguments of this type in situations where we actually have an empty + * map (i.e., we want to describe that no part of the boundary is a + * Neumann boundary). step-16 actually uses it in a case where one of the parts + * of the boundary uses a boundary indicator for which we want to use a function + * object. * - * It seems odd at first to declare this typedef inside a class, rather than - * declaring a typedef at global scope. The reason is that C++ does not allow - * to define templated typedefs, where here in fact we want a typedef that - * depends on the space dimension. (Defining templated typedefs is something - * that is possible starting with the C++11 standard, but that wasn't possible - * within the C++98 standard in place when this programming pattern was - * conceived.) + * It seems odd at first to declare this alias inside a class, rather than + * declaring an alias at global scope. The reason is that C++ does not allow to + * define templated alias, where here in fact we want an alias that depends on + * the space dimension. (Defining templated alias is something that is possible + * starting with the C++11 standard, but that wasn't possible within the C++98 + * standard in place when this programming pattern was conceived.) * * @ingroup functions * @author Wolfgang Bangerth, Ralf Hartmann, 2001 @@ -78,12 +73,12 @@ struct DEAL_II_DEPRECATED FunctionMap /** * Declare the type as discussed above. Since we can't name it FunctionMap * (as that would ambiguate a possible constructor of this class), name it - * in the fashion of the standard container local typedefs. + * in the fashion of the standard container local alias. * * @deprecated Use the alias type directly. */ - DEAL_II_DEPRECATED - typedef std::map *> type; + using type DEAL_II_DEPRECATED = + std::map *>; }; DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/dofs/dof_accessor.h b/include/deal.II/dofs/dof_accessor.h index 74fb8a9497..9bd462f582 100644 --- a/include/deal.II/dofs/dof_accessor.h +++ b/include/deal.II/dofs/dof_accessor.h @@ -79,10 +79,10 @@ namespace internal namespace DoFAccessorImplementation { /** - * This is a switch class which only declares a @p typedef. It is meant to + * This is a switch class which only declares an @p alias. It is meant to * determine which class a DoFAccessor class is to be derived from. By * default, DoFAccessor@ derives from - * the typedef in the general + * the alias in the general * Inheritance@ class, which is * TriaAccessor@, but if * structdim==dim, then the specialization @@ -99,10 +99,10 @@ namespace internal struct Inheritance { /** - * Declaration of the @p typedef. See the full documentation for more + * Declaration of the @p alias. See the full documentation for more * information. */ - typedef dealii::TriaAccessor BaseClass; + using BaseClass = dealii::TriaAccessor; }; @@ -115,10 +115,10 @@ namespace internal struct Inheritance { /** - * Declaration of the @p typedef. See the full documentation for more + * Declaration of the @p alias. See the full documentation for more * information. */ - typedef dealii::CellAccessor BaseClass; + using BaseClass = dealii::CellAccessor; }; } // namespace DoFAccessorImplementation } // namespace internal @@ -148,9 +148,9 @@ namespace internal * function get_active_or_mg_dof_indices(). See the section on Generic loops * below. * - *

Typedefs

+ *

Alias

* - * Usage is best to happen through the typedefs to the various kinds of + * Usage is best to happen through the alias to the various kinds of * iterators provided by the DoFHandler and hp::DoFHandler classes, since they * are more secure to changes in the class naming and template interface as * well as providing easier typing (much less complicated names!). @@ -226,16 +226,16 @@ public: static const unsigned int space_dimension = DoFHandlerType::space_dimension; /** - * Declare a typedef to the base class to make accessing some of the + * Declare an alias to the base class to make accessing some of the * exception classes simpler. */ - typedef typename dealii::internal::DoFAccessorImplementation:: - Inheritance::BaseClass BaseClass; + using BaseClass = typename dealii::internal::DoFAccessorImplementation:: + Inheritance::BaseClass; /** * Data type passed by the iterator class. */ - typedef DoFHandlerType AccessorData; + using AccessorData = DoFHandlerType; /** * @name Constructors @@ -778,15 +778,15 @@ public: static const unsigned int space_dimension = spacedim; /** - * Declare a typedef to the base class to make accessing some of the + * Declare an alias to the base class to make accessing some of the * exception classes simpler. */ - typedef TriaAccessor<0, 1, spacedim> BaseClass; + using BaseClass = TriaAccessor<0, 1, spacedim>; /** * Data type passed by the iterator class. */ - typedef DoFHandlerType<1, spacedim> AccessorData; + using AccessorData = DoFHandlerType<1, spacedim>; /** * @name Constructors @@ -1252,10 +1252,10 @@ class DoFInvalidAccessor : public InvalidAccessor { public: /** - * Propagate typedef from base class to this class. + * Propagate alias from base class to this class. */ - typedef typename InvalidAccessor::AccessorData - AccessorData; + using AccessorData = + typename InvalidAccessor::AccessorData; /** * Constructor. This class is used for iterators that do not make @@ -1334,30 +1334,27 @@ public: /** * Data type passed by the iterator class. */ - typedef DoFHandlerType AccessorData; + using AccessorData = DoFHandlerType; /** - * Declare a typedef to the base class to make accessing some of the + * Declare an alias to the base class to make accessing some of the * exception classes simpler. */ - typedef DoFAccessor - BaseClass; + using BaseClass = + DoFAccessor; /** * Define the type of the container this is part of. */ - typedef DoFHandlerType Container; + using Container = DoFHandlerType; /** * A type for an iterator over the faces of a cell. This is what the face() * function returns. */ - typedef TriaIterator> - face_iterator; + using face_iterator = TriaIterator>; /** * @name Constructors and initialization diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index bc214020d6..9b08cd587b 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -199,34 +199,32 @@ namespace internal template class DoFHandler : public Subscriptor { - typedef dealii::internal::DoFHandlerImplementation:: - Iterators, false> - ActiveSelector; - typedef dealii::internal::DoFHandlerImplementation:: - Iterators, true> - LevelSelector; + using ActiveSelector = dealii::internal::DoFHandlerImplementation:: + Iterators, false>; + using LevelSelector = dealii::internal::DoFHandlerImplementation:: + Iterators, true>; public: - typedef typename ActiveSelector::CellAccessor cell_accessor; - typedef typename ActiveSelector::FaceAccessor face_accessor; + using cell_accessor = typename ActiveSelector::CellAccessor; + using face_accessor = typename ActiveSelector::FaceAccessor; - typedef typename ActiveSelector::line_iterator line_iterator; - typedef typename ActiveSelector::active_line_iterator active_line_iterator; + using line_iterator = typename ActiveSelector::line_iterator; + using active_line_iterator = typename ActiveSelector::active_line_iterator; - typedef typename ActiveSelector::quad_iterator quad_iterator; - typedef typename ActiveSelector::active_quad_iterator active_quad_iterator; + using quad_iterator = typename ActiveSelector::quad_iterator; + using active_quad_iterator = typename ActiveSelector::active_quad_iterator; - typedef typename ActiveSelector::hex_iterator hex_iterator; - typedef typename ActiveSelector::active_hex_iterator active_hex_iterator; + using hex_iterator = typename ActiveSelector::hex_iterator; + using active_hex_iterator = typename ActiveSelector::active_hex_iterator; /** - * A typedef that is used to identify + * An alias that is used to identify * @ref GlossActive "active cell iterators". * The concept of iterators is discussed at length in the * @ref Iterators "iterators documentation module". * - * The current typedef identifies active cells in a DoFHandler object. While - * the actual data type of the typedef is hidden behind a few layers of + * The current alias identifies active cells in a DoFHandler object. While + * the actual data type of the alias is hidden behind a few layers of * (unfortunately necessary) indirections, it is in essence * TriaActiveIterator. The TriaActiveIterator class works * like a pointer to active objects that when you dereference it yields an @@ -239,22 +237,22 @@ public: * * @ingroup Iterators */ - typedef typename ActiveSelector::active_cell_iterator active_cell_iterator; + using active_cell_iterator = typename ActiveSelector::active_cell_iterator; /** - * A typedef that is used to identify cell iterators. The concept of + * An alias that is used to identify cell iterators. The concept of * iterators is discussed at length in the * @ref Iterators "iterators documentation module". * - * The current typedef identifies cells in a DoFHandler object. Some of + * The current alias identifies cells in a DoFHandler object. Some of * these cells may in fact be active (see * @ref GlossActive "active cell iterators") * in which case they can in fact be asked for the degrees of freedom that * live on them. On the other hand, if the cell is not active, any such * query will result in an error. Note that this is what distinguishes this - * typedef from the level_cell_iterator typedef. + * alias from the level_cell_iterator alias. * - * While the actual data type of the typedef is hidden behind a few layers + * While the actual data type of the alias is hidden behind a few layers * of (unfortunately necessary) indirections, it is in essence * TriaIterator. The TriaIterator class works like a * pointer to objects that when you dereference it yields an object of type @@ -267,14 +265,14 @@ public: * * @ingroup Iterators */ - typedef typename ActiveSelector::cell_iterator cell_iterator; + using cell_iterator = typename ActiveSelector::cell_iterator; /** - * A typedef that is used to identify iterators that point to faces. + * An alias that is used to identify iterators that point to faces. * The concept of iterators is discussed at length in the * @ref Iterators "iterators documentation module". * - * While the actual data type of the typedef is hidden behind a few layers + * While the actual data type of the alias is hidden behind a few layers * of (unfortunately necessary) indirections, it is in essence * TriaIterator. The * TriaIterator class works like a pointer to objects that when @@ -285,26 +283,26 @@ public: * * @ingroup Iterators */ - typedef typename ActiveSelector::face_iterator face_iterator; + using face_iterator = typename ActiveSelector::face_iterator; /** - * A typedef that is used to identify iterators that point to active faces, + * An alias that is used to identify iterators that point to active faces, * i.e., to faces that have no children. Active faces must be faces of at * least one active cell. * - * Other than the "active" qualification, this typedef is identical to the - * @p face_iterator typedef. In particular, dereferencing either yields + * Other than the "active" qualification, this alias is identical to the + * @p face_iterator alias. In particular, dereferencing either yields * the same kind of object. * * @ingroup Iterators */ - typedef typename ActiveSelector::active_face_iterator active_face_iterator; + using active_face_iterator = typename ActiveSelector::active_face_iterator; - typedef typename LevelSelector::CellAccessor level_cell_accessor; - typedef typename LevelSelector::FaceAccessor level_face_accessor; + using level_cell_accessor = typename LevelSelector::CellAccessor; + using level_face_accessor = typename LevelSelector::FaceAccessor; - typedef typename LevelSelector::cell_iterator level_cell_iterator; - typedef typename LevelSelector::face_iterator level_face_iterator; + using level_cell_iterator = typename LevelSelector::cell_iterator; + using level_face_iterator = typename LevelSelector::face_iterator; /** diff --git a/include/deal.II/dofs/dof_iterator_selector.h b/include/deal.II/dofs/dof_iterator_selector.h index eafb81cfc8..e6ed01460c 100644 --- a/include/deal.II/dofs/dof_iterator_selector.h +++ b/include/deal.II/dofs/dof_iterator_selector.h @@ -59,33 +59,33 @@ namespace internal template