Update window.h

Add a Cpp20 Concept to constrain the Window Constructor parameter
This commit is contained in:
McMassiveNZ
2023-07-03 23:04:46 +02:00
parent c6548c341d
commit 3d42a469c9

View File

@@ -14,10 +14,16 @@ struct WindowCreateParams
const char* name;
};
template< typename T >
concept IsWindow = requires(T t) {
PumpMessages(t);
ShouldClose(t);
};
class Window
{
public:
template<typename T>
template<IsWindow T>
Window(T t)
: self{std::make_unique<model_t<T>>(std::move(t))}
{