
David Abrahams <dave@boost-consulting.com> writes:
"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
"David Abrahams" <dave@boost-consulting.com> wrote
Okay, how about the one enclosed here, then?
Now you have both size() and size_<> instantiated LIMIT_SIZE times ;-)
According to Eric, you need something like size_<> to workaround vc++ bugs, though.
Not if the expression is simplified. It's really multiple calls to sizeof what drives the compiler crazy.
Okay, let me try one more. I think this one gets close to the minimal number of instantiations required to work around VC++ bugs.
Still, select<> is instantiated LIMIT_SIZE times...
Yes, but not LIMIT_SIZE * N, where N is the number of different types passed to BOOST_TYPEOF. So it's a one-time cost, which is better than what I posted earlier.
Hmm, I'm no longer certain of that. It's at least LIMIT_SIZE * M, where M is the number of distinct result types of size(). -- Dave Abrahams Boost Consulting www.boost-consulting.com