c ++ – A `std :: allocator` implementation C C ++ 17

This is an implementation of C ++ 17 std :: allocator under the name of my_std :: allocator, with obsolete elements omitted for the sake of simplicity.

// An implementation of C ++ 17 std :: allocator
// with obsolete members omitted

#understand 
#understand 
#understand 

namespace my_std {

model 
  class allocator {
public:
using type_value = T;
using propagate_on_container_move_assignment = std :: true_type;
using is_always_equal = std :: true_type;

allocator () noexcept = default;
allocator (const allocator &) noexcept = default;
~ allocator () = default;

model 
    allocator (const allocator&) noexcept
{
}

T * allocate (std :: size_t n)
{
if constexpr (alignof (T)> __STDCPP_DEFAULT_NEW_ALIGNMENT__)
returns static_cast(
:: new operator (n * sizeof (T), static_cast(alignof (T)))
)
other
returns static_cast(
:: new operator (n * sizeof (T))
)
}

void deallocate (T * p, std :: size_t n)
{
if constexpr (alignof (T)> __STDCPP_DEFAULT_NEW_ALIGNMENT__)
return :: delete operator (p, n * sizeof (T),
static_cast(alignof (T)));
other
return :: delete operator (p, n * sizeof (T));
}
};

model 
  bool operator == (const allocator&, allocator of const&) noexcept
{
return true;
}

model 
  bool operator! = = (const allocator&, allocator of const&) noexcept
{
returns false;
}

}

I tested it like this:

int main ()
{
std :: set <std :: string, std :: less,
my_std :: allocator> words;

for (std :: string w; std :: cin >> w;)
words.insert (std :: move (w));

for (const auto & w: words)
std :: cout << w << " n";
}

And currently no bug is discovered.