digitalmars.D - _aApply.../opApply() return type: int or size_t?
- David Nadlinger (9/9) Apr 29 2011 [repost from dmd-internals]
- Walter Bright (2/6) Apr 30 2011 int
- Andrei Alexandrescu (3/12) Apr 30 2011 I think he was surprised that the current implementation returns size_t.
[repost from dmd-internals] What should the _aApply... runtime functions, or in general, opApply() return? According to the current runtime implementation and http://www.digitalmars.com/d/2.0/statement.html, the return type should be int, but DMD expects Type::tindex (i.e. size_t) in ForeachStatement::semantic(). This is relevant to LDC, where the type is reflected in the backend (well, LLVM IR). David
Apr 29 2011
On 4/29/2011 5:02 PM, David Nadlinger wrote:What should the _aApply... runtime functions, or in general, opApply() return? According to the current runtime implementation and http://www.digitalmars.com/d/2.0/statement.html, the return type should be int, but DMD expects Type::tindex (i.e. size_t) in ForeachStatement::semantic().int
Apr 30 2011
On 4/30/11 12:51 PM, Walter Bright wrote:On 4/29/2011 5:02 PM, David Nadlinger wrote:I think he was surprised that the current implementation returns size_t. AndreiWhat should the _aApply... runtime functions, or in general, opApply() return? According to the current runtime implementation and http://www.digitalmars.com/d/2.0/statement.html, the return type should be int, but DMD expects Type::tindex (i.e. size_t) in ForeachStatement::semantic().int
Apr 30 2011