delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/19/15:16:31

From: "Tom Leete" <tleete AT access DOT mountain DOT net>
Newsgroups: comp.os.msdos.djgpp
References: <35b19846 DOT 0 AT news DOT mountain DOT net>
Subject: Aha, sheer boneheadedness
Date: Sun, 19 Jul 1998 15:00:22 -0400
Lines: 28
NNTP-Posting-Host: 198.77.57.131
Message-ID: <35b24211.0@news.mountain.net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I  wrote in message <35b19846 DOT 0 AT news DOT mountain DOT net>...
>    Hi, if I'm being boneheaded about something please hurry to tell me.
>Aren't enums supposed to be distinct types, with their element names
>overloaded?
>
...etc.

Rest and reflection tell me I was applying the C++ change for struct to
enum. What i was trying to do should look more like this:

struct definiteAnswer{
    enum dA{no,yes};
    dA answer;
};

struct anyAnswer{
    enum aA{no,yes,maybe};
    aA answer;
};

...and so on.

Boneheadedness is easier to fix than bugs ;)
--TML--



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019