z***@gmail.com
2017-12-11 16:43:13 UTC
I have raw buffer read from socket and I want to pass/add it to
kj::ArrayPtr<capnp::word>. Is there a simple way to do this (without
additional copies)?
I've tried answer to this (not the copying one) :
https://groups.google.com/forum/#!topic/capnproto/CIUxq-Y4128, with simple
code :
std::vector<unsigned char> bytes(1024);
kj::ArrayPtr<capnp::word> words(reinterpret_cast<const
capnp::byte*>(bytes.data()), bytes.size() / sizeof(capnp::word));
but it gives me
error: no matching function for call to
âkj::ArrayPtr<capnp::word>::ArrayPtr(const byte*, std::vector<unsigned
char>::size_type)â
and I'm kind of stuck.
kj::ArrayPtr<capnp::word>. Is there a simple way to do this (without
additional copies)?
I've tried answer to this (not the copying one) :
https://groups.google.com/forum/#!topic/capnproto/CIUxq-Y4128, with simple
code :
std::vector<unsigned char> bytes(1024);
kj::ArrayPtr<capnp::word> words(reinterpret_cast<const
capnp::byte*>(bytes.data()), bytes.size() / sizeof(capnp::word));
but it gives me
error: no matching function for call to
âkj::ArrayPtr<capnp::word>::ArrayPtr(const byte*, std::vector<unsigned
char>::size_type)â
and I'm kind of stuck.
--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.