[flang][OpenMP] Use range-for to iterate over SymbolSourceMap, NFC
[llvm-project.git] / libcxx / test / std / utilities / memory / specialized.algorithms / buffer.h
blob1114fdc68e7245fa708833db9faef9f9247273ec
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef LIBCPP_TEST_STD_UTILITIES_MEMORY_SPECIALIZED_ALGORITHMS_BUFFER_H
11 #define LIBCPP_TEST_STD_UTILITIES_MEMORY_SPECIALIZED_ALGORITHMS_BUFFER_H
13 template <typename T, int N>
14 struct Buffer {
15 alignas(T) char buffer[sizeof(T) * N] = {};
17 T* begin() { return reinterpret_cast<T*>(buffer); }
18 T* end() { return begin() + N; }
19 const T* cbegin() const { return reinterpret_cast<const T*>(buffer); }
20 const T* cend() const { return cbegin() + N; }
22 constexpr int size() const { return N; }
25 #endif // LIBCPP_TEST_STD_UTILITIES_MEMORY_SPECIALIZED_ALGORITHMS_BUFFER_H