| 866 | } |
| 867 | |
| 868 | virtual void Write(lua_State* L, void* ContainerPtr, int32 IndexInStack) const override |
| 869 | { |
| 870 | static_assert(TIsCopyConstructible<T>::Value, "type must be copy constructible!"); |
| 871 | T V = UnLua::Get(L, IndexInStack, TType<T>()); |
| 872 | CopyInternal((T*)ContainerPtr, &V, typename TChooseClass<TIsTriviallyCopyConstructible<T>::Value, FTrue, FFalse>::Result()); |
| 873 | } |
| 874 | |
| 875 | private: |
| 876 | void CopyInternal(T* Dest, const T* Src, FFalse NotTrivial) const { new(Dest) T(*Src); } |