A name marked as discouraged does not imply that it will be removed in the future, it is not a precursor to deprecated. And it conditionally generates a warning.
--
From: Std-Proposals <std-proposals-bounces@lists.isocpp.org> on behalf of Andrey Semashev via Std-Proposals <std-proposals@lists.isocpp.org>
Sent: Sunday, November 5, 2023 19:18
To: std-proposals@lists.isocpp.org <std-proposals@lists.isocpp.org>
Cc: Andrey Semashev <andrey.semashev@gmail.com>
Subject: Re: [std-proposals] Keeping C++ Young: Migrating to Modern C++On 11/5/23 14:11, Yexuan Xiao via Std-Proposals wrote:
> I propose a new standard attribute, [[discouraged]], and a new macro,
> #strict, to indicating that the name or entity declared with this
> attribute is discouraged from use, and giving an alternative.
>
> [[discouraged( string-literal )]]
> string-literal - an unevaluated string literal that could be used to
> explain the rationale for discouragement and to suggest a replacing entity
>
> macro #strict
> #strict can appear anywhere in the file, and once the file contains this
> macro, the compiler will generate warnings for all uses of names and
> syntax that are marked as discouraged, and give the reason.
>
> Full proposal written with bikeshed here:
> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapi.csswg.org%2Fbikeshed%2F%3Furl%3Dhttps%3A%2F%2Fstorage.nykz.org%2Fproposals%2Fkeeping-cxx-young.bs%26force%3D1&data=05%7C01%7C%7Cfeeb6e510b0446d4ab3708dbddf0f760%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638347799252785276%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=O6FWAqbou7wxTn4RonkCwP4moduJuZllOOOwFX2kCVY%3D&reserved=0 <https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapi.csswg.org%2Fbikeshed%2F%3Furl%3Dhttps%3A%2F%2Fstorage.nykz.org%2Fproposals%2Fkeeping-cxx-young.bs%26force%3D1&data=05%7C01%7C%7Cfeeb6e510b0446d4ab3708dbddf0f760%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638347799252785276%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=O6FWAqbou7wxTn4RonkCwP4moduJuZllOOOwFX2kCVY%3D&reserved=0>.
How is it different from [[deprecated]]?
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fstd-proposals&data=05%7C01%7C%7Cfeeb6e510b0446d4ab3708dbddf0f760%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638347799252785276%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=RJsZGgHcQ4Np3B%2FWKQfVjNLQOvzLehP3QhodMdqcgJs%3D&reserved=0
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals