열거 자에 문제가 있습니다. 누군가의 시간을 낭비하지 말고 바로 잡으자. 오류 :재정의 및 열거 자
1> forgelib\include\forge\socket.h(79): error C2365: 'RAW' : redefinition; previous definition was 'enumerator'
1> forgelib\include\forge\socket.h(66) : see declaration of 'RAW'
코드 : 무엇 제공
namespace Forge {
enum SocketType {
STREAM = SOCK_STREAM, // Sequenced, reliable, 2-way
DGRAM = SOCK_DGRAM, // Connectionless, unreliable
RAW = SOCK_RAW, // Raw protocol
RDM = SOCK_RDM, // Reliable-delivered message
SEQPACKET = SOCK_SEQPACKET // Sequenced, reliable, 2-way
};
enum ProtocolType {
IP = IPPROTO_IP, // IPv4
ICMP = IPPROTO_ICMP, // Internet Control Messsage Protocol
IGMP = IPPROTO_IGMP, // Internet Group Management Protocol
GGP = IPPROTO_GGP, // Gateway to Gateway Protocol
TCP = IPPROTO_TCP, // Transmission Control Protocol
PUP = IPPROTO_PUP, // PARC Universal Packet Protocol
UDP = IPPROTO_UDP, // User Datagram Protocol
IDP = IPPROTO_IDP, // Xerox NS Protocol
RAW = IPPROTO_RAW, // Raw IP Packets
IPV6 = IPPROTO_IPV6 // IPv6
};
}
?
그래서 나는 그들이 다른 열거에서 임에도 불구하고 그 중 하나의 이름을 바꿀 수 있나요? 얼마나 어리석은가. 어리석은 언어. 고맙습니다. –
아니요, 이름을 변경할 필요가 없습니다. 해결책은 그의 답변에있다. – Wilbert
@JesseBrands : 언어가 당신의 구조를 받아 들일 것이라고 상상해보십시오. int x = RAW; – PlasmaHH