Преглед на файлове

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

Michele Caini преди 2 години
родител
ревизия
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>