GCC 4.7.2 overhead of auto lambda expression

Michael Powell mwpowellhtx@gmail.com
Thu May 9 13:08:00 GMT 2013


Hello,

It's been a little while, but I seem to recall that static variables
can be declared in the scope of a class instance method?

Next question, I am declaring a lambda function in the scope of a
method to leverage a read-from-channel-to-variable pattern: the read
is the same, agnostic to the channel and variable.

I am finding that this is somewhat slow, so a couple of thoughts are:
is the lambda even appropriate? I declare it as an auto for starters,
and it resolves every time the function happens.

Can that auto lambda variable be static? Or possibly, I don't think
the problem domain is that dynamic that a handful of helper member
functions wouldn't also do the same job, probably faster too without
the overhead of declaring the lambda autos.

Thoughts?

Thank you...

Regards,

Michael Powell



More information about the Gcc-help mailing list