meganz / mingw-std-threads

Standard threads implementation currently still missing on MinGW GCC on Windows
BSD 2-Clause "Simplified" License
439 stars 137 forks source link

Problem with std::packaged_task in c++17 #75

Open Jamaika1 opened 3 years ago

Jamaika1 commented 3 years ago

I wanted to compile an htjpeg2000 grok which uses the ThreadPool library. https://github.com/progschj/ThreadPool I can't compile the save.

    auto task = std::make_shared< std::packaged_task<return_type()> >(
            std::bind(std::forward<F>(f), std::forward<Args>(args)...)
        );

or

    auto task = std::shared_ptr< std::packaged_task<return_type()> >(
                 new std::packaged_task<return_type()>(std::bind(std::forward<F>(f), std::forward<Args>(args)...))
        );
nmcclatchey commented 3 years ago

Hi. The library does not currently implement std::packaged_task. Perhaps you would like to contribute an implementation?

Jamaika1 commented 3 years ago

As much as I could, I modified it so that it could be used in GCC 11.0 / 12.0. However, the plugin is not suitable for the latest C⁺⁺17 or higher codecs. https://github.com/Jamaika1/mingw_std_threads