On the left, I am "you".
On the right, I am "it".
On the forward, I am either "you" or "it".
What am I?
Subtle hint:
I myself is always on the left.
Moderate hint:
There are two kinds of "it".
Decisive hint:
And
On the left, I am "you".
On the right, I am "it".
On the forward, I am either "you" or "it".
What am I?
Subtle hint:
I myself is always on the left.
Moderate hint:
There are two kinds of "it".
Decisive hint:
And
Ok, second attempt. You are a:
reference
On the left, I am "you".
Lvalue references refer to a live object, hence "you".
On the right, I am "it".
Rvalue references refer to a temporary object, hence "it".
On the forward, I am either "you" or "it".
Forwarding references can either be lvalue references or rvalue references.
Hints:
Hint 1:
I myself is always on the left.
References themselves are always lvalues.
Hint 2:
There are two kinds of "it".
Rvalues are further classified as prvalues or xvalues.
Hint 3:
And
References are declared liketype&
(lvalue reference), andtype&&
(rvalue reference).
&
nyfb unccraf gb unir gur anzr "ersrerapr bcrengbe", fb vg'f grpuavpnyyl nyfb ba gur yrsg/evtug)
$\endgroup$
– Avi
Nov 8 at 20:48
I think you are
a
boolean
taking a value through the|=
operator (in C++/Java)
As an example:
boolean you = ...; boolean it = ...; you |= it; // you, depending on the values of you and it, is either you or it
On the left, I am "you".
you |= it;
On the right, I am "it".
you |= it;
Forwardly, I am either "you" or "it".
In C++/Java, the |= operator returns the value that was assigned, in this case
you | it
, i.e., you or it
you
", then "On the right I am it
" doesn't quite make sense, because on the right it
is simply another variable. If "I am boolean
", then I'd say it makes equal sense to say "I am int
": just change all the boolean
to int
, and |=
means bitwise or.
$\endgroup$
– WhatsUp
Nov 3 at 17:23
Are you
std::conditional
?
Still trying to work out the hints.
Extra:
You said that C++ was the correct language in the comments under another answer.
[note: this answer has been through many changes, please see the edit history to reveal all the incorrect guesses that I made]
you
" while you
is effectively "in the middle"...
$\endgroup$
– WhatsUp
Nov 4 at 20:16
you
is the condition.
$\endgroup$
– JL2210
Nov 4 at 20:18
Are you
a Boolean set by a conditional statement?
Example:
int a = 7;
bool you = false; // set the boolean value to false
you = (a > 5); // “you” will be equal either to itself (still) or to the result of the comparison (the “it”)
Maybe you are
a string (in an if-else or other conditional statement)
First of all,
"you" and "it" are in quotes
On the left, I am "you".
if(stringName === "you") { something happens }
On the right, I am "it".
else if(stringName === "it") { something else happens }
On the forward, I am either "you" or "it".
without the if-else statement (or any other conditional statement) the string could either be "you" or "it" and the action will still take place.
Hint
Declared as "you":
String stringName = "you";
Are you?
A varying iterator
On the left, I am "you".
On the right, I am "it".
On the forward, I am either "you" or "it".
A forward iterator between two fixed iterators begin() and end() is either pointing to an element in the range (which we can refer to as being of the type "you" as it is pointing to an object and calling it out -- imagine the pointer as someone literally pointing their finger and yelling "You!", "You!", "You!") or points to nothing (more specifically points to something outside the range i.e. points to nothing in particular) in which case it is simply an iterator (it). When performing forward iteration (from left to right), the varying iterator goes: you-you-...-you-it
You are
Condition
On the left, I am "you".
A variable declared by you.
On the right, I am "it".
A value that has something to do with the variable
On the forward, I am either "you" or "it".
you dont need to state condition when you use a function
Are you an
Iterator statement like
this->it = *it;Let's analyse this solution. On the left, I am "you". On the left of the arrow this references the current class (or you). On the right, I am "it". On the right of the arrow, it is the iterator variable. On the forward, I am either "you" or "it". By forward I am guessing you mean the forward iterator (or perhaps the forward arrow). Hint 1: I myself is always on the left. this is always on the left. Hint 2: There are two kinds of "it". One is it the other is *it. Hint 3: And. Not sure about this one... Or perhaps it isthis = this->it;