From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a02:6307:: with SMTP id j7mr32057542jac.65.1559838760867; Thu, 06 Jun 2019 09:32:40 -0700 (PDT) X-Received: by 2002:a9d:7741:: with SMTP id t1mr6873633otl.178.1559838760592; Thu, 06 Jun 2019 09:32:40 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.215.MISMATCH!s188no59953itb.0!news-out.google.com!l135ni194itc.0!nntp.google.com!s188no59951itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 6 Jun 2019 09:32:40 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=208.114.128.53; posting-account=MRPdDAoAAADUJmZVjnYaoafXFMadSeY1 NNTP-Posting-Host: 208.114.128.53 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: C++ diaries... From: Olivier Henley Injection-Date: Thu, 06 Jun 2019 16:32:40 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56499 Date: 2019-06-06T09:32:40-07:00 List-Id: I have to share to stay healthy ... I probably came across this one already= but my brain just shuts off some times over this kind of well ... absurdit= y ... for the lack of a better word. :) In C++: namespace Whatever { enum SocketType {Stream, DGram, Raw}; enum ProtocolType {IP, IPV6, Raw}; } Will not compile and give you this:=20 Error C2365 'Whatever::ProtocolType::Raw': redefinition; previous definitio= n was 'enumerator'.=20 Now a small search on SO gives: "You cannot have equal names in old c-style enums. If you have C++11 - you = can use enum class, static constants in classes, different namespaces, or y= ou can simply use different names." =F0=9F=A4=A6 Looks like I have to use the new, third or fourth or fifth or ..., handle "= from the water tap to not get sulfuric acid"*. Olivier p.s: I was so amazed, I triple checked, it works properly in Ada. *(copyright by Dmitry Kazakov and reproduced with no permission)