boostorg / boostorg/xpressive

const data duplication in translation units

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
19
Forks
40
PR merge metrics
No merged PRs in 30d

Description

[SizeBench](https://www.microsoft.com/en-us/p/sizebench/9ndf4n1wg7d6) has identified that the following static variables are duplicated in every translation unit:
https://github.com/boostorg/xpressive/blob/master/include/boost/xpressive/detail/core/icase.hpp#L26
https://github.com/boostorg/xpressive/blob/master/include/boost/xpressive/detail/utility/sequence_stack.hpp#L25
https://github.com/boostorg/xpressive/blob/master/include/boost/xpressive/regex_primitives.hpp#L635
https://github.com/boostorg/xpressive/blob/master/include/boost/xpressive/regex_primitives.hpp#L243
https://github.com/boostorg/xpressive/blob/master/include/boost/xpressive/regex_primitives.hpp#L496
https://github.com/boostorg/xpressive/blob/master/include/boost/xpressive/regex_primitives.hpp#L404
etc

The proposed change using BOOST_INLINE_CONSTEXPR:
```
BOOST_INLINE_CONSTEXPR detail::modifier_op icase = {{}, regex_constants::icase_};
```

PR https://github.com/boostorg/xpressive/pull/21

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.