mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 23:20:29 +03:00
Remove pointsTo in move
as well as remove erroneous documentation.
This commit is contained in:
parent
782441ee1d
commit
4e4f73b646
1 changed files with 1 additions and 10 deletions
|
@ -1859,21 +1859,12 @@ private struct FilterBidiResult(alias pred, Range)
|
||||||
// move
|
// move
|
||||||
/**
|
/**
|
||||||
Moves $(D source) into $(D target) via a destructive
|
Moves $(D source) into $(D target) via a destructive
|
||||||
copy. Specifically: $(UL $(LI If $(D hasAliasing!T) is true (see
|
copy.
|
||||||
$(XREF traits, hasAliasing)), then the representation of $(D source)
|
|
||||||
is bitwise copied into $(D target) and then $(D source = T.init) is
|
|
||||||
evaluated.) $(LI Otherwise, $(D target = source) is evaluated.)) See
|
|
||||||
also $(XREF exception, pointsTo).
|
|
||||||
|
|
||||||
Preconditions:
|
|
||||||
$(D &source == &target || !pointsTo(source, source))
|
|
||||||
*/
|
*/
|
||||||
void move(T)(ref T source, ref T target)
|
void move(T)(ref T source, ref T target)
|
||||||
{
|
{
|
||||||
import core.stdc.string : memcpy;
|
import core.stdc.string : memcpy;
|
||||||
import std.exception : pointsTo;
|
|
||||||
|
|
||||||
assert(!pointsTo(source, source));
|
|
||||||
static if (is(T == struct))
|
static if (is(T == struct))
|
||||||
{
|
{
|
||||||
if (&source == &target) return;
|
if (&source == &target) return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue