---
name: "ACE_Array"
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_Array"
---

# ACE\_Array(3)

Implement a dynamic array class.

## NAME

ACE\_Array -  Implement a dynamic array class.

## SYNOPSIS

```
#include <ace/Containers.h>
template<class T>
class ACE_Array : public ACE_Array_Base<T>
{
  public:
    typedef T TYPE;
    typedef ACE_Array_Iterator<T> ITERATOR;
    ACE_Array (size_t size = 0, ACE_Allocator* alloc = 0);
    ACE_Array (
        size_t size,
        const T &default_value,
        ACE_Allocator* alloc = 0
        );
    ACE_Array (const ACE_Array<T> &s);
    void operator= (const ACE_Array<T> &s);
    int operator== (const ACE_Array<T> &s) const;
    int operator!= (const ACE_Array<T> &s) const;
};
```

## DESCRIPTION

This implementation of an unordered set uses a fixed array. This implementation does not allow duplicates...

## Exceptions.

## Initialization and termination methods.

```
ACE_Array (size_t size = 0, ACE_Allocator* alloc = 0);
```

Dynamically create an uninitialized array.

```
ACE_Array (
    size_t size,
    const T &default_value,
    ACE_Allocator* alloc = 0
    );
```

Dynamically initialize the entire array to the default\_value.

```
ACE_Array (const ACE_Array<T> &s);
```

The copy constructor performs initialization by making an exact copy of the contents of parameter s, i.e., \*this == s will return true.

```
void operator= (const ACE_Array<T> &s);
```

Assignment operator performs an assignment by making an exact copy of the contents of parameter s, i.e., \*this == s will return true.  Note that if the max\_size\_ of array\_ is = than s.max\_size\_ we can copy it without reallocating.  However, if max\_size\_ is  s.max\_size\_ we must delete the array\_, reallocate a new array\_, and then copy the contents of s.

## Compare operators

```
int operator== (const ACE_Array<T> &s) const;
```

Compare this array with s for equality.  Two arrays are equal if their size's are equal and all the elements from 0 .. size are equal.

```
int operator!= (const ACE_Array<T> &s) const;
```

Compare this array with s for inequality such that \*this != s is always the complement of the boolean return value of \*this == s.

## AUTHOR

Doug Schmidt

## Initialization and termination methods.

## Check boundary conditions.

## Classic unordered set operations.

## LIBRARY

ace
