Enabling C++14?/using Sol2 Lua wrapper?

Well, i built the source version and there was still no ToolChain.cs file, but i found a “VCToolChain.cs” in the UnrealBuildTool/Windows subfolder, i guess they changed it since back when that linked post was written… but changing anything there didn’t help either, still no C++14.

I read through the source code of Sol2 and it’s not really using digraphs, the compiler just thinks that its using diagraphs because of lines like

struct tie_size<::sol::tie_t<Tn…>> : ::std::tuple_size<::std::tuple<Tn…>> { };

But these warnings aren’t really my problem, i can remove the “::” and it’s fine and dandy, it’s the other errors i worry about, hence why i asked how to use C++14 with UE4 since it’s stated in the Sol2 manual that C++14 is required.

Well, my hope was that when i have C++14 active in UE4 that all the neccessary features are available. Do you have any link for examples or tutorials how such separate compiling and then interface-linking could be done?

EDIT : It seems like these errors occur because UE4 uses tons of macros to redefine , some of which being “#define check(”, and sol2 is using “check()” aswell, so when using sol2 in a UE4 it conflicts with UE4s check macros.
I fixed that by undefining and redefining UE4s check macros after the sol.hpp inclusion


#undef check
#include "sol.hpp"
#define check(expr)             { if(UNLIKELY(!(expr))) { FDebug::LogAssertFailedMessage( #expr, __FILE__, __LINE__ ); _DebugBreakAndPromptForRemote(); FDebug::AssertFailed( #expr, __FILE__, __LINE__ ); CA_ASSUME(false); } }

That gets rid of all the errors, only a few new errors are thrown:


2>\sol2\Includes\sol.hpp(1028):` error C4583: 'sol::storage_t&lt;T&gt;::value_': destructor is not implicitly called

and


2>\sol2\Includes\sol.hpp(1028): error C4583: 'sol::storage_t<T>::value_': destructor is not implicitly called

which come from this piece of code:



 template <class T>
 union storage_t
 {
   unsigned char dummy_;
   T value_;
 
   constexpr storage_t( trivial_init_t ) noexcept : dummy_() {};
 
   template <class... Args>
   constexpr storage_t( Args&&... args ) : value_(constexpr_forward<Args>(args)...) {}
 
   ~storage_t(){}
 };


Does UE4 have any special convention for using constructors/destructors in third party code?