#include
#include
Using namespace std;
Template TypeName Allocator = Allocator Class Coll { PUBLIC: Explicit Coll (Const Allocator & A = Allocator ()) : Alloc (a), Sizenum (0), root (null) {} Explicit Coll (const size_t size, Const Ty & Val, Const Allocator & A = Allocator ()) : Alloc (a), Sizenum (Size), Root (NULL) { Root = alloc.allocate (sizenum); Uninitialized_fill_n (root, sizenum, val); } COLL (Const Coll : Alloc (c.alloc), Sizenum (C.Sizenum), Root (NULL) { Root = alloc.allocate (sizenum); Uninitialized_copy (c.Root, C.Root Sizenum, Root); } Virtual ~ COLL () { For (size_t i = 0; i { Alloc.destroy (& root [i]); } Alloc.deallocate (root, sizenum); } Const Coll { IF (this == & c) RETURN * THIS; IF (root! = null) { For (size_t i = 0; i { Alloc.destroy (& root [i]); } Alloc.deallocate (root, sizenum); } Alloc = c.alloc; Sizenum = C.Sizenum; Root = alloc.allocate (sizenum); Uninitialized_copy (c.Root, C.Root Sizenum, Root); Return C; } Virtual Void Output (Ostream & Strem) Const { For (size_t i = 0; i { StREM << root [i] << " } } Private: Allocator alloc; SIZE_T Sizenum; Ty * root; } Int main (void) { Coll Coll Coll B = a; B.output (cout); cin.get (); Return 0; }