Questions tagged [move]

Usually refers to move semantics; consider using that tag instead. Move semantics is a programming language feature that allows a copy operation to be replaced by a more efficient "move" when the source object is a temporary or an otherwise expiring object.

move
Filter by
Sorted by
Tagged with
-2 votes
1 answer
54 views

Batch to read filenames from a file, move them to another dir and list in a text file any that failed

I have a directory of 15,000 images, but only use 1500. I used excel to creaet a list of commands to move each of the 1500 images used to a new folder. The problem is that only 1200 images were ...
Frank's user avatar
  • 15
2 votes
3 answers
232 views

Is value category of function returning by value is always xvalue?

As per my understanding below code should call move constructor of Test class since this function is returning by value which means expression GetTestObj() should be rvalue and xvalues are implicitly ...
PapaDiHatti's user avatar
  • 1,891
1 vote
1 answer
515 views

Why is the compiler trying to copy instead of moving the return value?

My code looks like // definition of class 'Foo' class Foo { private: vector<Bar> v; public: ... Foo(Foo&&) = default; // move constructor }; // definition of function '...
Remi.b's user avatar
  • 17.8k
2 votes
3 answers
404 views

Do move constructors need attribute that are moveable?

I am trying to wrap my head around move constructors and am hoping to get some more insights through this question. Here is a simple class. class A { private: vector<B> Bs; public: /* ...
Remi.b's user avatar
  • 17.8k
3 votes
1 answer
574 views

Why is this struct not moved after pattern matching?

Based on Preventing move semantics during pattern matching, my understanding is when I do a match on a struct, if not using a reference to do the match, the struct will be moved since it is not a ...
enaJ's user avatar
  • 1,605
5 votes
2 answers
1k views

Move a dynamically allocated variable into a vector

Given is the following C++ code: std::vector<int> myVec; int* num = new int(1); myVec.emplace_back(std::move(*num)); If a move a variable with dynamic storage duration into a container (e.g. a ...
user1056903's user avatar
2 votes
3 answers
2k views

Powershell recursively move 20,000 files at a time

I'm a novice with Powershell. I'm trying to move data to be processed elsewhere that has limitations on the number of files at a time it can handle. My source folder has hundreds of subfolders that ...
Dean Benson's user avatar
1 vote
1 answer
2k views

Move all files at one level up one level

I had a problem with a backup on a linux server that somehow moved all folders of files down one level into a new folder with the same name. I would like to return all files to their original ...
rabidfurball's user avatar
0 votes
2 answers
401 views

How can I pass a boxed member of a borrowed struct to a function without copying it?

In my example I get an error: cannot move out of borrowed content struct BigData {} struct Data { x: Box<BigData>, } fn calc_data(x: Box<BigData>) {} fn main() { let b = ...
user avatar
0 votes
1 answer
1k views

Warning: move_uploaded_file(); failed to open stream

I'm trying to upload image using move_uploaded_file(); $target_dir = "product_images/"; $target_file = $target_dir . basename($_FILES["product_image"]["name"]); if (move_uploaded_file($_FILES["...
Andrija Urosevic's user avatar
1 vote
1 answer
238 views

Distinguishing between mouseDrag and mouseMove in Eclipse Mars

Since I migrated on Mars the drag and drop functionality of my RCP app is not working anymore. After some debugging I found out a different behavior in Mars from Luna in this class org.eclipse.gef....
IoanaC's user avatar
  • 49
0 votes
0 answers
215 views

Sense and Move in 2D python 2.7

I am writing a code on Localization of robot in 2D but i am stuck with the movement logic. I understand the movement when the case is [1,0,0,1....] but i am not sure how to implement it when the ...
gopal joshi's user avatar
1 vote
3 answers
2k views

Pygame, move a square on the screen, but can not erase the previous movements

This is my first post in StackOverflow, hope you guys can help a newbie programmer. It's Pygame Python simple ask. I am trying to move a square on the screen, but can not erase the previous movements....
4ury0n's user avatar
  • 125
0 votes
1 answer
136 views

Applescript trouble with moving files in script

this is the script I'm trying to use: on open thisItem set this_folder to (the POSIX path of thisItem) set export_folder to "Macintosh HD:Users:j****.*******:Desktop:AUTOMATOR:export" set pdf_folder ...
Airgiraffe's user avatar
2 votes
0 answers
232 views

Python: Efficient way to move a huge list of data from one list to another

I'm using multiprocessing, and in a separate process (let's call it thread for clarity), I'm using PySerial to pull data from a device. In my program, I have a list that's shared with the main thread. ...
The Quantum Physicist's user avatar
0 votes
1 answer
975 views

Bash script to move folders based on filesize changes?

I have some automated downloads in a proprietary linux distro. They go to a temp scratch disk. I want to move them when they're finished to the main RAID array. The best way I can see to do this is to ...
Carver Stone's user avatar
1 vote
2 answers
185 views

Why are moves more expensive than passing by const&?

I'm passing a few objects into a constructor right before their lifetime ends. int main(){ //I wanted to avoid short string optimization in this example. const std::string a(25,"a"); ...
Trevor Hickey's user avatar
0 votes
0 answers
35 views

Measuring device moving degree with sensors

My problem is the onSensorChanged changing without any device moving. I read something about gravity forces and eliminated that but still onSensorChanged is calling too many times without the device ...
peyman's user avatar
  • 1
3 votes
1 answer
742 views

How to get a move-only type out of a STL container?

Let's consider an std::unordered_set of std::unique_ptr<T> as an example. Can I move an element of the set elsewhere ? #include <unordered_set> #include <iostream> #include <...
matovitch's user avatar
  • 1,264
0 votes
2 answers
4k views

Move an Object in the direction it is facing? C#

There are questions like this but I couldn't find any answers in C#, so here's my question: I want to rotate an object (in Unity 5) in the direction it's facing. I currently have this code to rotate ...
iFallOffStuff's user avatar
0 votes
0 answers
59 views

Why is std::move most efficient when parameter is passed by value?

I'm doing a Monte-Carlo simulation of a computer game which is basically the following: void simulate(Game game) { for (int i = 0; i < some_stuff) { Game game_copy = game; // change ...
Dmitri Nesteruk's user avatar
2 votes
1 answer
4k views

How to make an image move diagonally in pygame?

I've been taught how to move an image in pygame left, right, up and down. Our next task is to make the image move diagonally, but I don't understand how. This is my code so far: (sorry for the weird ...
j.ohni's user avatar
  • 21
1 vote
2 answers
97 views

Do implicit move methods always preserve fundamental data?

It's my understanding that when a basic data type is moved from, it will always perform a copy. For example, you can never move from an int, and have the original int value unspecified: #include &...
Trevor Hickey's user avatar
3 votes
3 answers
1k views

Moving the contents of one vector to another

So I have a vector: vector<Enemy*> enemies; This vector hold enemies, which are created dynamically throughout the game. if(rand() % 1000 > 998) { Enemy * enemy = new Enemy(num_of_enemies)...
Nick's user avatar
  • 57
0 votes
2 answers
91 views

Why not to copy a class consisting of a single shared_ptr

Recently, I read an article about lazy data structures in C++ (this question is not about lazy, or the particular data structure, though - it is just the motivation). A lazy stream (list) is ...
choeger's user avatar
  • 3,582
0 votes
1 answer
4k views

Linux find all files in sub directories and move them

I have a Linux-System where some users put files with ftp in a Directory. In this Directory there are sub-directories which the users can create. Now I need a script that searches for all files in ...
user avatar
1 vote
1 answer
34 views

Moving Directories

I have created a txt file with a list of directories I need to move to a new location. However there is a large number of directories, and trying to copy and paste just some will take forever. How ...
Leon Claassen's user avatar
3 votes
2 answers
183 views

Spamming std::move is the way to go?

About std::move, here is what I can interpret, according to http://en.cppreference.com/w/cpp/utility/move :- If I want to transfer ownership, I have to call std::move (or in rare case, std::forward)....
javaLover's user avatar
  • 6,377
2 votes
5 answers
2k views

Java - Move and Rename all files from one destination to another

I have files in one folder, i want to move them into the another folder but also and to rename them (with some static prefix value which should be added) I succeed to list all files from the source ...
Veljko's user avatar
  • 1,768
0 votes
2 answers
6k views

Batch to move folders that are 30 days old using FORFILES

I am currently working that moves ONLY folders from one directory to a folder. The current bacth file I have created is as follows. Set /p target=Select Target Destination: ForFiles /P "C:\Batch test"...
Brioroni's user avatar
18 votes
5 answers
15k views

How does returning std::make_unique<SubClass> work?

I have a base class and its subclass: class Base { public: virtual void hi() { cout << "hi" << endl; } }; class Derived : public Base { public: void hi() ...
MaxHeap's user avatar
  • 1,136
0 votes
1 answer
121 views

Correct parameter type for moving object into vector

Suppose I have an object that holds some data: struct Object { std::vector<float> data; } And a struct that holds some objects: struct Holder { private: std::vector<Object> ...
koolbanana's user avatar
13 votes
1 answer
2k views

std::map::insert change in C++17

I see that the insert method of std::map and std::unordered_map is going to change from template<class P> std::pair<iterator,bool> insert(P&& value); (C++11) to std::pair<...
AntiClimacus's user avatar
  • 1,410
1 vote
1 answer
203 views

Why when user provides move constructor or move assignment, copy constructor and copy assignment will be deleted?

I'm watching CppCon2014, Michael Caisse, The Canonical Class talk, at 28'31", he shows a diagram showing when user provided some copy control, how would the compiler implicitly provide or not provide ...
athos's user avatar
  • 6,260
1 vote
2 answers
1k views

Moving a class derived from istream

I'm creating a C++ istream with a custom streambuf. Trying to move this fails because the istream move constructor is protected. To get round this I derived a class from istream: struct VectorCharBuf ...
Mohan's user avatar
  • 8,031
2 votes
1 answer
715 views

Android: MotionEvent Need some clarification of GetHistoricalX and GetHistoricalY

In my application, I required to draw strokes to the view with touches. I would have to save a previous coordinated when touch down and touch move (after processed the touch move). When I looked at ...
LittleFunny's user avatar
  • 8,275
1 vote
1 answer
135 views

linux command to move part of string with non-printable character

I have binary log file with such similar lines which splitted by non-printable char "^A". I see this symbol backlit white when I open file with command "less" blah9234^Azzz123^A1=123 blah6344^...
Trav Erse's user avatar
  • 191
2 votes
1 answer
77 views

C++: Need I still care copy control if I don't use move?

Copy control seems is related to default constructor, copy constructor, copy assignment operator, destructor, etc, times the user written ones and synthesize ones, plus the move copy / assignment. It ...
athos's user avatar
  • 6,260
1 vote
1 answer
76 views

How to use a if else statement on constraints in swift

The code below has a uicolor box when pressed, the box becomes a smaller uicolor box. The problem is that the color box can only be pressed one time. So the box can go from large to small but it cant ...
user avatar
2 votes
2 answers
4k views

std::move changes address of variables?

I found unexpected (at least for me) behavior. class A { char _text[100]; char* _beg; char* _end; public: explicit A(char* text, size_t tsize) : _beg(&text[0]), _end(&text[...
Arkady's user avatar
  • 2,122
0 votes
1 answer
76 views

C# cmd window starts to open and close after .exe file start

When I start my exe file after copying it to another location a cmd window pops up and closes every second and the moved file does not start either. I simply want to move my exe file to somewhere ...
ninjaxelite's user avatar
  • 1,168
0 votes
1 answer
1k views

How to expand UIView and move other components when expanded

I have a view Controller that contains filter_View and a tableView_Players . When I press the button "Filter la recherche" I want the Filter_View to expand this way and results moving the ...
Aymen BRomdhane's user avatar
0 votes
0 answers
668 views

Batch File: Move files into respective monthly folders

I have researched this quite a bit - and while there appears to be some documentation out on the web (especially on Stackoverflow), I find that it's hard to understand what the programming is doing. ...
John Buckingham's user avatar
1 vote
0 answers
76 views

Trouble with magento 1.9.2.4

First of all sorry for my poor English. I'm new in magento, but I decided to use it and bought the template. I try it intalled on my local server and all was good (openserver, windows), after that i ...
Naill's user avatar
  • 11
0 votes
1 answer
2k views

Applescript how to move files from 1 folder to another. Can’t make into type integer Error

I am trying to move files from 1 folder to a certain folder if they have a specific name. The listOfFiles are the files to be moved. I am getting an error cant make Can’t make {\"file1.rtf\", \"...
Matt's user avatar
  • 147
1 vote
0 answers
60 views

Move ball in opposite direction

I have to image buttons in shape of two balls I want to move ball in opposite direction as it get hit by other ball.it is moving alright when it collide with other but i want to move ball in opposite ...
misbah's user avatar
  • 39
17 votes
2 answers
29k views

Does std::move work with lvalue references? How does std::move work on standard containers?

#include <vector> struct A { int a[100]; }; void foo (const A& a) { std::vector<A> vA; vA.push_back(std::move(a)); // how does move really happen? } int main () { A a; foo(...
iammilind's user avatar
  • 69.1k
0 votes
1 answer
674 views

Speed up Batch file processing, moving file to folder of same name

I need some help moving files into folders of the same name. I have a batch file that works but it is very slow. I'm moving approximately 3300 .xlsx files into folders with like names. Here is what ...
DHuber's user avatar
  • 17
0 votes
0 answers
451 views

CDialog child windows

I just wanted to use insde of a good old MFC Dialog based application 2 more moveable dialogs as childs. After solution wizard, i made a Default Dialog resource (child style) and created 2 dialogs in ...
Stefan_l_01's user avatar
0 votes
1 answer
2k views

cron job to move 10 day old files to different directory

I need a script that I can run from a cron job to move files that are 10 days old or older to a different directory. Being a windows sys admin, I have no idea what I'm doing in linux. :( Can ...
Andy's user avatar
  • 3

1
32 33
34
35 36
70