• Question: Why (void) in all C++ class functions that take no arguments?

    From marlow.andrew@gmail.com@21:1/5 to All on Tue Jan 17 01:28:30 2017
    Hello everyone,

    I was wondering why ACE uses "(void)" in class functions that take no arguments. I must admit that in the very early days of C++ I did this myself. My reasons where to do with header files that were shared between C and C++. Functions whose prototypes
    are in such headers have to use "(void)" because "()" has a different meaning in C. But surely this does not apply for class functions. After all if the function is in a class than it cannot be C so there cannot be any issue with "()" meaning "an
    unspecified argument list".

    Regards,

    Andrew Marlow
    http://www.andrewpetermarlow.co.uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Johnny Willemsen@21:1/5 to marlow...@gmail.com on Tue Jan 17 04:44:51 2017
    Hi,

    It are the style-guidelines from the past. In our TAOX11/AXCIOMA products we use () but for consistency in ACE/TAO we are using (void)

    Johnny


    On Tuesday, January 17, 2017 at 10:28:31 AM UTC+1, marlow...@gmail.com wrote:
    Hello everyone,

    I was wondering why ACE uses "(void)" in class functions that take no arguments. I must admit that in the very early days of C++ I did this myself. My reasons where to do with header files that were shared between C and C++. Functions whose prototypes
    are in such headers have to use "(void)" because "()" has a different meaning in C. But surely this does not apply for class functions. After all if the function is in a class than it cannot be C so there cannot be any issue with "()" meaning "an
    unspecified argument list".

    Regards,

    Andrew Marlow
    http://www.andrewpetermarlow.co.uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)