🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Alex Vinokur Thu, 21 Oct 1999 00:00
__PRETTY_FUNCTION__ and getpid ()
#1
Author: Alex Vinokur
Date: Thu, 21 Oct 1999 00:00
67 lines
1981 bytes

Hi,

__PRETTY_FUNCTION__ shows not getpid() but getpid()()
  while using it as default-value.

Is that correct?

        Alex


//#########################################################
//------------------- C++ code : BEGIN -------------------

#include <unistd.h>
#include <iostream>

void foo (int pid_i = getpid ())
{
        cout << __PRETTY_FUNCTION__ << endl;
}

int main ()
{
        foo ();
        return 0;
}

//------------------- C++ code : END ----------------------



//#########################################################
//------------------- Running Results : BEGIN -------------

void foo(int = getpid()())
// WHY NOT void foo(int = getpid()) ?

//------------------- Running Results : END ---------------







//#########################################################
//------------------- Environment -------------------------

g++ -v     : gcc version egcs-2.91.57 19980901
             (egcs-1.1 release)

uname -sr  : SunOS 5.6

//---------------------------------------------------------



//#########################################################



Sent via Deja.com http://www.deja.com/
Before you buy.

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads