Просмотр исходного кода

test: boxed_type<T>::operator T()

Michele Caini 2 лет назад
Родитель
Сommit
a28ff99b08
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      test/common/boxed_type.h

+ 4 - 0
test/common/boxed_type.h

@@ -6,6 +6,10 @@ namespace test {
 template<typename Type>
 struct boxed_type {
     Type value{};
+
+    operator Type() const noexcept {
+        return value;
+    }
 };
 
 template<typename Type>