Browse Source

Add new constructor to value Class with vector

Eric Ramat 5 months ago
parent
commit
60ba269600
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/artis-star/common/Value.hpp

+ 5 - 3
src/artis-star/common/Value.hpp

@@ -54,13 +54,15 @@ public:
   Value(const T *value, size_t size)
   { assign(value, sizeof(T) * size, typeid(T *).hash_code()); }
 
+  template<typename T>
+  Value(const std::vector <T> &value, size_t size)
+  { assign(value.data(), sizeof(T) * value.size(), typeid(T *).hash_code()); }
+
   Value(void *content, size_t size)
   { assign(content, size, typeid(void *).hash_code()); }
 
   Value(const char *value, unsigned int size)
-  {
-    assign(value, size * sizeof(char), typeid(char *).hash_code());
-  }
+  { assign(value, size * sizeof(char), typeid(char *).hash_code()); }
 
   Value(const Value &value)
   {