G
Goran Pusic
Hi all!
Given:
std::vector<TYPE> v;
void process(size_t count, TYPE* data);
Is there any problem if I do
if (!v.empty())
{
std::vector<TYPE>::reference r = *v.begin();
// or
r = v[0];
// or
r = v.at(0);
process_raw(v.size(), &p);
}
?
(This is what I do all the time to interface with lower-level code,
but I've always been wondering if there's some issue in doing things
like these).
TIA,
Goran.
Given:
std::vector<TYPE> v;
void process(size_t count, TYPE* data);
Is there any problem if I do
if (!v.empty())
{
std::vector<TYPE>::reference r = *v.begin();
// or
r = v[0];
// or
r = v.at(0);
process_raw(v.size(), &p);
}
?
(This is what I do all the time to interface with lower-level code,
but I've always been wondering if there's some issue in doing things
like these).
TIA,
Goran.