Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #68779

Re: upper case enumerator

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c++
Subject Re: upper case enumerator
Date 2019-09-30 14:55 +0100
Organization A noiseless patient Spider
Message-ID <87tv8tq46r.fsf@bsb.me.uk> (permalink)
References <afea241c-fdd5-485d-89b2-22c402d7e3cb@googlegroups.com> <f500cfc3-2747-4d3b-8490-e09d89ff9f55@googlegroups.com> <qmr554$64j$4@dont-email.me> <gvdbhlFldqU7@mid.individual.net> <slrnqp3t17.cdo.grahn+nntp@frailea.sa.invalid>

Show all headers | View raw


Jorgen Grahn <grahn+nntp@snipabacken.se> writes:

> On Mon, 2019-09-30, Ian Collins wrote:
>> On 30/09/2019 09:45, Vir Campestris wrote:
>>> On 29/09/2019 01:10, Öö Tiib wrote:
>>>> On Saturday, 28 September 2019 05:37:42 UTC+3, Mark  wrote:
>>>>>
>>>>> # ifndef XXX_YYY
>>>>> # define XXX_YYY
>>>>
>>>> Be more explicit in include guard name about what it is.
>>>> Use XXX_YYY_HPP_INCLUDED and the trouble disappears.
>>>>
>>> Our coding standard says to use a sensible name - and then stick a
>>> random 8-digit hex value after it. It even tells you how to derive the 8
>>> digits if like most of us you are on Linux.
>>
>> Are there any mainstream compilers that don't support #pragma once?  It 
>> makes life much simpler.
>
> Life is already simple; I think this thread exaggerates the problem.
> In a header foo/bar.h in project someproj:
>
>   #ifndef SOMEPROJ_FOO_BAR_H
>
> The include guard will be unique (as an include guard) and very
> unlikely to clash with anything else.

A handy tip is to start with the H_:

  #ifndef H_SOMEPROJ_FOO_BAR

because SOMEPROJ might begin with E and, at least in C, macro names
beginning with E are reserved for future library versions.

-- 
Ben.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

upper case enumerator Mark <ma740988@gmail.com> - 2019-09-27 19:37 -0700
  Re: upper case enumerator Ian Collins <ian-news@hotmail.com> - 2019-09-28 14:43 +1200
  Re: upper case enumerator Louis Krupp <lkrupp@nospam.pssw.com.invalid> - 2019-09-27 23:48 -0600
  Re: upper case enumerator Bo Persson <bo@bo-persson.se> - 2019-09-28 10:06 +0200
  Re: upper case enumerator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-09-28 21:58 +0100
  Re: upper case enumerator Öö Tiib <ootiib@hot.ee> - 2019-09-28 17:10 -0700
    Re: upper case enumerator Vir Campestris <vir.campestris@invalid.invalid> - 2019-09-29 21:45 +0100
      Re: upper case enumerator Manfred <noname@add.invalid> - 2019-09-29 23:29 +0200
      Re: upper case enumerator Ian Collins <ian-news@hotmail.com> - 2019-09-30 16:36 +1300
        Re: upper case enumerator Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-09-30 12:25 +0000
          Re: upper case enumerator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-09-30 14:55 +0100
  Re: upper case enumerator James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-09-30 01:11 -0400
  Re: upper case enumerator Frederick Gotham <cauldwell.thomas@gmail.com> - 2019-09-30 01:34 -0700

csiph-web