Function Object inlining

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I was reading about the implementation of the Computational Geometry
and Algorithms Library (www.cgal.org) recently and one particular
thing struck me.  They mentioned things like

template<class T>
class Calc_something
{
  operator()(T &t1, T& t2) {...}

};


when used in a context like


...
Point p1(0, 0, 0);
Point p2(1, 0, 0)
Calc_something()(p1, p2);

are inlined in many cases by the compiler.  Is this the case?  Are
things like this fairly straightforward optimizations?  I don't really
know compiler design at all, so I was thinking worst case scenario
where an object is build and its method called.  I'm also curious what
generally happens when such objects have state stored in them?

thanks,
wes

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux