typeof to decltype, typeof is not portable

master
Substitute 2 years ago
parent c544f574b3
commit 036b50b979
  1. BIN
      Project1
  2. 8
      libraries/user_input.h
  3. 1
      project/client.h

Binary file not shown.

@ -10,12 +10,12 @@ constexpr auto all = std::numeric_limits<std::streamsize>::max();
namespace math
{
template<auto lb, typeof(lb) ub> [[maybe_unused]]
constexpr auto is_between(typeof(lb) x) -> bool { return (ub > x) && (x > lb); }
template<auto lb, decltype(lb) ub> [[maybe_unused]]
constexpr auto is_between(decltype(lb) x) -> bool { return (ub > x) && (x > lb); }
template<auto lb> [[maybe_unused]]
constexpr auto is_larger(typeof(lb) x) -> bool { return (x > lb); }
constexpr auto is_larger(decltype(lb) x) -> bool { return (x > lb); }
template<auto ub> [[maybe_unused]]
constexpr auto is_smaller(typeof(ub) x) -> bool { return (ub > x); }
constexpr auto is_smaller(decltype(ub) x) -> bool { return (ub > x); }
template<typename T> [[maybe_unused]]
auto numerical_suffix(T value) -> std::string
{

@ -23,7 +23,6 @@ public:
explicit client() : networked(net::socket(AF_INET, SOCK_STREAM, 0)){}
auto connect(const std::string& ip, const port port) -> std::thread
{
const auto address = net::getaddrinfo(ip, std::to_string(port));
auto remote_address = net::getaddrinfo(ip, std::to_string(port));
if (!remote_address || net::connect(socket, remote_address) < 0)
return std::thread();

Loading…
Cancel
Save