---
name: "ACE_Auto_String_Free"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Auto_String_Free"
---

# ACE\_Auto\_String\_Free(3)

Simple class to automatically de-allocate strings

## NAME

ACE\_Auto\_String\_Free -  Simple class to automatically de-allocate strings

## SYNOPSIS

```
#include <ace/SString.h>
class ACE_Auto_String_Free
{
  public:
    ACE_EXPLICIT ACE_Auto_String_Free (char* p = 0);
    ACE_Auto_String_Free (ACE_Auto_String_Free &rhs);
    ACE_Auto_String_Free& operator= (ACE_Auto_String_Free &rhs);
    ~ACE_Auto_String_Free (void);
    char* operator* () const;
    char operator[] (int i) const;
    char* get (void) const;
    char* release (void);
    void reset (char* p = 0);
  private:
    char* p_;
};
```

## DESCRIPTION

Keeps a pointer to a string and deallocates it (using ACE\_OS::free) on its destructor. If you need to delete using "delete\[\]" the ACE\_Auto\_Array\_Ptrchar\* is your choice. The class plays the same role as auto\_ptr

## PUBLIC MEMBERS

```
ACE_EXPLICIT ACE_Auto_String_Free (char* p = 0);
```

```
ACE_Auto_String_Free (ACE_Auto_String_Free &rhs);
```

```
ACE_Auto_String_Free& operator= (ACE_Auto_String_Free &rhs);
```

```
~ACE_Auto_String_Free (void);
```

```
char* operator* () const;
```

```
char operator[] (int i) const;
```

```
char* get (void) const;
```

```
char* release (void);
```

```
void reset (char* p = 0);
```

## PRIVATE MEMBERS

```
char* p_;
```

## AUTHOR

Douglas C. Schmidt (schmidt@cs.wustl.edu)

## LIBRARY

ace
