# Either You Or It

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

• is that a variable? – rsonx Nov 3 '19 at 6:50
• @rsonx Yes, kind of. – Dannyu NDos Nov 3 '19 at 7:13
• That is an if-else comparison. right? – rsonx Nov 3 '19 at 7:14
• @rsonx Not in the language. – Dannyu NDos Nov 3 '19 at 7:18
• What does forwardly means? This might be the branch prediction. – rsonx Nov 3 '19 at 7:22

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 like type& (lvalue reference), and type&& (rvalue reference).

• Gah! Inaccurate explanation. rot13(Gur nafjre vf "ersrerapr", abg gur nqqerff-bs bcrengbe.) – Dannyu NDos Nov 8 '19 at 20:45
• @DannyuNDos rot13(Gung jnf gur nafjre. Gur bayl ernfba "bcrengbe" vf gurer va cneragurfrf vf gung & nyfb unccraf gb unir gur anzr "ersrerapr bcrengbe", fb vg'f grpuavpnyyl nyfb ba gur yrsg/evtug) – Avi Nov 8 '19 at 20:48
• rot13(V zrna V bayl vagraqrq gur ersrerapr glcr.) – Dannyu NDos Nov 8 '19 at 20:58
• @DannyuNDos Ah, fair enough – Avi Nov 8 '19 at 20:59
• Since your answer was the most accurate, I gave you the bounty. Your answer has been edited to the intended answer. – Dannyu NDos Nov 13 '19 at 0:32

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

• But what exactly am "I"? If "I am 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. – WhatsUp Nov 3 '19 at 17:23
• @WhatsUp You're right, I'm not sure what it is then – Avi Nov 3 '19 at 17:27
• rot13(Lbh tbg gur evtug ynathntr, ohg fbeel, gung'f vapbeerpg.) – Dannyu NDos Nov 3 '19 at 22:10

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]

• @DannyuNDos rot13(Vf vg gur greanel bcrengbe?) – S.S. Anne Nov 4 '19 at 16:35
• This looks very much like the correct answer, especially with the comment "On the second thought, an if-else comparison is needed anyway." But for me it's a bit strange to say "on the left, I am you" while you is effectively "in the middle"... – WhatsUp Nov 4 '19 at 20:16
• @WhatsUp Yeah, still trying to work that out. It may be that you is the condition. – S.S. Anne Nov 4 '19 at 20:18
• Sorry, not the correct answer either. rot13(Gur ynathntr va punetr vf P++, abg Wnin.) – Dannyu NDos Nov 4 '19 at 21:31
• Because there is a lower limit on the comment length. – Dannyu NDos Nov 7 '19 at 3:22

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”)

• rot13(Fbeel, gung'f vapbeerpg.) – Dannyu NDos Nov 3 '19 at 22:10

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";

• Sadly, not the correct answer. – Dannyu NDos Nov 4 '19 at 10:50

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

• Sadly, not the correct answer. – Dannyu NDos Nov 5 '19 at 3:43

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

• Sadly, not the correct answer. – Dannyu NDos Nov 6 '19 at 20:30

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 is
this = this->it;