eidheim / tiny-process-library

A small platform independent library making it simple to create and stop new processes in C++, as well as writing to stdin and reading from stdout and stderr of a new process
MIT License
338 stars 73 forks source link

Replace arrays of variable length with dynamic memory #3

Closed dacap closed 8 years ago

dacap commented 8 years ago

Arrays of variable length aren't supported by MSVC compiler.

dacap commented 8 years ago

We could use a std::unique_ptr instead of std::auto_ptr, or even better, a std::vector.

eidheim commented 8 years ago

Great, thanks for testing this with MSVC. std::auto_ptr is deprecated if I'm not mistaken, but unique_ptr would work fine. Can use unique_ptr since vector would initialise the elements, and new [] would not I think.

dacap commented 8 years ago

There are other changes needed to support MSVC completely. But I'll create other PRs for that. I'll push/overwrite/fix the commit in this PR with a std::unique_ptr.