// ----------------------------------------------------------------------
//
// mutable.cc - Is 'mutable' keyword understood and properly supported?
//
// History:
//   14-Jun-1999  WEB  Adapt from Blitz++ compiler validation suite
//   18-Jun-1999  WEB  Adopt new name for compliance header
//   25-Apr-2001  WEB  s/<ISOcxxSyntax.hh>/"ISOcxx\/ISOcxxSyntax.hh"/
//
// ----------------------------------------------------------------------


#include "ISOcxx/ISOcxxSyntax.hh"


class Num {

public:
  Num( int z ) : myX(z), myN(0)  { ; }

  void  set(int z)  { myX = z; }

  int  get() const  {
      ++ MUTABLE_ENTITY(int, myN);
      return myX;
  }  // get()

  int  getCount() const  { return myN; }

private:
  int         myX;
  mutable int myN;

};  // Num


int  main()  {

  Num  q(4);
  q.set(5);

  int  k = q.get();  // 1st read
  q.get();           // 2nd read

  return  ( k == 5  && q.getCount() == 2 ) ? 0 : 1;

}  // main()
