This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Resolved status.

### 2889. Mark `constexpr` global variables as `inline`

Section: 20 [utilities], 20.18 [execpol] Status: Resolved Submitter: Great Britain Opened: 2017-02-03 Last modified: 2017-03-20

Priority: Not Prioritized

View all other issues in [utilities].

View all issues with Resolved status.

Discussion:

Addresses GB 28

The C++ standard library provides many `constexpr` global variables. These all create the risk of ODR violations for innocent user code. This is especially bad for the new `ExecutionPolicy` algorithms, since their constants are always passed by reference, so any use of those algorithms from an inline function results in an ODR violation.

This can be avoided by marking the globals as `inline`.

Proposed change: Add `inline` specifier to: `bind` placeholders `_1, _2, ...`, `nullopt`, `piecewise_construct`, `allocator_arg`, `ignore`, `seq`, `par`, `par_unseq` in `<execution>`

[2017-02-03, Marshall notes]

See also FI 9 (LWG 2888).

[2017-02-25, Daniel comments]

There will be the paper p0607r0 provided for the Kona meeting that solves this issue.

[2017-03-12, post-Kona]

Resolved by p0607r0.

Proposed resolution: