
All supported compilers provide support for inline variables in C++17 now. Also, as a fly-by fix, replace some uses of _LIBCPP_CONSTEXPR by just constexpr. The only exception in this patch is `std::ignore`, which is provided prior to C++17. Since it is defined in an anonymous namespace, it always has internal linkage anyway, so using an inline variable there doesn't provide any benefit. Instead, `inline` was removed entirely on `std::ignore`. Differential Revision: https://reviews.llvm.org/D110243
30 lines
1.0 KiB
C
30 lines
1.0 KiB
C
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
|
|
#define _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
|
|
|
|
#include <__config>
|
|
|
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
|
#pragma GCC system_header
|
|
#endif
|
|
|
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
|
|
|
struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; };
|
|
#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
|
|
extern _LIBCPP_EXPORTED_FROM_ABI const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
|
|
#else
|
|
/* inline */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
|
|
#endif
|
|
|
|
_LIBCPP_END_NAMESPACE_STD
|
|
|
|
#endif // _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
|