Topic: Ref-qualifiers for all non-const member functions of atomic types?
Author: "Niels Dekker - no return address" <noreply@this.is.invalid>
Date: Fri, 19 Dec 2008 15:33:58 CST Raw View
>> Are those ref-qualifiers still to be added to the assignment
>> operators within the Library?
Daniel Kruegler wrote:
>
> One important use-case for ref-qualifications for basically
> all member functions seem to be all atomic types in the
> recent library draft. As of
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2514.html
> the section "Ambiguity and Insecurity" ends with the sentence:
> "In summary, atomic objects are only lvalues, never rvalues."
Thanks for your feedback, Daniel. A preliminary version of my issue
regarding ref-qualifiers for assignment operators is now at Howard
Hinnant's preview page:
http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#941
(Note: Howard's site has a new URL!) I'll add a proposed resolution
before the end of the year, listing all the relevant assignment
operators.
I didn't include your atomic-specific comment, because I think it
might be worth another issue... Basically you're saying that all
non-const member functions of an atomic type should have a
ref-qualifier (&), right? I'm not experienced with atomic types, so
maybe you can submit an LWG issue on that particular subject?
Especially, I wonder: is it okay to create an rvalue of an atomic
type? For example by static_cast<T&&>, or by std::move, or by directly
calling its default-constructor? Otherwise it might be preferable to
prevent the _creation_ of atomic rvalues, instead of preventing their
usage. What do you think?
Kind regards, Niels
--
Niels Dekker
http://www.xs4all.nl/~nd/dekkerware
Scientific programmer at LKEB, Leiden University Medical Center
--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]