TheOpenSpaceProgram / new-ospgl

A space exploration game in OpenGL. Devblog: https://tatjam.github.io/index.html
MIT License
43 stars 6 forks source link

Universe.h issue #14

Closed Titaniumtown closed 4 years ago

Titaniumtown commented 4 years ago

I get the following error during compilation: /home/simon/new-ospgl/src/universe/Universe.h:83:13: error: parameter packs not expanded with ‘...’: 83 | T* n_ent = new T(args); | ^~~~~~~~~~~

jonesmz commented 4 years ago

Change

template<typename T, typename... Args> 
T* create_entity(Args... args);

to

template<typename T, typename... Args> 
T* create_entity(Args... args);

and

template<typename T, typename ...Args>
inline T* Universe::create_entity(Args... args)

to

template<typename T, typename ...Args>
inline T* Universe::create_entity(Args && ... args)

and T* n_ent = new T(args); to T* n_ent = new T(std::forward<Args>(args)...);

tatjam commented 4 years ago

Agh why is Visual Studio so permissive... Will push the fix next commit

jonesmz commented 4 years ago

https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=vs-2019

tatjam commented 4 years ago

Visual Studio actually reports these errors, but you need to call the code that causes them somewhere.

Enabling /permissive- doesn't seem to change that behaviour, but it throws some warnings on the dependency libraries.

tatjam commented 4 years ago

It's fixed now, forgot to close the issue!