From df5291d097abce338870864efd9af6591a2f69d2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 24 Feb 2023 11:30:22 +0100 Subject: editor/inspect: move out of arg passed by value --- editor/inspect.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'editor') diff --git a/editor/inspect.hpp b/editor/inspect.hpp index 7edfd6d1..a6da98b7 100644 --- a/editor/inspect.hpp +++ b/editor/inspect.hpp @@ -7,9 +7,9 @@ struct erased_accessor; template struct field_repr_ final { - field_repr_(T x) : value{x} {} + field_repr_(T x) : value{std::move(x)} {} field_repr_(const field_repr_& other) noexcept = default; - field_repr_& operator=(T x) noexcept { value = x; return *this; } + field_repr_& operator=(T x) noexcept { value = std::move(x); return *this; } field_repr_& operator=(const field_repr_& x) noexcept = default; field_repr_& operator*() const noexcept { return value; } operator T() const noexcept { return value; } -- cgit v1.2.3