discord / gamesdk-and-dispatch

Public issue tracker for the Discord Game SDK and Dispatch
22 stars 7 forks source link

C++ discord::CreateFlags is unused #46

Open sylveon opened 4 years ago

sylveon commented 4 years ago

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

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);
}