0

I haven't been able to find any references on this, mostly because of how difficult it is to search. I'm trying to overload the extraction (<<) operator, but not in the usual way: instead, I'd like it to take the form

myCustomClass << data << moredata;

etc. A general solution that works for any data type with a valid extraction operator would be best, since it will be passed to a valid stream in the overloaded operator function, but if necessary, limiting it to just strings is also acceptable. How would I go about doing this?

matoro
  • 181
  • 1
  • 13
  • @RSahu Thank you. Does that mean that it is impossible/highly discouraged, or that I should go about it the way you wrote in that answer? – matoro Oct 17 '16 at 00:43
  • You should go about it the way I wrote in my answer. – R Sahu Oct 17 '16 at 01:40

0 Answers0