为什么 std::errc 被识别为 error_condition 而 std::io_errc 和 std::future_errc 被识别为 error_code

问题描述

我刚刚注意到 unverifyed_clients = [] required_verification = "required_VERIFICATION" required_verification = required_verification.encode() serversocket = socket.socket(socket.AF_INET,socket.soCK_STREAM) serversocket.bind(('127.0.0.1',65535)) serversocket.listen(0) (client,address) = serversocket.accept() unverifyed_clients.append(client) print("A client has connected") while True: msg = client.recv(1024) msg.decode() msg = str(msg).replace("'b","").replace("'","") print("1:" + msg) if ("VERIFICATION:" in msg) and client in unverifyed_clients: msg.replace("VERIFICATION:","") if msg == verification_code: print(msg) unverifyed_clients.remove(client) print("1a") time.sleep(1) else: client.close() print("1b") elif client in unverifyed_clients and not "VERIFICATION:" in msg: client.send(required_verification) time.sleep(1) print(3) elif client not in unverifyed_clients and not ("VERIFICATION:" in msg): print("Brain: " + msg) print(4) else: print(5) 专门将 std::errc 识别为错误条件,而 is_error_condition_enum<>std::io_errc 则专门将 std::future_errc 识别为错误代码.

这是设计上的差异还是?

此外,is_error_code_enum<>便携式错误代码究竟是什么意思?因为 error_condition枚举值在 Linux 和 Windows 上肯定会有所不同。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)