[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_fi
From: |
Richard Wilbur |
Subject: |
Re: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2092-g36b1a2f |
Date: |
Sun, 1 Jun 2014 18:02:07 -0600 |
On Sat, May 31, 2014 at 5:02 PM, Bastiaan Jacques <address@hidden> wrote:
> diff --git a/libbase/tree.hh b/libbase/tree.hh
> index 74b44bb..86c294b 100644
> --- a/libbase/tree.hh
> +++ b/libbase/tree.hh
> @@ -43,7 +43,7 @@ template<class T>
> class tree_node_ { // size: 5*4=20 bytes (on 32 bit arch), can be reduced by
> 8.
> public:
> tree_node_();
> - tree_node_(const T&);
> + tree_node_(T );
>
> tree_node_<T> *parent;
> tree_node_<T> *first_child, *last_child;
> @@ -58,8 +58,8 @@ tree_node_<T>::tree_node_()
> }
>
> template<class T>
> -tree_node_<T>::tree_node_(const T& val)
> - : parent(nullptr), first_child(nullptr), last_child(nullptr),
> prev_sibling(nullptr), next_sibling(nullptr), data(val)
> +tree_node_<T>::tree_node_(const T val)
> + : parent(nullptr), first_child(nullptr), last_child(nullptr),
> prev_sibling(nullptr), next_sibling(nullptr), data(std::move(val))
> {
> }
>
In all the other cases, when you removed the reference, you also
removed the 'const' declaration. Here, in tree_node_<T>::tree_node_,
you left the 'const' declaration. Why?
I presume the main reason for not changing the other objects presently
passed by const reference is that they aren't movable?
Sincerely,
Richard
- Re: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2092-g36b1a2f,
Richard Wilbur <=