NVIDIA / NVIDIA/cccl

[FEA]: Expand `thrust::complex` to be usable at compile time

Open
#485 11 comments 0 reactions 0 assignees View on GitHub
good first issue help wanted thrust
Dominant language
C++
Stars
2.5k
Forks
487
Avg merge
2d 7h
Merged PRs (30d)
296

Description

### Is this a duplicate?

- [X] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this request and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)

### Area

Thrust

### Is your feature request related to a problem? Please describe.

With the rework of `thrust::complex` to be based upon `cuda::std::complex` we can leverage the later ones `constexpr` support

### Describe the solution you'd like

We should expand existing operators / methods with the appropriate constexpr qualifier.

This would also require us to rework the way we internally test `thrust::complex`

Usually if there was a `void test_something()` function previously one would split it up into a `constexpr bool test_something_impl()` and then use
```cpp
void test_something() {
test_something_impl();

#if TEST_STD_VER >= 14
static_assert(test_something_imple(), "");
#endif // TEST_STD_VER >= 14
}
```

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.