While looking into #2481 I noticed this pattern:
const uint8_t* bytes_array = reinterpret_cast<const uint8_t*>(input);
auto buffer = std::make_shared<Buffer>(bytes_array, sizeof(float)*input_length);
It's not the end of the world but seems a little verbose to me. It would be great to have something like this:
auto buffer = MakeBuffer<float>(input, input_length);
I couldn't find it, does it already exist somewhere? Any thoughts on the API? Potentially specializations to make a buffer out of a std::vector would also be helpful.
Reporter: Philipp Moritz / @pcmoritz
Assignee: Wes McKinney / @wesm
PRs and other links:
Note: This issue was originally created as ARROW-3157. Please see the migration documentation for further details.
While looking into #2481 I noticed this pattern:
It's not the end of the world but seems a little verbose to me. It would be great to have something like this:
I couldn't find it, does it already exist somewhere? Any thoughts on the API? Potentially specializations to make a buffer out of a std::vector would also be helpful.
Reporter: Philipp Moritz / @pcmoritz
Assignee: Wes McKinney / @wesm
PRs and other links:
Note: This issue was originally created as ARROW-3157. Please see the migration documentation for further details.