This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: [RFC] libstdc++ atomicity, x86 agnostic version


Paolo Carlini <pcarlini@suse.de> writes:

| Benjamin Kosnik wrote:
| 
| >Using Jakub's test:
| >
| >#include <string>
| >
| >using namespace std;
| >
| >bool b = true;
| >const string s = "abc";
| >
| >void foo(string &x)
| >{ }
| >
| >int main (void)
| >{
| >  for (int i = 0; i < 10000000; ++i)
| >    {
| >      string t = s;
| >      foo(t);
| >    }
| >}
| >
| Well, it looks like part of the test is bogus (sorry Jakub!) since the
| argument x of foo is a reference and therefore no constructions and
| destructions take place...

Why not just ditch that ref from foo()?

-- Gaby


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