summaryrefslogtreecommitdiff
path: root/include/CommonAPI/Variant.hpp
diff options
context:
space:
mode:
authorLutz Bichler <Lutz.Bichler@bmw.de>2019-07-22 12:12:02 +0200
committerLutz Bichler <Lutz.Bichler@bmw.de>2019-07-22 12:12:02 +0200
commit99ebf3461f51e4899f06457d6aafdaa4adecd278 (patch)
treee41d0fbc8682601c80ce9a892f77a8fa355721db /include/CommonAPI/Variant.hpp
parent2fd0625d21f1fa8e6a3adfc89ce9f381a4d33990 (diff)
downloadgenivi-common-api-runtime-99ebf3461f51e4899f06457d6aafdaa4adecd278.tar.gz
capicxx-core-runtime 3.1.12.63.1.12.6
Diffstat (limited to 'include/CommonAPI/Variant.hpp')
-rw-r--r--include/CommonAPI/Variant.hpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/CommonAPI/Variant.hpp b/include/CommonAPI/Variant.hpp
index db1cf7b..c6cd40f 100644
--- a/include/CommonAPI/Variant.hpp
+++ b/include/CommonAPI/Variant.hpp
@@ -619,7 +619,9 @@ Variant<Types_...>::Variant()
}
template<typename... Types_>
-Variant<Types_...>::Variant(const Variant &_source) {
+Variant<Types_...>::Variant(const Variant &_source) :
+ valueType_(_source.valueType_)
+{
AssignmentVisitor<Types_...> visitor(*this, false);
ApplyVoidVisitor<
AssignmentVisitor<Types_...> , Variant<Types_...>, Types_...
@@ -627,7 +629,8 @@ Variant<Types_...>::Variant(const Variant &_source) {
}
template<typename... Types_>
-Variant<Types_...>::Variant(Variant &&_source)
+Variant<Types_...>::Variant(Variant &&_source) :
+ valueType_(_source.valueType_)
{
AssignmentVisitor<Types_...> visitor(*this, false);
ApplyVoidVisitor<
@@ -688,7 +691,9 @@ template<typename Type_>
Variant<Types_...>::Variant(const Type_ &_value,
typename std::enable_if<!std::is_const<Type_>::value>::type*,
typename std::enable_if<!std::is_reference<Type_>::value>::type*,
- typename std::enable_if<!std::is_same<Type_, Variant<Types_...>>::value>::type*) {
+ typename std::enable_if<!std::is_same<Type_, Variant<Types_...>>::value>::type*) :
+ valueType_(0x0)
+{
set<typename TypeSelector<Type_, Types_...>::type>(_value, false);
}
@@ -697,7 +702,9 @@ template<typename Type_>
Variant<Types_...>::Variant(Type_ &&_value,
typename std::enable_if<!std::is_const<Type_>::value>::type*,
typename std::enable_if<!std::is_reference<Type_>::value>::type*,
-typename std::enable_if<!std::is_same<Type_, Variant<Types_...>>::value>::type*) {
+typename std::enable_if<!std::is_same<Type_, Variant<Types_...>>::value>::type*) :
+ valueType_(0x0)
+{
set<typename TypeSelector<Type_, Types_...>::type>(std::move(_value), false);
}