Skip to content

Commit 5b4a046

Browse files
author
kloepj2
committed
added explanation for baseType struct
1 parent 6741769 commit 5b4a046

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/MeshField_Element.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,14 @@ struct FieldElement {
5959
const ElementDofHolderAccessor elm2dofIn)
6060
: numMeshEnts(numMeshEntsIn), field(fieldIn), shapeFn(shapeFnIn),
6161
elm2dof(elm2dofIn) {}
62+
/* general template for baseType which simply sets type
63+
*/
6264
template <typename T> struct baseType {
6365
using type = T;
6466
};
67+
/* template specialization to recursively strip type to get base type
68+
* Example: int[5][6] => int[6] => int
69+
*/
6570
template <typename T, size_t N> struct baseType<T[N]> {
6671
using type = typename baseType<T>::type;
6772
};

0 commit comments

Comments
 (0)