Description:
Discussion about C++ language, library, standards. (Moderated)
|
|
|
N3000 Defect - inconsistent return values for forward_list::insert_after
|
| |
After applying LDR#149, forward_list now has 5 overloads of insert_after, all returning an iterator. However, two of those - inserting a single object - return "An iterator pointing to a copy of x [the inserted object]" while the other three - inserting zero or more objects - return an iterator equivalent to the position parameter, pointing before any possibly... more »
|
|
My take at a byte literal user-defined operator
|
| |
Is the following well-formed? Valid? ...does it do what I want? :-) template <unsigned... Bits> struct byte_literal; template <unsigned... Bits> unsigned operator "" _byte () { return byte_literal<Bits...>::value() ; } template <unsigned Bit> struct byte_literal<Bit>... more »
|
|
std::atomic_bool vs. std::atomic<bool>
|
| |
These types seem to have almost identical interfaces. The only difference I see (in terms of functions that may be called -- I didn't check the semantics of the functions) is that std::atomic<bool> offers bool operator=(bool); and std::atomic_bool does not. (It almost offers that function, but it's volatile-qualified.)... more »
|
|
BoostCon 2010: 2nd Call for Participation
|
| |
Please distribute! ------------------------------ -- 4th Annual Boost Conference 2010 ------------------------------ -- Aspen CO, USA, May 4-10, 2010, [link] 2nd Call for participation ---------------------- We invite you to submit session proposals to the 4th Annual Boost Conference: BoostCon 2010 (Aspen CO, USA, May 10-14, 2010).... more »
|
|
Suffix Return Type Syntax.
|
| |
Hi. Given the below, to sum all arguments passed, 1. What should be coded in place of the "/*What goes here*/" part? 2. How can I modify this to use std::plus<>() instead? template<class T1, class T2> []sum(const T1& t1, const T2& t2)->decltype(t1 + t2){ return t1 + t2; ...template<class T1, class T2, class... T3> []sum(const T1& t1, const... more »
|
|
Circumventing the restrictions of "protected" via pointers to members (DR?)
|
| |
C++03 defines "protected" accessibility for members in 11.5 [class.protected]/1 thus: "Except when forming a pointer to member (5.3.1), the access must be through a pointer to, reference to, or object of the derived class itself (or any class derived from that class) (5.2.5). If the access is to form a pointer to member, the nested-name-specifier shall name... more »
|
|
Standard citation difficulties for enum declarations and definitions.
|
| |
Pardon the difficulty in reading what should be in front of my face. C ++0X refers to the n3000 draft for the rest of this post. 1) forward-declaration of enumerations, e.g. enum test; C++0X n3000 appears to allow forward declarations (as an opaque enum- declaration; dcl.enum p3, in spite of dcl.enum p4) C99 6.7.2.3p2... more »
|
|
Library Issue #180 - what is so special about basic_string::replace
|
| |
The insert() and erase() members of basic_string were changed from taking iterators to taking const_iterators. However, the replace members were not. Library issue #180 says: "We did not make the change in replace, because this change would affect the implementation because the string may be written into. This... more »
|
|
N3000 unclear about basic_string::assign members
|
| |
The container requirements in clause 23.2.1 [container.requirements.genera l] states that a containers allocator can be replaced by copy assignment and move assignment, depending on iterator_traits. For basic_string we also have assign(const basic_string& str) and assign(basic_string&& str) member functions (21.4.6.3... more »
|
|
|