#ifndef Util_Any_h__ #define Util_Any_h__ #include #include struct Any { Any() { } template Any(const T& value) { Data = boost::shared_array(new char[sizeof(T)]); Size = sizeof(T); memcpy(Data.get(), &value, Size); } template Any(T&& value) { Data = boost::shared_array(new char[sizeof(T)]); Size = sizeof(T); memcpy(Data.get(), &value, Size); } template Any& operator=(const T& value) { return Any(value); } template Any& operator=(T&& value) { return Any(value); } boost::shared_array Data = nullptr; std::size_t Size = 0; }; #endif