c++ - Compiler optimization problem -
most of functions in <functional>
use functors. if write struct this:
struct test { bool operator() { //something } //no member variables };
is there perf hit? object of test
created? or can compiler optimize object away?
gcc @ least can optimize object creation , inline functor, can expect performance hand-crafted loop. of cource must compile -o2.
Comments
Post a Comment