I am trying to use the EASTL for a project I'm working on, it wouldn't compile and the only error I could find came from its "EASTL/initializer_list.h", I am working with the newest version of this file. The 2 errors that came were C2953 and another one telling me to look at its definition. The EASTL automatically disables all warnings that came along with including this file and even has its own definition of it to use in its files. The only problem is this is including the windows version of the file and it's still causing an error, even though it should be including just fine? I am working on C++14, my platform toolset is v142 (Visual Studio 2019), and my Windows SDK version is 10.0; I am aware is says to update the "EA_HAVE_CPP11_INITIALIZER_LIST define from ", which I have already done, so that shouldn't be the issue.
Here is the code causing the error:
#if defined(EA_HAVE_CPP11_INITIALIZER_LIST) // If the compiler can generate calls to std::initializer_list...
// The initializer_list type must be declared in the std namespace, as that's the
// namespace the compiler uses when generating code to use it.
EA_DISABLE_ALL_VC_WARNINGS()
#include <initializer_list>
EA_RESTORE_ALL_VC_WARNINGS()
#else
// If you get an error here about initializer_list being already defined, then the EA_HAVE_CPP11_INITIALIZER_LIST define from <EABase/eahave.h> needs to be updated.
namespace std
{
// See the C++11 Standard, section 18.9.
template<class E>
class initializer_list
{
public:
typedef E value_type;
typedef const E& reference;
typedef const E& const_reference;
typedef size_t size_type;
typedef const E* iterator; // Must be const, as initializer_list (and its mpArray) is an immutable temp object.
typedef const E* const_iterator;
private:
iterator mpArray;
size_type mArraySize;
// This constructor is private, but the C++ compiler has the ability to call it, as per the C++11 Standard.
initializer_list(const_iterator pArray, size_type arraySize)
: mpArray(pArray), mArraySize(arraySize) { }
public:
initializer_list() EA_NOEXCEPT // EA_NOEXCEPT requires a recent version of EABase.
: mpArray(NULL), mArraySize(0) { }
size_type size() const EA_NOEXCEPT { return mArraySize; }
const_iterator begin() const EA_NOEXCEPT { return mpArray; } // Must be const_iterator, as initializer_list (and its mpArray) is an immutable temp object.
const_iterator end() const EA_NOEXCEPT { return mpArray + mArraySize; }
};
}
#endif
I have tried making it use both the std version of the class and the EA version of the class, both of which cause the same error (C2953). Any help is appreciated as I want to be able to compile this sooner rather than later!