Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

(};|=

Name: Anonymous 2011-10-15 23:44


#include <iostream>

using namespace std;

class funzies {
  public:
    funzies(int value) : value_(value) {}
    ~funzies() {}

    funzies& operator++() {
      value_++;
      return *this;
    }

    funzies& operator++(int) {
      ++value_;
      return *this;
    }

    funzies& operator--() {
      value_--;
      return *this;
    }

    funzies& operator--(int) {
      --value_;
      return *this;
    }



    friend ostream& operator<<(ostream& stream, funzies& self) {
      return stream << self.value_;
    }
  private:
    int value_;
};

int main(int argc, char** argv) {
  funzies funfun(6);
  cout << funfun << endl;
  cout << ++funfun++ << endl;
  cout << ++++funfun++++ << endl;
  cout << ++--funfun--++ << endl;
  cout << --++--++--funfun--++--++-- << endl;
  return 0;
}


output:


6
8
12
12
10

Name: Anonymous 2011-10-16 2:11

>>4

I want to make code that does something look liek:


--***--++--++(--(actor->planner)++--->action(0)++.decide()--

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List