move assignment to rl::var content

77 views
Skip to first unread message

sgang...@gmail.com

unread,
Jul 5, 2019, 7:05:01 AM7/5/19
to Relacy Race Detector
Is it possible to move assign to rl::var?
e.g.
rl::var<std::unique_ptr<int>> = std::make_unique<int>(1)

or
rl::var<std::unique_ptr<int>> = std::move(another_uptr)


An attempt to do this resulted in
relacy/var.hpp: In instantiation of T rl::var_proxy<T>::operator=(T) [with T = std::unique_ptr<int, std::default_delete<int > >]’:
...
/home/samik/relacy/relacy/context.hpp:454:18:   required from here
/home/samik/relacy/relacy/var.hpp:100:9: error: use of deleted function std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = int; _Dp = std::default_delete<int >]’
         store
(value);

Samik

Dmitry Vyukov

unread,
Jul 5, 2019, 7:11:38 AM7/5/19
to Relacy Race Detector
On Fri, Jul 5, 2019 at 1:05 PM <sgang...@gmail.com> wrote:
>
> Is it possible to move assign to rl::var?

Hi Samik,

Since it fails to build, I guess you already know answer to your question ;)
Using raw pointers is known to work.

sgang...@gmail.com

unread,
Jul 5, 2019, 7:38:20 AM7/5/19
to Relacy Race Detector
Any chance of creating a rvalue overload for load/store?

Dmitry Vyukov

unread,
Jul 5, 2019, 7:41:30 AM7/5/19
to Relacy Race Detector
On Fri, Jul 5, 2019 at 1:38 PM <sgang...@gmail.com> wrote:
>
> Any chance of creating a rvalue overload for load/store?

At this point relacy is in weak maintenance mode on my side
(unfortunately). That's the reason for the move to github. If you want
to send a PR (with a test), that's welcome.
Reply all
Reply to author
Forward
0 new messages