tzaeschke / phtree-cpp

PH-Tree C++ implementation
Apache License 2.0
29 stars 9 forks source link

Consider single include File #148

Closed joness95 closed 1 year ago

joness95 commented 1 year ago

Hi there, I'm a huge fan of your work :) Would it be possible, to create a header only single include file? This repo seems to only consist of headers, therefor it would be more easy to include it in projects.

tzaeschke commented 1 year ago

Thanks! Yes, this is a header-only library. Putting all headers into a single file would be possible but would make it hard to maintain and manage. It also simplifies trying out extension where I use some part of the code (e.g. stuff in common, but not the rest. It also feels a bit strange to have PhTree and PhTreeMultimap in the same file when you usually need only one of them. So I am probably not going to do this.

Do you have a specific problem with including it, except for it being multiple files?

I hoped project inclusion would not be too hard, it should be straight forward with bazel/cmake. With Visual Studio I just copied the whole phtree folder structure into my project and included phtree.h which worked fine (even though the folder structure was not shown in the project explorer, instead all files appeared as if in the root folder).

joness95 commented 1 year ago

For me it was just that in vs i had to add every single file separately ( probably i should update ..). As for the why: You don't need to know which file you need to include. The unused code should be ignored by the compiler and you would have access to all the classes that are not directly included in phtree.h Also it shouldn't be that complicated to generate a single file out of the sources. I just find it more convenient and like the style of single includes ( like the entt repo from skypjack).

But I will check it again :) Thanks for the response btw

tzaeschke commented 1 year ago

@joness95

Thanks for the response btw

No problem. Let me know if you find any other problem.