Skip to content

Add missing write(uint32_t)#261

Merged
kennykerr merged 2 commits into
microsoft:masterfrom
oldnewthing:write-uint32
Apr 2, 2019
Merged

Add missing write(uint32_t)#261
kennykerr merged 2 commits into
microsoft:masterfrom
oldnewthing:write-uint32

Conversation

@oldnewthing

Copy link
Copy Markdown
Member

This avoids an ambiguity between promotion to int64_t or uint64_t.

Sadly, we cannot just take all the arithmetic types with

template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
void write(T const& value)
{
   write(std::to_string(value));
}

because that conflicts with the template declaration for invocables.

This still doesn't cover ambiguity over smaller integral types like uint8_t, but whoever needs that can add it.

This avoids an ambiguity between promotion to int64_t
or uint64_t.

Sadly, we cannot just take all the arithmetic types with

```C++
template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
void write(T const& value)
{
   write(std::to_string(value));
}
```

because that conflicts with the template declaration for invocables.
@kennykerr kennykerr merged commit d25d502 into microsoft:master Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants