mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 14:40:30 +03:00
Issue 5193 - SList cannot have struct elements that have immutable members.
This commit is contained in:
parent
beaf8114b0
commit
fd3184f88a
1 changed files with 22 additions and 6 deletions
|
@ -947,10 +947,13 @@ Defines the container's primary range, which embodies a forward range.
|
|||
/// ditto
|
||||
@property T front() { return _head._payload; }
|
||||
/// ditto
|
||||
@property void front(T value)
|
||||
static if (isAssignable!(T, T))
|
||||
{
|
||||
enforce(_head);
|
||||
_head._payload = value;
|
||||
@property void front(T value)
|
||||
{
|
||||
enforce(_head);
|
||||
_head._payload = value;
|
||||
}
|
||||
}
|
||||
/// ditto
|
||||
void popFront()
|
||||
|
@ -1025,10 +1028,13 @@ Forward to $(D opSlice().front(value)).
|
|||
|
||||
Complexity: $(BIGOH 1)
|
||||
*/
|
||||
@property void front(T value)
|
||||
static if (isAssignable!(T, T))
|
||||
{
|
||||
enforce(_root);
|
||||
_root._payload = value;
|
||||
@property void front(T value)
|
||||
{
|
||||
enforce(_root);
|
||||
_root._payload = value;
|
||||
}
|
||||
}
|
||||
|
||||
unittest
|
||||
|
@ -1441,6 +1447,16 @@ unittest
|
|||
auto s = make!(SList!int)(1, 2, 3);
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
// 5193
|
||||
static struct Data
|
||||
{
|
||||
const int val;
|
||||
}
|
||||
SList!Data list;
|
||||
}
|
||||
|
||||
/**
|
||||
Array type with deterministic control of memory. The memory allocated
|
||||
for the array is reclaimed as soon as possible; there is no reliance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue