Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Howard Hinnant | b64f8b0 | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <memory> |
| 11 | |
| 12 | // template <class T, class Alloc> struct uses_allocator; |
| 13 | |
| 14 | #include <memory> |
| 15 | #include <vector> |
| 16 | |
| 17 | struct A |
| 18 | { |
| 19 | }; |
| 20 | |
| 21 | struct B |
| 22 | { |
| 23 | typedef int allocator_type; |
| 24 | }; |
| 25 | |
| 26 | int main() |
| 27 | { |
| 28 | static_assert((!std::uses_allocator<int, std::allocator<int> >::value), ""); |
| 29 | static_assert(( std::uses_allocator<std::vector<int>, std::allocator<int> >::value), ""); |
| 30 | static_assert((!std::uses_allocator<A, std::allocator<int> >::value), ""); |
| 31 | static_assert((!std::uses_allocator<B, std::allocator<int> >::value), ""); |
| 32 | static_assert(( std::uses_allocator<B, double>::value), ""); |
| 33 | } |