This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/24803] tr1::reference_wrapper and pointers to member functions

------- Comment #5 from hhinnant at apple dot com  2005-11-12 19:02 -------
>   (1) Strong-arm a C++ front-end guru into implementing rvalue references,
>       then use them in the TR1 function objects. Heck, we'll need 'em
>       for C++0x anyway :)

At the risk of being reckless.  Yes...  well, more like YES!!!  ;-)

I know very little about gcc at this point.  But if the feature is implemented
under a pragma (say rvalue_refs), default off, and if library code can test the
pragma (at the preprocessor level), then we could really move forward (let the
puns lie where they may).  N1855 went through core review in Mont Tremblant. 
There were several good suggestions on rewording the proposed words, but
absolutely nothing against the functionality or even the syntax.  That doesn't
mean the syntax is set in concrete.  But it does mean the mud is firming up. 
(I am guessing) It will take effort now for N1855 to not be accepted as is, or
pretty darn close to it.  The lwg also voiced no complaints and indeed strong
support for N1856 - N1862.  Almost irritation that I was taking up committee
time with this stuff again (just do it!).

If the language and library work goes under a pragma, default off, we can do
the following:

1.  Code like (for reference_wrapper):

#ifdef _GCC_MOVE
    operator()(T1&& t1) const {return (*data_)(std::forward<T1>(t1));}
    operator()(T1& t1) const {return (*data_)(t1);}

2.  When bug reports like this come in, say "try turning on rvalue reference"
(give instructions for doing that).

3.  If the syntax or functionality of the language changes, we are relatively
free to change the compiler/lib, documenting as appropriate, since this is not
default behavior, and should be documented as an extension - which could change
in the future.

4.  When it becomes standard, we set the pragma to default on.

Dealing with bugs like this via hacks is more work than doing it right with
rvalue reference.

So who are going to get?  I'd love to do it.  But I'm slightly worse than a
newbie in this area.  I could write language tests for it though.  I also
wouldn't mind following someone more experienced just for my own education.

How about Russell Yanofsky?

It would be best if one did not have to recompile libstdc++ when flipping this
pragma.  In order to achieve that you have to be committed to keeping as much
out of the binary lib as possible.  To date the direction of libstdc++ has been
just the opposite.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]