bnoazx005 / TDEngine2

TDEngine2 is a cross-platform game engine
Apache License 2.0
18 stars 4 forks source link

[Bug] CResult<T, E> works incorrect with non-POD types, especially with STL containers #3

Closed bnoazx005 closed 5 years ago

bnoazx005 commented 5 years ago

Bug report

CResult<T, E> works incorrect with non-POD types, especially with STL containers

Environment

Win32 / Visual Studio 2017

Steps to reproduce the issue

Try the following code out to reproduce the problem:

CResult<std::vector<int>> resVec = TOkValue<std::vector<int>>({1, 2, 3});

What's the expected result?

In normal way it should assign data into CResult<T, E> without any problem, but some problem occurs when non-POD data is copied into the internal storage.

What's the actual result?

'read access violation' exception is thrown in xutility file