Tectu / malloy

A cross-platform C++20 library providing embeddable server & client components for HTTP and WebSocket.
BSD 3-Clause "New" or "Revised" License
66 stars 8 forks source link

Type aliases for websocket::connection #34

Closed Tectu closed 3 years ago

Tectu commented 3 years ago

Personally I don't like to see code like this in an application / outside of a library:

class my_app
{
private:
    malloy::websocket::connection<false> m_ws;
};

It is not immediately clear what this boolean template parameter does without further investigation (or simply knowing it).

I would vote for adding type aliases for client & server connections which are defined as connection<true> and connection<false> respectively.

@0x00002a any thoughts?

0x00002a commented 3 years ago

@Tectu https://github.com/Tectu/malloy/blob/9eecc9cc9da9ca22d28323fcaec832df9a974ac0/lib/malloy/server/websocket/connection/connection.hpp#L19?

Tectu commented 3 years ago

🤦 Don't hate me 😋