473,320 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

FAQ lite:10.19, Bar() part is declaring a non-member function that returns a Bar object

Hi all,
I dont' understand the statement in 10.19 of C++ FAQ lite,
I have never seen a function can be declared as Bar(),

according to my experience, all functions are declared in form of

return_type func_name(parametes_list);

if Bar is the return type, where is the func_name?
or if Bar is the func_name, where is the return_type as the Author
says it's non member of function, it should have a return_type because
non-member function should not be ctor/dtor witouth return_type.

please help me understand the statement. thanks in advance.

Mar 15 '07 #1
2 1388
* Bi**********@gmail.com:
Hi all,
I dont' understand the statement in 10.19 of C++ FAQ lite,
I have never seen a function can be declared as Bar(),

according to my experience, all functions are declared in form of

return_type func_name(parametes_list);

if Bar is the return type, where is the func_name?
None needed as a formal argument.

Compare:

void foo( int ); // No argument name.
void foo2( int x ); // With dummy argument name.
void goo( Bar() ); // No argument name.
void goo2( Bar x() ); // With dummy argument name.

The latter is equivalent to

void goo2( Bar (*x)() );

which means x is pointer to a function taking no arguments and returning
a Bar.

Which in turn is equivalent to (by removing the unnecessary argument name)

void goo2( Bar(*x)() );

Now peruse your compiler's standard library headers for the definition
of 'signal'...

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Mar 15 '07 #2
On Mar 15, 1:27 pm, "Alf P. Steinbach" <a...@start.nowrote:
* Biermann....@gmail.com:
Hi all,
I dont' understand the statement in 10.19 of C++ FAQ lite,
I have never seen a function can be declared as Bar(),
according to my experience, all functions are declared in form of
return_type func_name(parametes_list);
if Bar is the return type, where is the func_name?

None needed as a formal argument.

Compare:

void foo( int ); // No argument name.
void foo2( int x ); // With dummy argument name.
void goo( Bar() ); // No argument name.
void goo2( Bar x() ); // With dummy argument name.

The latter is equivalent to

void goo2( Bar (*x)() );

which means x is pointer to a function taking no arguments and returning
a Bar.

Which in turn is equivalent to (by removing the unnecessary argument name)

void goo2( Bar(*x)() );

Now peruse your compiler's standard library headers for the definition
of 'signal'...
thanks, ic now, it is the rule the argument can be omitted applied on
an argument of function pointer.
>
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Mar 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rick Thomas | last post by:
http://wingide.com/wingide
1
by: Zev Steinhardt | last post by:
I'm trying to use Mime::Lite to send out multipart messages. So far, it all seems to work well except for one small part. I want to display a "real name" along with the email address when I...
1
by: jel | last post by:
I ran what was submitted in several forums, but it's not exactly what i'm looking for. I'm dy'n over here. Ah, the frustrations of an amateur programmer. I included the code below in c++. which...
2
by: Nishant | last post by:
I have a combo box with a horizontal scroll bar. (Used SetHorizontalExtent) The dropdown with horizontal scroll bar works fine when I have more items in the dropdown list. However when the...
0
by: Thomasb | last post by:
Hi! Has anyone managed to install DB2 Runtime Client Lite (part of Stinger)? I have tried on different machines with diffrent versions of Windows and it always ends up with "The DB2 Setyp...
22
by: Profetas | last post by:
Hi I am starting a project in C. And I would like to hear from you the 10 most used c library. just say the ones that pop up in your head. Thanks
5
by: param | last post by:
Declaring struct as static is creating problem with newer version of CC compiler 5.7 in solaris. e.g. static struct new_str { int a; int b; };
0
by: fiona | last post by:
Innovasys Ltd., a leader in help authoring and documentation tools, today announced the inclusion of a tailored version of the Innovasys HelpStudio help authoring product, HelpStudio Lite, in the...
2
by: furrypop | last post by:
Hi, I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4. Apache is definitely serving CGI scripts, as I've tested a dummy Hello World thing. I'm also...
5
by: xmaverick | last post by:
Hello, I'm a newbie to perl and i'd like some assistance trying to figure out how to send an attachment using MIME::Lite. I have searched the net far and wide and have used and modify different...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.