nan icon indicating copy to clipboard operation
nan copied to clipboard

AsyncProgress(Queue)Worker progress class requires default constructor

Open robinchrist opened this issue 6 years ago • 2 comments

Hi,

Due to the following line: T *new_data = new T[count]; in the AsyncProgress(Queue)Worker class T (your progress class) is required to have a default constructor.

I have prepared a patch which makes use of C++17 (std::aligned_alloc and std::uninitialized_copy) features and removes the necessity of the progress struct having a default constructor.

Should I wrap the patch in a feature guard (__cplusplus macro check) and file a merge request?

robinchrist avatar Nov 08 '19 11:11 robinchrist

@bnoordhuis Any opinion on this?

kkoopa avatar Nov 12 '19 13:11 kkoopa

If it is not much work for you, do file a PR. It would at least make it easier to evaluate its impact. The only possible problem I can imagine right now is a compiler which is marketed as supporting a particular C++ standard, but actually does not do so fully.

kkoopa avatar Nov 20 '19 19:11 kkoopa