i have found these nice code for build properties and works fine with int type, but not with string(i don't have tested the others types):

Code:
#include <iostream>#include <string>
#include <assert.h>


//property class
#define READ_ONLY 1
#define WRITE_ONLY 2
#define READ_WRITE 3


template <typename Container, typename ValueType, int nPropType>
class property
{
public:
property()
{
  m_cObject = NULL;
  Set = NULL;
  Get = NULL;
}
//-- This to set a pointer to the class that contain the
//   property --
void setContainer(Container* cObject)
{
  m_cObject = cObject;
}
//-- Set the set member function that will change the value --
void setter(void (Container::*pSet)(ValueType value))
{
  if((nPropType == WRITE_ONLY) || (nPropType == READ_WRITE))
    Set = pSet;
  else
    Set = NULL;
}
//-- Set the get member function that will retrieve the value --
void getter(ValueType (Container::*pGet)())
{
  if((nPropType == READ_ONLY) || (nPropType == READ_WRITE))
    Get = pGet;
  else
    Get = NULL;
}
//-- Overload the '=' sign to set the value using the set
//   member --
ValueType operator =(const ValueType& value)
{
  assert(m_cObject != NULL);
  assert(Set != NULL);
  (m_cObject->*Set)(value);
  return value;
}
//-- To make possible to cast the property class to the
//   internal type --
operator ValueType()
{
  assert(m_cObject != NULL);
  assert(Get != NULL);
  return (m_cObject->*Get)();
}
private:
  Container* m_cObject;  //-- Pointer to the module that
                         //   contains the property --
  void (Container::*Set)(ValueType value);
                         //-- Pointer to set member function --
  ValueType (Container::*Get)();
                         //-- Pointer to get member function --
};


//testing the property class
class PropTest
{
public:
  PropTest()
  {
    Count.setContainer(this);
    Count.setter(&PropTest::setCount);
    Count.getter(&PropTest::getCount);
    Name.setContainer(this);
    Name.setter(&PropTest::setName);
    Name.getter(&PropTest::getName);
  }
  int getCount()
  {
    return m_nCount;
  }
  void setCount(int nCount)
  {
    m_nCount = nCount;
  }
  property<PropTest,int,READ_WRITE> Count;




  char * getName()
  {
    return m_Name;
  }
  void setName(char  *nCount)
  {
    m_Name = nCount;
  }
  property<PropTest,char *,READ_WRITE> Name;




private:
  int m_nCount;
  char *m_Name;
};


using namespace std;
int main()
{
    PropTest a;
    a.Count=100;
    cin >> a.Name[0];
    cout << a.Name;
    cout << a.Count << endl;
    return 0;
}
even with char* the windows give me an error and close the program.
if i use string, i get istream errors. so what is the problem?
(yes now i can use C++11 code)