in C Plus Plus by
Q:
The attribute [[deprecated]] C++ 14 Feature

1 Answer

0 votes
by

The deprecated attribute allows marking an entity deprecated, which makes it still legal to use but puts users on notice that use is discouraged and may cause a warning message to be printed during compilation. An optional string literal can appear as the argument of deprecated, to explain the rationale for deprecation and/or to suggest a replacement.

[[deprecated]] int f();

[[deprecated("g() is thread-unsafe. Use h() instead")]]
void g( int& x );

void h( int& x );

void test()
{
  int a = f(); // warning: 'f' is deprecated
  g(a); // warning: 'g' is deprecated: g() is thread-unsafe. Use h() instead
}
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

+1 vote
+1 vote
asked Jan 4, 2020 in C Plus Plus by AdilsonLima
+1 vote
asked Jan 4, 2020 in C Plus Plus by AdilsonLima
+1 vote
asked Jan 4, 2020 in C Plus Plus by AdilsonLima
0 votes
asked Jul 2, 2019 in React JS by Venkatshastri
+2 votes
asked Jan 21 in C Plus Plus by SakshiSharma
+1 vote
asked Jan 20 in C Plus Plus by SakshiSharma
...