Raylib C++ Wrapper

#36
by needlesslygrim - opened

Question:

I have a function:
inline bool IsKeyDown(std::same_as auto... keys) { return (::IsKeyDown(KeyCodeToRaylibKey(keys)) || ...); }

It uses the concept std::same_as from the header file, part of the standard library. How do I convert it to not using the auto keywoard, and being something like this:
template <std::same_as T>
inline bool IsKeyDown(T... keys)

Answer:

I have a function:
   inline bool IsKeyDown(std::same_as auto... keys) { return (::IsKeyDown(KeyCodeToRaylibKey(keys)) || ...); }




It uses the concept std::same_as from the  header file, part of the standard library. How do I convert it to not using the auto keywoard, and being something like this:
template  T>
inline bool IsKeyDown(T... keys)
{
    for (auto i : { KeyCodeToRaylibKey(key)... })
        if (!::IsKeyDown(i));
            return false;


    // If we get here all were true so return that they are down!
    return true;
}




2019-07-31 - 5:46pm EST
"""

Sign up or log in to comment