[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (ARROW-3157) [C++] Improve buffer creation for typed data

Philipp Moritz created ARROW-3157:

             Summary: [C++] Improve buffer creation for typed data
                 Key: ARROW-3157
             Project: Apache Arrow
          Issue Type: Improvement
            Reporter: Philipp Moritz

While looking into [,] 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);{code}
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);{code}
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<T> would also be helpful.


This message was sent by Atlassian JIRA