move Questions
1
Solved
#include <iostream>
#include <thread>
template<int Num>
class MyClass {
public:
MyClass(int val) : val_(val) {}
// Copy constructor
MyClass(const MyClass& other) : val_(o...
Rase asked 26/4 at 8:35
6
Solved
When moving a file from old.package to new.package I want two things to happen:
Update all references to that class (in all files of the project) so that the new package is used
svn move old/pack...
7
Solved
I have a problem with my custom window (AllowTransparency, WindowStyle=None) in WPF. DragMove() method works good, but when I maximize window, or it maximizing automatically by Windows 7 Aero Snap,...
1
Solved
I'm reading Nicolai M. Josuttis's C++ Move Semantics - The Complete Guide book (which is pretty good imho) and I'm not sure I agree with the comments in one of the examples.
Quote (from 6.1.2 - Gua...
Outfight asked 16/8, 2023 at 18:16
1
Solved
Here is a C++ snippet. Func1 generates a shared object, which is directly moved into Func2. We think that there should not be overhead in Func3. Putting this snippet into Compiler Explorer, we see ...
Prospero asked 8/8, 2023 at 12:24
12
Solved
I want to move all text files from one folder to another folder using Python. I found this code:
import os, shutil, glob
dst = '/path/to/dir/Caches/com.apple.Safari/WebKitCache/Version\ 4/Blobs '...
2
I have the below Rust program.
fn main() {
let v = vec![100, 32, 57];
for i in v {
println!("{}", i);
}
println!("{:?}", v);
}
When I run it, I get:
error[E0382]: borrow of moved value: `...
1
My question is about the example in https://en.cppreference.com/w/cpp/memory/unique_ptr
struct List
{
struct Node
{
int data;
std::unique_ptr<Node> next;
};
std::unique_ptr<Node>...
Hedrick asked 8/4, 2023 at 9:45
14
Solved
How is it possible to move/rename a file/directory using an Ansible module on a remote system? I don't want to use the command/shell tasks and I don't want to copy the file from the local system to...
1
I just found out that the following code compiles in Rust 21 (used to not compile in 18)
fn get_func (i: &mut i32) -> impl Fn() -> i32 + '_ {
|| *i
}
Is there an implicit move of i inv...
3
This should work but doesn't and gives the following error (below).
I've read a couple of posts on stackoverflow here and here but there doesn't seem to be a good answer that works in this case. ...
1
Solved
Consider the following code. In order for this to compile, I HAVE to provide a body for the move constructor. Having "TestClass(TestClass&& other) = default" does not compile with...
Merman asked 16/12, 2022 at 16:8
1
After some effort, I convinced both the clang compiler and clang-tidy (static analyzer) to warn of a use-after-move situation. (see https://stackoverflow.com/a/74250567/225186)
int main(int, char**...
Occlusive asked 31/10, 2022 at 16:10
4
Solved
I have ownership of an array of size 3 and I would like to iterate on it, moving the elements out as I go. Basically, I would like to have IntoIterator implemented for a fixed-sized array.
Since a...
7
Solved
Let's say I've got the following files in a Google Cloud Storage bucket:
file_A1.csv
file_B2.csv
file_C3.csv
Now I want to move a subset of these files, lets say file_A1.csv and file_B2.csv. Cur...
Bison asked 29/4, 2015 at 13:50
2
Solved
The clang-tidy static analyzer detects uses of variables after being moved.
class a_class {
std::unique_ptr<int> p_;
public:
auto p() -> auto& {return p_;}
void f() const {}
};
in...
Raoul asked 30/10, 2022 at 0:39
4
Solved
I want to provide zero-copy, move based API. I want to move a string from thread A into thread B. Ideologically it seems that move shall be able to simply pass\move data from instance A into new in...
Privation asked 22/4, 2015 at 19:6
13
Solved
Here is my df:
Net Upper Lower Mid Zsore
Answer option
More than once a day 0% 0.22% -0.12% 2 65
Once a day 0% 0.32% -0.19% 3 45
Several times a week 2% 2.45% 1.10% 4 78
Once a week 1% 1.63% -0...
9
Solved
This is my updated and modified script, it works completely, except I would like to universalize it... observe the **** how can I make it so that I don't have to do function(e){BOX.Draggable.elemen...
Aksel asked 17/2, 2012 at 19:21
1
Solved
Is there an effective difference between std::move(*optional) and *std::move(optional)? Which one is preferable?
Full example:
#include <optional>
#include <vector>
void foo()
{
std::...
Bathhouse asked 2/5, 2022 at 15:8
16
Solved
1
Solved
For move construction:
After the move, other is guaranteed to be empty(). 1
For move assignment, the oft-quoted:
other is in a valid but unspecified state afterwards. 2
Why is the state of othe...
Verda asked 24/2, 2022 at 6:2
1
Is it possible to move n cells from one notebook to a new notebook?
Immensurable asked 23/2, 2022 at 10:38
0
So let's say i have interface:
class MyInterface
{
public:
virtual ~MyInterface() = default;
virtual void DoSomething(const MyType& a, const MyTypeB& b);
};
And the thing i want is to al...
4
Solved
I have a site on a domain, let's call it "mydomain.com", where people can log in.
This domain has a subdomain sub.mydomain.com.
When the user uploads a file on the main domain, I want to move it t...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.