]> git.sesse.net Git - casparcg/blobdiff - common/array.h
* Added RxCpp library for LINQ api, replacing Boost.Range based iterations where...
[casparcg] / common / array.h
index 8ae95bc000b437ec8d33636eb40b96f387f60a1e..08c1e2e653b575eb824b3064e923c3676274d87b 100644 (file)
@@ -8,10 +8,12 @@
 #include <cstddef>
 #include <cstdint>
 
+#include "assert.h"
+
 namespace caspar {
        
 template<typename T>
-class array sealed
+class array final
 {
        array(const array<std::uint8_t>&);
        array& operator=(const array<std::uint8_t>&);
@@ -77,13 +79,14 @@ private:
 };
 
 template<typename T>
-class array<const T> sealed
+class array<const T> final
 {
 public:
 
        // Static Members
 
        // Constructors
+       array() = default; // Needed by std::future
 
        template<typename T>
        explicit array(const std::uint8_t* ptr, std::size_t size, bool cacheable, T&& storage)
@@ -93,7 +96,15 @@ public:
                , storage_(new boost::any(std::forward<T>(storage)))
        {
        }
-       
+
+       explicit array(const std::uint8_t* ptr, std::size_t size, bool cacheable)
+               : ptr_(ptr)
+               , size_(size)
+               , cacheable_(cacheable)
+               , storage_(new boost::any)
+       {
+       }
+
        array(const array& other)
                : ptr_(other.ptr_)
                , size_(other.size_)