# Poco

# template < class T >

# class Buffer

Library: Foundation
Package: Core
Header: Poco/Buffer.h

## Description

A very simple buffer class that allocates a buffer of a given type and size in the constructor and deallocates the buffer in the destructor.

This class is useful everywhere where a temporary buffer is needed.

## Member Summary

Member Functions: begin, end, operator, size

## Constructors

### Buffer

Buffer(
std::size_t size
);

Creates and allocates the Buffer.

## Destructor

### ~Buffer

~Buffer();

Destroys the Buffer.

## Member Functions

### begin

T * begin();

Returns a pointer to the beginning of the buffer.

### begin

const T * begin() const;

Returns a pointer to the beginning of the buffer.

### end

T * end();

Returns a pointer to end of the buffer.

### end

const T * end() const;

Returns a pointer to the end of the buffer.

### operator

T & operator[] (
std::size_t index
);

### operator

const T & operator[] (
std::size_t index
) const;

### size

std::size_t size() const;

Returns the size of the buffer.