[Issue 18036] New: Documentation of moveFront() fails to mention different behavior depending on hasElaborateCopyConstructor
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Dec 5 19:47:05 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=18036
Issue ID: 18036
Summary: Documentation of moveFront() fails to mention
different behavior depending on
hasElaborateCopyConstructor
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dlang.org
Assignee: nobody at puremagic.com
Reporter: acehreli at yahoo.com
The source code uses hasElaborateCopyConstructor:
ElementType!R moveFront(R)(R r)
{
static if (is(typeof(&r.moveFront)))
{
return r.moveFront();
}
else static if (!hasElaborateCopyConstructor!(ElementType!R))
{
return r.front;
}
else static if (is(typeof(&(r.front())) == ElementType!R*))
{
import std.algorithm.mutation : move;
return move(r.front);
}
else
{
static assert(0,
"Cannot move front of a range with a postblit and an rvalue
front.");
}
}
but the documentation ignores that fact.
Ali
--
More information about the Digitalmars-d-bugs
mailing list