genericopenlibs/cppstdlib/stl/test/unit/fib.h
author William Roberts <williamr@symbian.org>
Fri, 23 Jul 2010 11:57:06 +0100
branchGCC_SURGE
changeset 46 0a3770c1cffe
parent 45 4b03adbd26ca
permissions -rw-r--r--
Reapply the libstdcpp.mmp file change for bug 2971

#ifndef _fib_h
#define _fib_h
class Fibonacci
{
  public:
    Fibonacci() : v1(0), v2(1) {}
    inline int operator()();
  private:
    int v1;
    int v2;
};

inline int
Fibonacci::operator()()
{
  int r = v1 + v2;
  v1 = v2;
  v2 = r;
  return v1;
}
#endif // _fib_h