initializer_list.patch (2,759 bytes)
diff --git a/src/OpenFOAM/containers/HashTables/Map/Map.H b/src/OpenFOAM/containers/HashTables/Map/Map.H
index 46de9db..8ef2f56 100644
--- a/src/OpenFOAM/containers/HashTables/Map/Map.H
+++ b/src/OpenFOAM/containers/HashTables/Map/Map.H
@@ -91,6 +91,11 @@ public:
HashTable<T, label, Hash<label>>(map)
{}
+ //- Construct from an initializer list
+ Map(std::initializer_list<Tuple2<label, T>> map)
+ :
+ HashTable<T, label, Hash<label>>(map)
+ {}
};
diff --git a/src/OpenFOAM/containers/Lists/SortableList/SortableList.C b/src/OpenFOAM/containers/Lists/SortableList/SortableList.C
index 784b1f9..d6f733b 100644
--- a/src/OpenFOAM/containers/Lists/SortableList/SortableList.C
+++ b/src/OpenFOAM/containers/Lists/SortableList/SortableList.C
@@ -72,6 +72,15 @@ Foam::SortableList<T>::SortableList(const SortableList<T>& lst)
{}
+template<class T>
+Foam::SortableList<T>::SortableList(std::initializer_list<T> values)
+:
+ List<T>(values)
+{
+ sort();
+}
+
+
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/containers/Lists/SortableList/SortableList.H b/src/OpenFOAM/containers/Lists/SortableList/SortableList.H
index a6f4b45..05a20f7 100644
--- a/src/OpenFOAM/containers/Lists/SortableList/SortableList.H
+++ b/src/OpenFOAM/containers/Lists/SortableList/SortableList.H
@@ -84,6 +84,9 @@ public:
//- Construct as copy.
SortableList(const SortableList<T>&);
+ //- Construct from an initializer list, sorting immediately.
+ explicit SortableList(std::initializer_list<T>);
+
// Member Functions
diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C
index ea27071..7200dfb 100644
--- a/src/OpenFOAM/fields/Fields/Field/Field.C
+++ b/src/OpenFOAM/fields/Fields/Field/Field.C
@@ -244,6 +244,13 @@ Foam::Field<Type>::Field(const UList<Type>& list)
{}
+template<class Type>
+Foam::Field<Type>::Field(const UIndirectList<Type>& list)
+:
+ List<Type>(list)
+{}
+
+
#ifndef NoConstructFromTmp
template<class Type>
Foam::Field<Type>::Field(const tmp<Field<Type>>& tf)
diff --git a/src/OpenFOAM/fields/Fields/Field/Field.H b/src/OpenFOAM/fields/Fields/Field/Field.H
index 87715a2..245870e 100644
--- a/src/OpenFOAM/fields/Fields/Field/Field.H
+++ b/src/OpenFOAM/fields/Fields/Field/Field.H
@@ -123,6 +123,9 @@ public:
//- Construct as copy of a UList\<Type\>
explicit Field(const UList<Type>&);
+ //- Construct as copy of a UIndirectList\<Type\>
+ explicit Field(const UIndirectList<Type>&);
+
//- Construct by transferring the List contents
explicit Field(const Xfer<List<Type>>&);