Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let the compiler determine char signedness #454

Merged
merged 3 commits into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions src/stdgpu/limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ struct numeric_limits<char>
* \brief Whether the type is signed
* \note implementation-defined
*/
static constexpr bool is_signed = true;
static constexpr bool is_signed = (static_cast<char>(-1) < 0);

/**
* \brief Whether the type is an integer
Expand Down Expand Up @@ -490,16 +490,12 @@ struct numeric_limits<wchar_t>
*/
static constexpr bool is_specialized = true;

/**
* \var is_signed
* \brief Whether the type is signed
* \note implementation-defined
*/
#if STDGPU_HOST_COMPILER == STDGPU_HOST_COMPILER_MSVC
static constexpr bool is_signed = false;
#else
static constexpr bool is_signed = true;
#endif
/**
* \var is_signed
* \brief Whether the type is signed
* \note implementation-defined
*/
static constexpr bool is_signed = (static_cast<wchar_t>(-1) < 0);

/**
* \brief Whether the type is an integer
Expand Down