Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong include position in single_include header #389

Closed
bmanga opened this issue Jan 11, 2020 · 6 comments
Closed

Wrong include position in single_include header #389

bmanga opened this issue Jan 11, 2020 · 6 comments
Assignees
Labels
triage pending issue, PR or whatever

Comments

@bmanga
Copy link

bmanga commented Jan 11, 2020

Ciao :)
The single include version of the library, there are usages of std::vector before it is included, causing a compile-time error.

@skypjack skypjack self-assigned this Jan 11, 2020
@skypjack skypjack added the triage pending issue, PR or whatever label Jan 11, 2020
@skypjack
Copy link
Owner

Hi there,

May I ask you to provide an example that makes it fail to compile?
I tried the current single include header online and it compiles fine without errors.
I've no clue on how to reproduce the issue you mentioned. You can freely reuse the online tool and drop here a link if you like. 👍

Thank you!

@indianakernick
Copy link
Contributor

entt::radix_sort uses std::vector without including it. Perhaps that's the cause of the issue? Though I wasn't able to reproduce the error online because std::vector is defined by the time radix_sort is instantiated.

I noticed that some headers appear more than once in the single include header. For example core/algorithm.hpp appears twice core/config.hpp appears fifteen times. The file could be made a bit smaller by only keeping the first occurance.

@skypjack
Copy link
Owner

Wow @Kerndog73 how did you spot it? 😲

I noticed that some headers appear more than once in the single include header. For example core/algorithm.hpp appears twice core/config.hpp appears fifteen times. The file could be made a bit smaller by only keeping the first occurance.

Long story short: I use this file to prepare the single include header and I've from zero to no experience with python fortunately. So, I don't think I'll ever be able to modify it.
Of course, any PR is welcome if you want to try. :)


@bmanga

Was the include from algorithm.hpp your problem?

@indianakernick
Copy link
Contributor

how did you spot it?

The first occurrence of #include <vector> is on line 1457 and the first occurence of std::vector is on line 270.

I've from zero to no experience with python fortunately. So, I don't think I'll ever be able to modify it.
Of course, any PR is welcome if you want to try. :)

I don't really have much experience either. Oh well.

@bmanga
Copy link
Author

bmanga commented Jan 12, 2020

Weird, I don't remember how I encountered it and I can't find a way to trigger it anymore :(
Sorry for the false alarm, but I'm glad at least some improvement came out of it.

@skypjack
Copy link
Owner

That's fine @bmanga I added a commit to fix the missing include pointed out by @Kerndog73 👍
Please, leave the issue open. It will be closed automatically when I merge everything on master.

Thank you and feel free to contact me if you need. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage pending issue, PR or whatever
Projects
None yet
Development

No branches or pull requests

3 participants