aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-12-17 18:04:28 +0000
committerJonathan Wakely <jwakely@redhat.com>2022-01-05 13:47:01 +0000
commite09366718ad8c93678618a47016e18cb6e927131 (patch)
tree68ba1bd45d0963ee49e07fc2923d4d8b80f9ab45 /gcc
parent9a2451c1013c21e76da89df89c3c8e5e6afe6154 (diff)
downloadgcc-e09366718ad8c93678618a47016e18cb6e927131.zip
gcc-e09366718ad8c93678618a47016e18cb6e927131.tar.gz
gcc-e09366718ad8c93678618a47016e18cb6e927131.tar.bz2
libstdc++: Reduce template instantiations in <regex>
This moves the last two template parameters of __regex_algo_impl to be runtime function parameters instead, so that we don't need four different instantiations for the possible ways to call it. Most of the function (and what it instantiates) is the same in all cases, so making them compile-time choices doesn't really have much benefit. Use 'if constexpr' for conditions that check template parameters, so that when we do depend on a compile-time condition we only instantiate what we need to. libstdc++-v3/ChangeLog: * include/bits/regex.h (__regex_algo_impl): Change __policy and __match_mode template parameters to be function parameters. (regex_match, regex_search): Pass policy and match mode as function arguments. * include/bits/regex.tcc (__regex_algo_impl): Change template parameters to function parameters. * include/bits/regex_compiler.h (_RegexTranslatorBase): Use 'if constexpr' for conditions using template parameters. (_RegexTranslator): Likewise. * include/bits/regex_executor.tcc (_Executor::_M_handle_accept): Likewise. * testsuite/util/testsuite_regex.h (regex_match_debug) (regex_search_debug): Move template arguments to function arguments.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions