brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · cf11d07 Raw
44 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9 10// <memory>11// UNSUPPORTED: c++03, c++11, c++1412 13// template<typename _Alloc>14// struct __is_allocator;15 16// Is either true_type or false_type depending on if A is an allocator.17 18#include <memory>19#include <string>20 21#include "test_macros.h"22#include "min_allocator.h"23#include "test_allocator.h"24 25template <typename T>26void test_allocators()27{28    static_assert(!std::__is_allocator<T>::value, "" );29    static_assert( std::__is_allocator<std::allocator<T>>::value, "" );30    static_assert( std::__is_allocator<test_allocator<T>>::value, "" );31    static_assert( std::__is_allocator<min_allocator<T>>::value, "" );32}33 34 35int main(int, char**)36{37    // test_allocators<void>();38    test_allocators<char>();39    test_allocators<int>();40    test_allocators<std::string>();41 42    return 0;43}44