Created on 2009-07-18.00:00:00 last changed 130 months ago
Additional note (October, 2010):
The question should also be considered for parameter types; for example,
class comparable { public: bool is_equal(decltype(*this) other) { // should be X& return /*...*/; } };
(Moved from issue 760.)
Although it was considered and rejected as part of issue 643, more recent developments may argue in favor of allowing the use of this in a late-specified return type. In particular, declaring the return type for a forwarding function in a derived class template that invokes a member function of a dependent base class is difficult without this facility. For example:
template <typename T> struct derived: base<T> { auto invoke() -> decltype(this->base_func()) { return this->base_func(); } };
(See also issue 1207 for another potential motivation for a change to this rule.)
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | messages: + msg3309 |
2011-04-10 00:00:00 | admin | set | status: open -> fdis |
2010-10-18 00:00:00 | admin | set | messages: + msg3017 |
2009-07-18 00:00:00 | admin | create |