Template Struct DeprecatedMember¶
Defined in File deprecated_member.hpp
Struct Documentation¶
-
template<typename T>
struct DeprecatedMember¶ the base of the type of a deprecated data member of an aggregate, declared with SEQUANT_DEPRECATED_MEMBER: holds a T, and can be given one only by the derived type, whose converting constructor carries the deprecation
Marking an aggregate’s data member
[[deprecated]]directly is not portable: gcc 15 counts the default member initializer of a deprecated member as a use of it, in every designated initialization of the aggregate that omits the member (that is, in every caller’s expression, which no pragma in the header that declares the member reaches). Carrying the deprecation on the converting constructor of the member’s type instead diagnoses the member where it is given a value,{.old_name = ...}, and nowhere else, on every compiler.- Template Parameters:
T – the type of the value the member holds
Public Functions
-
DeprecatedMember() = default¶
the member’s type must stay default-constructible for the aggregate’s default member initializer, which is not a use of the deprecated spelling
Protected Functions
-
template<typename U>
inline constexpr DeprecatedMember(detail::deprecated_member_init_t, U &&u)¶