I need to read some data from binary file, which i save the data pointer in a vector.
I want to handle them with best performance.
I have two design, please see this:
struct A {
int a, b,c;
}
void Handle(const A & a) {
// do something
}
void Handle(A * a) {
}
std::vector<A* > av; // this is read from file
for (int i = 0; i < 1000; ++i) {
// is there any difference between these two method? !!!!
// Handle(av[i]);
// Handle(*(av[i])) // does this create a temp variable which speed down the code?
}
I want to know is there any difference between them? and which is faster?