llvm-project
33 строки · 865.0 Байт
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-exception
6//
7//===----------------------------------------------------------------------===//
8
9// <set>
10
11// class set
12
13// allocator_type get_allocator() const
14
15#include <set>16#include <cassert>17
18#include "test_allocator.h"19#include "test_macros.h"20
21int main(int, char**) {22{23std::allocator<int> alloc;24const std::set<int> s(alloc);25assert(s.get_allocator() == alloc);26}27{28other_allocator<int> alloc(1);29const std::set<int, std::less<int>, other_allocator<int> > s(alloc);30assert(s.get_allocator() == alloc);31}32return 0;33}
34