gamesdk-and-dispatch
gamesdk-and-dispatch copied to clipboard
C++ discord::CreateFlags is unused
trafficstars
Describe the bug
A C++ enum named discord::CreateFlags exists, but cannot be used by the user because discord::Core::Create takes a std::uint64_t.
Steps to reproduce Try using the following code:
discord::Core *core{};
const auto result = discord::Core::Create(0, discord::CreateFlags::NoRequireDiscord, &core);
Expected behavior The code builds as expected.
Actual behavior
The code does not builds, and a message in the style of argument type "discord::CreateFlags" is incompatible with parameter of type "uint64_t" appears
Implementation specifics
- Language: C++
- Game Engine: No engine
Additional context
A potential resolution would be adding an overload of discord::Core::Create in the headers which forwards to the overload taking uint64_t, like so:
inline static Result Create(ClientId clientId, CreateFlags flags, Core** instance)
{
return Create(clientId, static_cast<std::uint64_t>(flags), instance);
}