util::scoped_array< T > Struct Template Reference

This class has identical behaviour to scoped_ptr, except it manages heap-allocated arrays instead of heap-allocated single objects. More...

#include <scoped_resource.hpp>

Inheritance diagram for util::scoped_array< T >:

Inheritance graph
[legend]
Collaboration diagram for util::scoped_array< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 scoped_array (T *p)


Detailed Description

template<typename T>
struct util::scoped_array< T >

This class has identical behaviour to scoped_ptr, except it manages heap-allocated arrays instead of heap-allocated single objects.

Usage example:

 {
    const scoped_array<char> ptr(new char[n]);
    ...use ptr as you would a normal char*...
 } // ptr is automatically deleted here

Definition at line 175 of file scoped_resource.hpp.


Constructor & Destructor Documentation

template<typename T>
util::scoped_array< T >::scoped_array ( T *  p  )  [inline, explicit]

Definition at line 177 of file scoped_resource.hpp.


The documentation for this struct was generated from the following file:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs