c++ - Visual studio equivalent for __attribute__ ((warn_unused_result)) -



c++ - Visual studio equivalent for __attribute__ ((warn_unused_result)) -

considering next code:

struct mytype{}; mytype myfunction() __attribute__ ((warn_unused_result)) { homecoming mytype{}; } int main() { myfunction(); auto stormytype = myfunction(); }

not storing homecoming value of myfunction logical error , want have compilation error on compilers. there equivalent visual studio 2013?

the annotation _check_return_

annotates homecoming value , states caller should inspect it. checker reports error if function called in void context.

however, believe sal annotations available in premium , ultimate versions of visual studio.

msdn: annotating function behavior

c++ visual-studio visual-studio-2013

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -