473,386 Members | 1,803 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,386 software developers and data experts.

mem_fun_ref: parens in reference of function

Hello

mem_fun_ref(&(std::list<int>::size))

is compiled as valid by gcc 3.3.4 and causes an error ("defined-id
needed") with gcc 4.0.2. The later requires

mem_fun_ref(&std::list<int>::size)

Is there a some subtle issue that the compiler has to comply with when
it refuses the parens? Or is this a compiler bug?

Thanks

Feb 3 '06 #1
2 1385
ti*****@gmail.com wrote:
mem_fun_ref(&(std::list<int>::size))

is compiled as valid by gcc 3.3.4 and causes an error ("defined-id
needed") with gcc 4.0.2. The later requires

mem_fun_ref(&std::list<int>::size)

Is there a some subtle issue that the compiler has to comply with when
it refuses the parens? Or is this a compiler bug?


Comeau agrees with gcc 4.0.2, so it seems likely that 4.0.2 is correct.

Best regards,

Tom

Feb 3 '06 #2
ICC 8.1 accepts the first form no problem :-|

Feb 3 '06 #3

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

Similar topics

12
by: Stephen Ferg | last post by:
I've just spent several very frustrating hours tracking down a bug in one of my programs. The problem was that I was writing text to a file, and when I was done I coded f.close when I should...
8
by: felciano | last post by:
Hi -- I am trying to use the csv module to parse a column of values containing comma-delimited values with unusual escaping: AAA, BBB, CCC (some text, right here), DDD I want this to come...
2
by: Anders | last post by:
Hello. If I was to call a method of class T, M for each element in a collection, I'd do it like this: vector<int> vec; .... for_each(vec.begin(), vec.end(), mem_fun_ref(&T::M)); Okay, I can...
13
by: Ioannis Vranos | last post by:
What is the exact difference between mem_fun and mem_fun_ref, since in all examples I looked at, they are used in exactly the same way? -- Ioannis Vranos http://www23.brinkster.com/noicys
4
by: dzikus | last post by:
Why the following code does not compile? If I change the function argument to value (not reference) everything is ok. Is it possible to modify such code that it will compile with reference argument...
4
by: ShaneG | last post by:
We have ptr_fun to handle functions, mem_fun to handle member functions that will be called through a pointer, and mem_fun_ref to handle member functions that will be called through a reference. ...
7
by: red floyd | last post by:
Given class C { int m; public: int& func() { return m; } // other elements redacted for brevity }; Other than the fact that functions that return a handle are bad, is
3
by: Peter Michaux | last post by:
Hi, In the following string I would like to find the word that comes after "test" as long as test is not inside parenthesis. In this example the match would be "two". "the (test one) test...
1
by: puzzlecracker | last post by:
Why do we need mem_fun_ref when we use bind1st or bind2nd functors?? or even without binders as in example below: for_each( v2.begin( ), v2.end( ), mem_fun_ref ( &NumVals::display ) ); cout...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.