catchorg / catchorg/Catch2

Add 'long double' template specializations

Open
#1,731 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

**Description**
It would be interesting to have `long double` templated functions' specializations. `long double` is most notably used with user-defined literals, and this forces to "downscale" the type to double.

As an example, having a custom templated matcher on floating point types, I can't directly set precision when used with `long double` parameters:

```cpp
Matcher() { Catch::StringMaker::precision = std::numeric_limits::digits10 + 1; }

/*
error: 'precision' is not a member of 'Catch::StringMaker'
Matcher() { Catch::StringMaker::precision = std::numeric_limits::digits10 + 1; }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
```

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.