Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
2 answers
124 views

Suppose I have the following: df1 <- data.frame(id=c(1,2,3)) df2 <- data.frame(id=c(2,3,4)) I want to print: (1) The number of IDs in df1 but not in df2, (2) the number of IDs in df2 but not in ...
robertspierre's user avatar
-1 votes
1 answer
49 views

I had to implement a copy operator for a class which contains a QSharedDataPointer to the private data. Which is working, but only as long as I do not delete one of the copies. Other than expected it ...
Jodeli's user avatar
  • 11
0 votes
3 answers
111 views

I am currently learning C and in one slide the professor states that Semicolons added to an expression makes it a statement. While on the other hand it mentioned that all assignments are expressions. ...
Qingyang Gu's user avatar
6 votes
1 answer
162 views

In addition to an implicitly-defined copy assignment operator, if a class also defines an operator= without an lvalue-reference object parameter, which of the operators must be selected? Please ...
Fedor's user avatar
  • 24.7k
2 votes
4 answers
131 views

I was given the code: #include <stdio.h> int main(void) { int a = 0, b = 0, c = 0; c = (a -= a - 5), (a = b, b + 3); printf("a = %d, b = %d, c = %d", a, b, c); // a = 0, b =...
xiushama's user avatar
3 votes
1 answer
53 views

This is a contrived example for the sake of my understanding Kotlin language. The class Box<T> below models a box that contains boxes of the same type T. The question is why arr += x causes ...
Royalblue's user avatar
  • 701
0 votes
0 answers
41 views

I am writing 2 Mbyte file line by line and using string variable to populate the data line by line first When i did in loops str = str + new_data it took couple seconds to process the script. Once i ...
Roman Toasov's user avatar
-1 votes
1 answer
69 views

function sayHello (userName) { console.log ('Hello ${userName}') ; } sayHello ('Mena') ; function sayHello (userName) { console.log ('Hello ${userName}') ; } sayHello ('mena') ; // i ...
Mena Makrem's user avatar
1 vote
1 answer
151 views

**How are these two different. ** (1) starting_dictionary = { "a": 9, "b": 8, } final_dictionary = { "a": 9, "b": 8, "c": 7, } ...
Vyagh's user avatar
  • 11
0 votes
0 answers
55 views

I have a template base class that implements void operator=(T value). Then I have a derived template class which should just inherit that operator, but this doesn't work. (See compile error in the ...
Thomas Klier's user avatar
0 votes
1 answer
74 views

In-place swap is a technique, which is used to swap a content of two distinct variables without any temporary storage variable. GoLang Spec mentions: A tuple assignment assigns the individual elements ...
user1787812's user avatar
0 votes
0 answers
110 views

I am currently studying "Object-oriented design choices" by Dingle (2021), a required textbook for my Object-Oriented Design Class. While going through the chapter on "Move Semantics,&...
i_hate_F_sharp's user avatar
0 votes
0 answers
91 views

My reference is to options (4), (5) and (6) of std::optional::operator= Given the premise that The class template std::optional manages an optional contained value, i.e. a value that may or may not be ...
Vinod's user avatar
  • 1,215
-2 votes
3 answers
104 views

I am new to C and got a little confused. I have code where I am using += operator with a variable when declared but it is giving me an error for this operator, but working fine when used inversely i.e....
user3737377's user avatar
6 votes
3 answers
308 views

I am dealing with objects that allocate memory for internal use. Currently, they are not copyable. E.g. class MyClass { public: MyClass() { Store = new int; } ~MyClass() { delete Store; } ...
user avatar
4 votes
2 answers
111 views

template <typename T> class MyPointer {public: template <typename U> void operator=(MyPointer<U>&& other) { } char* get() const { return pointer; } ...
Zebrafish's user avatar
  • 16.3k
2 votes
1 answer
91 views

In JavaScript (JS), ++ has higher precedence than += or =. In trying to better understand operator execution order in JS, I'm hoping to see why the following code snippet results in 30 being printed? ...
mishar's user avatar
  • 455
2 votes
1 answer
155 views

It's fairly common to see a declaration and assignment combined like this: int beans = a * 2; or separate, like this int beans; beans = a * 2; My current understanding is that beans can be assigned ...
Aaron Linnell's user avatar
0 votes
1 answer
68 views

I am implementing assignment operator function for a template matrix class. It should take care of different datatype matrix assignments. eg Integer matrix is assigned to a double matrix. for that i ...
Renu's user avatar
  • 29
5 votes
1 answer
173 views

volatile int lhs = 1; int rhs = 2; int x = 3; x = lhs = rhs; Does an assigment operator return the (typeof lhs)rhs ? or Does it return new, just read value of lhs ? It is important to me since lhs ...
OODAX's user avatar
  • 159
0 votes
1 answer
130 views

I have a list of sales reps for one of 5 territories. I need to assign them to a list of leads in equal numbers. Here's an example of the dictionary: d = {'Large': 'Jackson', 'Large': 'Stevens', '...
reenum's user avatar
  • 1
4 votes
1 answer
1k views

I have a Kotlin class that wraps a mutable value. class StringWrapper( var value: String = "" ) { override fun toString(): String = value } I use this wrapper as properties in a custom ...
aSemy's user avatar
  • 7,548
0 votes
2 answers
127 views

I don't understand why, on this code, 'b+=' return 6 instead of 5. The operation on right-end of operator '+=', should be 0. i/2 = 4 a-4= 0 So Operator '+=' should just add: 0. #include<stdio.h&...
ivan pasquini's user avatar
0 votes
0 answers
157 views

we use an assignment operator = in order to assign a value to a variable, so the value assigned is an operand but the variable itself counts as another one?? if not is only a unary operator, that ...
Cristian Lopez's user avatar
-1 votes
1 answer
91 views

I have the following struct: struct Feedback : public TaggedUnion<Feedback1Idx, String> { using TaggedUnion<Feedback1Idx, String>::TaggedUnion; using TaggedUnion<Feedback1Idx, ...
ZeroZ30o's user avatar
  • 396

1
2 3 4 5
28