brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 3967eb1 Raw
40 lines · c
1//===-- in_place utility ----------------------------------------*- C++ -*-===//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#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_UTILITY_IN_PLACE_H9#define LLVM_LIBC_SRC___SUPPORT_CPP_UTILITY_IN_PLACE_H10 11#include "src/__support/macros/attributes.h" // LIBC_INLINE, LIBC_INLINE_VAR12#include "src/__support/macros/config.h"13 14#include <stddef.h> // size_t15 16namespace LIBC_NAMESPACE_DECL {17namespace cpp {18 19// in_place20struct in_place_t {21  LIBC_INLINE explicit in_place_t() = default;22};23LIBC_INLINE_VAR constexpr in_place_t in_place{};24 25template <class T> struct in_place_type_t {26  LIBC_INLINE explicit in_place_type_t() = default;27};28template <class T> LIBC_INLINE_VAR constexpr in_place_type_t<T> in_place_type{};29 30template <size_t IDX> struct in_place_index_t {31  LIBC_INLINE explicit in_place_index_t() = default;32};33template <size_t IDX>34LIBC_INLINE_VAR constexpr in_place_index_t<IDX> in_place_index{};35 36} // namespace cpp37} // namespace LIBC_NAMESPACE_DECL38 39#endif // LLVM_LIBC_SRC___SUPPORT_CPP_UTILITY_IN_PLACE_H40