0

I'm trying to figure out how you can overload the input operator for some input but use the normal input operator for other values. For instance,

cin >> a; //take in a normally
in >> b; //pass with the overloaded input operator

How do I differentiate when writing the overloaded operator function?

Cory Kramer
  • 114,268
  • 16
  • 167
  • 218
borchr
  • 9
  • 5
  • If `a` and `b` are the same type, you can't differentiate. From that you may infer that the differentiator is the data's type. – user4581301 Apr 19 '17 at 18:15
  • In the above linked question, see specifically [stream operators](https://stackoverflow.com/questions/4421706/operator-overloading/4421719#4421719) where you can define `std::istream& operator>>(std::istream& is, T& obj)` for your object – Cory Kramer Apr 19 '17 at 18:15

0 Answers0