Inform compiler null vectors from a template class can be combined?
Jeffrey Walton
noloader@gmail.com
Mon Sep 28 20:54:00 GMT 2015
Hi Everyone,
I have a template class. The class has a static const data member
that's a effectively a string of 0's (a null vector). The length of
the vector depends on a template parameter T. Different T's will
produce different null vectors (that only differ by length).
I want to inform the compiler that it can use the largest vector it
produces for all of them.
Is it possible to inform GCC to do that? If so, how? Or is this a
common pattern, and I should go read on a subject? (If so, what is the
term I should search on)?
(The extra gyrations is a simple optimization to reduce memory and
cache pressures).
Thanks in advance.
More information about the Gcc-help
mailing list