On 10/19/2013 07:51 PM, Tim Shen wrote:
On Sat, Oct 19, 2013 at 4:03 AM, Paolo Carlini <paolo.carl...@oracle.com> wrote:
About the < 2, in general hardcoding a parameter value in the code isn't a
nice idea. Why don't we take it out to a macro, say
_GLIBCXX_REGEX_NFA_QUANTIFIERS_LIMIT? In stl_deque.h we have something
similar and in the present case it would be even safe from the ABI point of
view, if I'm not mistaken.
I here use a const static local variable to hide it from other parts.
Yes, but giving it a name doesn't buy us much wrt the issue I pointed out. For comparison, in similar cases, the compiler driver has --params which the user can fine tune on the command line. The best approximation we have got in the library - for the time being at least, in principle the driver could also forward parameters to the library - is a macro, which is defined and documented in a comment a few lines earlier and then is possibly used to initialize a const static. Again, see the stl_deque.h example. I can't imagine any other simple (and conforming! eg, no additional template parms) solution.

Thanks,
Paolo.

Reply via email to