Using array.append(rvalue) will create a copy of rvalue rather than moving it. (original) (raw)

Skip to content

Sign in

Appearance settings

View all features

View all solutions

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Sign in

Sign up

Appearance settings

open-source-parsers / jsoncpp Public

Additional navigation options

New issue

New issue

Closed

Closed

Using array.append(rvalue) will create a copy of rvalue rather than moving it.

#677

@rosca

Description

@rosca

rosca

opened

on Sep 15, 2017

Value& Value::append(Value&& value) { return (*this)[size()] = value; }
should become
Value& Value::append(Value&& value) { return (*this)[size()] = std::move(value); }
in order to call the move constructor.

Metadata

Metadata

Assignees

No one assigned

Labels

No labels

No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions