C++ Standard Library C++ STL Library

C++ <memory> - allocator_traits Template



The C++ <memory> allocator_traits template supplies a uniform interface for allocator types.

Syntax

template <class Alloc> struct allocator_traits;

Parameters

x Specify the value.

Static member functions

FunctionsDescription
destroy Allocator traits.

Example:

In the example below, erf() function returns the error function of the given value.

#include <iostream>
#include <cmath>

using namespace std;
 
int main (){
  cout<<erf(0)<<"\n";
  cout<<erf(1)<<"\n";
  cout<<erf(2)<<"\n";
  cout<<erf(-1)<<"\n";
  cout<<erf(-2)<<"\n";    
  return 0;
}

The output of the above code will be:

0
0.842701
0.995322
-0.842701
-0.995322

❮ C++ <memory> Library

5