Entt: VS2017 parsing issue

Created on 4 Jan 2018  路  8Comments  路  Source: skypjack/entt

Today is a busy day, I kind of feel sorry opening another issue.

I'm also running into an Issue with VS2017, until know I've been building with gcc and XCode. I've spent the last few days fixing issues to be able to run my application on WIndows. The last issue I was not able to resolve looks like a parsing issue in the view.hpp.

It's weird because I can see that the entt tests run successfully on the CI Service with VS.

It seems to be only one line VS struggles with inside the reset method.

void reset() {
    using accumulator_type = size_type[];
    auto probe = [this](auto sz, auto &pool) { return pool.size() < sz ? (view = &pool, pool.size()) : sz; };
    size_type sz = std::max({ std::get<pool_type<Component> &>(pools).size()... }) + std::size_t{1};  // This line here.
    accumulator_type accumulator = { sz, (sz = probe(sz, std::get<pool_type<Component> &>(pools)))... };
        (void)accumulator;
}
````

This is line 517:
```cpp
size_type sz = std::max({ std::get<pool_type<Component> &>(pools).size()... }) + std::size_t{1};

Here is the error output:

/src\entt\entity\view.hpp(517): error C2062: type 'unknown-type' unexpected
/src\entt\entity\view.hpp(517): error C2143: syntax error: missing ';' before '{'
/src\entt\entity\view.hpp(517): error C2143: syntax error: missing ')' before ';'
/src\entt\entity\view.hpp(517): error C3520: 'Component': parameter pack must be expanded in this context
/src\entt\entity\view.hpp(517): error C2228: left of '.size' must have class/struct/union
/src\entt\entity\view.hpp(517): error C2143: syntax error: missing ';' before '...'
/src\entt\entity\view.hpp(517): error C2059: syntax error: '...'
/src\entt\entity\view.hpp(517): error C2059: syntax error: ')'
/src\entt\entity\view.hpp(517): error C2059: syntax error: '>'
/src\entt\entity\view.hpp(517): error C2143: syntax error: missing ';' before '{'
/src\entt\entity\view.hpp(517): error C3520: 'Component': parameter pack must be expanded in this context
/src\entt\entity\view.hpp(517): error C2228: left of '.size' must have class/struct/union
/src\entt\entity\view.hpp(517): error C2059: syntax error: '...'
/src\entt\entity\view.hpp(517): error C2059: syntax error: ')'
/src\entt\entity\view.hpp(517): error C2059: syntax error: ':'
/src\entt\entity\view.hpp(517): error C2143: syntax error: missing ';' before '{'
/src\entt\entity\view.hpp(517): error C2143: syntax error: missing ';' before '}'

Thanks in Advance.
PS: I love the signal stuff, I've been able to implement it :)

invalid wontfix

Most helpful comment

I just solved it, but i honestly don't understand it. at all...

Somehow changing the order of the header file includes in the SpriteDrawer solved the issue for me. I really don't get it. They are currently not connected at all... I guess I need some sleep.

Thanks. :)

All 8 comments

Did you see #26?
It seems that VS2017 gets in trouble if you turn on the Conformance mode. Is this the case?
I'm asking just to eliminate an option.

PS: I love the signal stuff, I've been able to implement it :)

I'm glad to know that.
I'm using that stuff in a real world project and it works quite well actually. :-)

I don't use VS very often, that option seems to be missing, or am I missing something?

properties

I don't use VS at all!! :-D
@Djuego can you help us?

@mario-deluna Meanwhile, can you create a minimal example to reproduce the error?
This way I can add it to the test suite and have a try with appveyor.
Unless I don't know how to help you, for unfortunately I don't know how to reproduce the error so far.

Hmm, I was able to run the tests with VS2017 on clean new setup. So I guess the issue has to be related to how I generate the .sln file with cmake, or I messed something up in the code. It runs completely fine on mac.

I will continue digging into this and keep you updated if this is somehow related to entt in the end.

Ok, good, thank you.
Please, keep updated the issue. I'm closing it in a week in case of no feedbacks from you.
Can it work for you?

I just solved it, but i honestly don't understand it. at all...

Somehow changing the order of the header file includes in the SpriteDrawer solved the issue for me. I really don't get it. They are currently not connected at all... I guess I need some sleep.

Thanks. :)

Just out of curiosity, did you get what was the problem? If it's something related to EnTT, please let me know.

Thank you.

Was this page helpful?
0 / 5 - 0 ratings