Implement most of P0607: Inline Variables for the Standard Library. This involved marking a lot of variables as inline (but only for C++17 and later).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321658 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2018-01-02 17:17:01 +00:00
parent 05e705f9ec
commit c58e4723e7
15 changed files with 295 additions and 217 deletions

View File

@@ -22,7 +22,7 @@ namespace std {
// 23.6.4, no-value state indicator
struct nullopt_t{see below };
constexpr nullopt_t nullopt(unspecified );
inline constexpr nullopt_t nullopt(unspecified );
// 23.6.5, class bad_optional_access
class bad_optional_access;
@@ -195,7 +195,7 @@ struct nullopt_t
_LIBCPP_INLINE_VISIBILITY constexpr explicit nullopt_t(__secret_tag, __secret_tag) noexcept {}
};
/* inline */ constexpr nullopt_t nullopt{nullopt_t::__secret_tag{}, nullopt_t::__secret_tag{}};
_LIBCPP_INLINE_VAR constexpr nullopt_t nullopt{nullopt_t::__secret_tag{}, nullopt_t::__secret_tag{}};
template <class _Tp, bool = is_trivially_destructible<_Tp>::value>
struct __optional_destruct_base;