0

Is my understanding correct about the efficiency of the two functions?

VectorXd v;

void Foo(const ArrayXd&);
void Boo(const Ref<const ArrayXd>&);

// a temporary is created?
Foo(v);
// no temporary is created?
Boo(v);

Also, I also see in eigen's doc some signature like Boo but without the &. Does it have any practical difference from Boo above?

bill
  • 650
  • 8
  • 17

1 Answers1

1

Yes your understanding is correct.

Regarding the signature of Boo see this answer.

ggael
  • 28,425
  • 2
  • 65
  • 71