c - Difference between __pragma(deprecated) and __declspec(deprecated) -


To degrade the object as C / C ++ in Visual Studio, you have three solutions: < / P>

  • #pragma dislikes (x)
  • __pragma (deprecated (x))
  • __discacks (excluded (x))

    The first two are identical, except that only one other can be used inside a macro; The first person I have kept for the first time is only for perfection, the third person is the most used in the community.

    I wonder what is the difference between the two people. According to the documentation on MSDN and, I think there is no difference. The strange thing is that different warning codes are raised depending on what you are using: C4995 for Proge-case, C4996 for declspec-case.

    So someone knows whether there really is a difference (any small), or why do not these instructions raise the same warning code?

    With the exceptions given below, Deprecated Declaration similar functionality to the excluded pragma :

  • Deprecated You can specify the special form of freeze overload in the form of dislikes, while the prema form function This applies to all overloaded forms of the name.
  • The deprecated announcement lets you specify a message that will be displayed at compile time. The text of the message can be from the macro.
  • The macro can be marked as Excluded with a deprecated program. <

    Microsoft specific

    compiler also __programme , which has the same functionality, but the inline can be used in the #Promma instructions macro definition.


    It is worth noting, as @duplicator is mentioned, that C ++ 14 [[deprecated ]] introduces the feature.

    7.6.5 Deprecated attribute [dcl.attr.deprecated]

    attribute-token deprecated can be used to mark names and entities that are still allowed, but for some reason the frustrated [ note : in particular, the Deprecated is suitable for those names and organizations that are considered obsolete or unsafe. - End note ]


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -