bshoshany / thread-pool

BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library
MIT License
2.21k stars 253 forks source link

Place private classes at head of file #136

Closed Oberonc closed 10 months ago

Oberonc commented 10 months ago

Some private classes (like "blocks") are declared + defined after they are being used. Modern compilers can handle this, but some old ones (and old editors) dont like that so much.

Please move the private classes to a position in the header file before they are being used.

.. or at least forward declare them.

bshoshany commented 10 months ago

Thanks for opening this issue! Can you please give an example of a compiler that doesn't compile v4.0.0, so I can check it on my system and fix the issue?

bshoshany commented 10 months ago

Update: I looked it up online, and I cannot find any information about compilers that require forward declaration of nested classes. As far as I know, in any C++17-compliant compiler, this should not be an issue. Since this library explicitly targets only C++17-compliant compilers, I am closing this issue for now, unless you can provide an example of such a compiler that fails to compile the included test program due to this issue. Thanks again!